           github.to_api_url site, "/gists/#{id}"
         gist = gist.toString()
         if gist.indexOf('http') != 0
-          site = settings.get 'githubs', github.default()
+          site = settings.get 'sites', github.default()
           build_url site, gist
         else
-          site = github.get_github gist
+          site = github.get_site_from_url gist
 
           if github?
             [id, rest...] = URI(gist).filename().split '.'

        else
          host = hostname

        settings.get 'githubs', host

      default: -> settings.get 'default'



      save_gist: (gist, options={}) ->
        github_host = options.github ? github.default()
        gh = settings.get 'sites', github_host
        http.post github.to_api_url(gh, '/gists'), gist

      to_api_url: (site, path, params={}) ->
        result = URI("#{site.api_base_url}#{path}").setQuery(params)
        result.setQuery('access_token', site.access_token) if site.access_token?
        result

      to_gist_url: (gist) ->
