Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile Parser Failing on Org Images #91

Closed
1 task
nelsonic opened this issue Apr 3, 2019 · 1 comment
Closed
1 task

Profile Parser Failing on Org Images #91

nelsonic opened this issue Apr 3, 2019 · 1 comment
Assignees
Labels

Comments

@nelsonic
Copy link
Owner

nelsonic commented Apr 3, 2019

running a basic example:

const gs = require('github-scraper');
gs('torvalds', function(err, data) {
  console.log(err, data);
});

I get the following error:
image

  - - - GitHub Scraper >> /torvalds >> profile  - - -
/Users/n/code/learn-postgresql/node_modules/github-scraper/lib/profile.js:66
    var img = orgs[i].children[0].attribs.src; // org org-avatar-image
                                          ^

TypeError: Cannot read property 'src' of undefined

Clearly the markup has changed for displaying organisations images ...

Todo

  • Fix it!
@nelsonic
Copy link
Owner Author

For no good reason GitHub have changed the format of the URL GET parameter for Followers pages
from: https://github.com/iteles/followers?page=2
to: https://github.com/iteles/followers?after=Y3Vyc29yOnYyOpK0MjAxOC0wNC0wNlQyMDozNjozM1rOAgH3zQ%3D%3D
Obviously that breaks my tests (and code) for following these links ...

It was working fine and they made it worse. 😞

So we need to update our assertions to next_page.indexOf('iteles/followers?after=') > -1 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant