+
Skip to content

This library doesn't work with the Github API v3 #110

Closed
@Pomax

Description

@Pomax

I tried running the following simple code:

var github = new Github({ token: ".....<keyhere>.....", auth: "oauth"});
var repo = github.getRepo("Pomax", "pomax.github.io");
repo.contents("master", "gh-weblog/content", function(err, result) { console.warn(err); console.log(result); }, true);
repo.remove("master", "gh-weblog/content/2013-10-31-11-26-36.json", function(err, result) { console.log(err, result); });

But this generates one error after another. The path handling in remove is not in line with the v3 API, in browser context the global vars are getting set wrong:

  • _ ends up being unknown on line 407, despite underscore having loaded
  • XMLHttpRequest gets overwritten in function scope rather than using var XMLHTTPRequest = (typeof XMLHTTPRequest === "undefined" ? false : XMLHTTPRequest);)
  • Base64 is not necessary at all in browser context (the atob() function already exists)

Even fixing those things, I get errors that the update call to git/trees is missing sha values; dir entires should have sha values as well, so I removed the filter that takes them out, and then the github API still throws up errors, so there are some problems here that prevent github.js from being usable with the API v3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载