Giter Club home page Giter Club logo

gh3's Introduction

gh3's People

Contributors

bekicot avatar bolasblack avatar cskeeters avatar daviddeutsch avatar jbohren avatar k33g avatar leivaburto avatar paskino avatar phase avatar thanpolas avatar tvorog avatar vadimgrigorov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gh3's Issues

Added support for commit comments

Hello,

I've been playing with gh3 and, based on what is done (Gists comments), I added support for fetching commit comments. A couple of things to notice:

  1. I had a problem fetching commits for a file when the author's login (of the commit) was null, namely when an user changed his github username. In that case, the commitInfos.author was null but commitInfos.commit.author was good, so I modified that on my commit.

  2. Github API allows specifying the format of the data to receive. In the case of fetching commit comments, I added the option to receive the full content, which means it will receive not just the comment body (raw) but also body_text (plain text) and body_html (markdown rendered in HTML).

Finally, I added an example to samples folder in order to show how to get comments from a file commit. The example is based on the "real world" use of that functionality.
Ex. screenshot:
gh3

If everything is OK I could do a pull-request. Let me know.

paginationInfo not work

I try it like this:

curl -i -X HEAD https://api.github.com/repos/bolasblack/.vim/commits
curl -i -X HEAD -H 'rel: next' https://api.github.com/repos/bolasblack/.vim/commits

The response:

Link: <https://api.github.com/repositories/1634290/commits?top=master&last_sha=15d7fa18805cb814e962ca8d1fdd4f2a057179f6>; rel="next", <https://api.github.com/repositories/1634290/commits?sha=master>; rel="first"
Link: <https://api.github.com/repositories/1634290/commits?top=master&last_sha=15d7fa18805cb814e962ca8d1fdd4f2a057179f6>; rel="next", <https://api.github.com/repositories/1634290/commits?sha=master>; rel="first"

I think rel header not work now.

OAuth support needed

It would be great if this library could support authentication via oauth tokens.

User Profile Picture Option?

I was looking in the readme and did not find anything, is it possible to add this? Or if it's hidden can you show it on the README : +1:

Add "releases" to "Search"

Having the ability to pull release information for a given repository would be extremely helpful, as this is where information such as "download count" is stored.

Awesome library - thank you for all of the hard work!

oauth

do you handle oauth or where do i add the credentials?

Improve async api

Most of the methods are designed to work asynchronously.

  • Please, provide a consistent pattern to handle asynchronous stuff.
    • Would be nice to avoid the need to pass a double callback (one for success, one for error) each time.
    • A single callback is enough, first argument should be an intanceof Error, if falsy (null, undefined, w/e), then assumed to be a success case.
    • Would be nice to always define the callback as the last parameter, no additional arguments after one (or two for some cases in current API) potentially very long callback. Difficult to see the whole list of arguments.
Kind.prototype.fetch = function(bob, foo, ..., callback) {
   // do stuff ...

  Gh3.Helper.callHttpApi({
      service : url,
      success : function(res) {
        callback(null, res);
      },
      error : function (res) {
        callbac(new Error(res));
      }
  });
};

...
var bob = new Kind;
bob.fetch(function('bob', 'and', 'his', 'friends', function(err, response) {
   console.log('fetching bob and is friends');
   if(err) {
      // deal with error
      return;
   }

   // handle response
   console.log(response);
});

Why Base64 code needed?

Is window.atob() and window.btoa() not enough?

Just dont know why its baked directly into the js?

support creating pull requests

I didn't found any API method to create a pull request.
Looking into the code didn't show me anything related.
So I assume, that this is not supported.

So do you plan to support this API method?

Cannot fetch second level and up directory information or files

The issue seems to be that branchname is being set to parent level directory and not the sub dir level

branchName: "master"

       var user = new Gh3.User("hogehoge");
        var repo = "hogehoge" ;


        var userRepo = new Gh3.Repository(repo, user);

        userRepo.fetch(function(err, res){
          userRepo.fetchBranches(function (err, res) {

            var master = userRepo.getBranchByName("master");

            master.fetchContents(function (err, res) {              
              var app = master.getDirByName("app");

              app.fetchContents(function(err, res){
                var views = app.getDirByName("views");  

               // this is needed to be work.
                views.branchName = "master";              

                views.fetchContents(function(err, res){

                  var users = views.getDirByName("users");

                  users.branchName = "master";

                  users.fetchContents(function(err, res){

                   console.log(users);


                  });

                }); // views

              }); //app

            }); //fetch header

          }) //fetch branches

        }); // fetch repo

Tests

I'm sad. No tests for my viewing pleasure :(

Authentication

Hi i cant seem to see any details if i wanted to authenticate to github, i suppose this functionality is not yet implemented

How cound I post content to github repos?

For example, I have a README.md file in my repo, I want to modify it on PC, and then post updated content to the repo........... But I coundn't find the api such as postContents! It's time to implement it!!!
^~^!! THX

team members?

Is it possible to get team members of an organization?

Also, I'm assuming all this works client side?

feature request: smaller dependencies

Being dependent on jQuery and underscore for this library adds a hell of a lot of weight to just being able to talk to the github API - it's going to be worth looking at what you actually use from both, and ideally shimming that if jquery and/or underscore are not available. Compared to the huge size of both, the shim is likely tiny, but immensely valuable in settings where neither is loaded.

Fetching user repositories, getting "Uncaught TypeError: object is not a function"

Hi there,

I'm trying to use gh3 to fetch repositories for a user. I'm able to create a new user object and obtain specific info regarding that user, however, I can't seem to actually get the repositories for that user. This is currently the code I'm using to do that:

var userRepositories = function(userObject) {
    var repos = new Gh3.Repositories(userObject);

    repos.fetch(function() {
        console.log("Repositories", repos);
    }, function(){},{page:1, per_page:500, direction : "desc"});

};

And this is the error I'm getting in Chrome dev tools:

Uncaught TypeError: object is not a function VM567:977        
Gh3.Repositories.Kind.extend.fetch.Gh3.Helper.callHttpApi.success VM567:255 
Gh3.Helper.Kind.extend.callHttpApi.apiParams.successjquery.min.js:3 
b.Callbacks.cjquery.min.js:3 b.Callbacks.p.fireWithjquery.min.js:5 
kjquery.min.js:5 b.ajaxTransport.send.r

Am I making the call right? Or am I doing something else wrong?

works with firefox problem

Just these samples. They run good in chrome ,but meet problem in firefox.

For instance, the samples/02-user.html under a local server will get this result:

login : k33g
0 : {
1 :
2 :
3 :
4 : "
5 : l
6 : o
7 : g
8 : i
9 : n
10 : "
11 : :
12 :
13 : "
14 : k
15 : 3
16 : 3
17 : g
18 : "
19 : ,
20 : 
// and more ,there is no place to contain them..

The words' letters are seperate now.

My Firefox version is: 18.0.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.