Authorize app on GitHub - NodeJS

0

Good afternoon, I'm trying to authorize my APP in NodeJS to make more than 60 requests to the GitHub API, I managed to do it through the OAuth authorization, which when doing a login sending the client_id the callback returns an acces_token, the thing is. So would the url of the app be authorized to make more requests? Or do we have to do something with the acces_token?

    var apiRequest = api('/repos/' + self.settings.org + '/' + self.repo + '/contents/package.json', {
        token: self.settings.gitToken
    });

    apiRequest.on('data', function(response) {
        self.reposParsed = JSON.stringify(allRepos);
        var packageJSON = new PackageJSON(self.settings, self.reposParsed);
        packageJSON.parseFromString(response.content, function(){

This is what I do basically to get the package.json of the repo that I select. The issue is that this package loads many things and github blocks access to the API because unauthorized APPS only allow 60 request per hour, what I would like to know is how to authenticate my APP in NodeJS with the acces_token generated by github using OAuth.

    
asked by Santiago D'Antuoni 13.12.2016 в 21:39
source

1 answer

1

You have to register the app in github to give you the access token and be able to use the API without so many restrictions (you would go from 60 request to 5000).

Next, I explain the steps you have to take:

answered by 06.03.2017 в 08:36
Help with inserting slide in cakephp view ___ ___ erkimt help printing binary values of a Huffman algorithm ______ qstntxt ___

I'm making a Huffman tree and I want to show the result of the message on the screen. Something like:

%pre%

But I have problems saving the numbers to print them in order of the message.

%pre%

The problem is that when I save the numbers I can only do it with vector < int & Number and that generates the outputs:

%pre%

When I want to save it in a string or char, so that:

%pre%

    
______ azszpr39118 ___

The problem, as you say, is that you are working with sequences instead of numbers. The digits to the left are significant and that a whole type does not support it. Hence, you can not group each sequence into a single index of the vector %code% .

One solution is to replace %code% so that it happens to store elementso of type %code% :

%pre%

Now, for each letter, we convert the Boolean sequence into a string:

%pre%     
___