I'm trying to fetch some users data for a small research on github by using this api: https://developer.github.com/v3/users/#get-a-single-user
When I'm trying to fetch user data via crul I'm getting the data just by runing this command (without no authentication):
curl https://api.github.com/users/<ANY_USER>
But when I'm tying to use node-github :
var GitHubApi = require("github");
var github = new GitHubApi({...});
github.user.get({
user: username
}, function(err, res){...});
I have authentication problems.
I try to do authentication first :
var GitHubApi = require("github");
var github = new GitHubApi({...});
github.authenticate({
type: "basic",
username: "MY_USERNAME",
password: "MY_PASSWORD"
});
github.user.get({
user: username
}, function(err, res){...});
but then I'm getting my user data and not the data for the user I want.
Any idea what is missing here? Why crul is working and github.user.get not? Any better way to do it via nodejs?
Thanks!