npm1k / npm1k.github.io

https://npm1k.org
Apache License 2.0
22 stars 4 forks source link

Search pull requests and fix parse bug #4

Closed beaugunderson closed 9 years ago

beaugunderson commented 9 years ago

I actually managed to implement both pieces of #2. :sparkles:

I tried to keep a similar code style but did find it necessary to break things out into functions to understand what was going on. I also opted for (slightly) more vertical whitespace in the code I added but let me know if you want that removed. :)

You can see how it looks here. Note that the pull request links are wrong in that version (they're API links there) but if you regenerate (after putting a token in your environment in GITHUB_TOKEN) you'll see the correct URLs. I'll also regenerate it as soon as my rate limit resets (it takes ~3,500 calls and you get 5,000 an hour).

kemitchell commented 9 years ago

:+1: Reviewing now.

beaugunderson commented 9 years ago

Just fixed a bug in github-package-json (fixed in 2.2.0) so make sure you test with that if you test locally (searching in the default branch didn't work but searching among pull requests did, and there are actually a few where it's fixed but not deployed yet, like microsoft/typescript).

beaugunderson commented 9 years ago

Wow there are actually a ton that are fixed but not published; I updated my local copy:

http://beaugunderson.com/npm1k.html

(ran into rate limit around #650 though)

kemitchell commented 9 years ago

Wow there are actually a ton that are fixed but not published

g1432189070313118260

:wink:

beaugunderson commented 9 years ago

(noting that I started that run with about ~1400 requests left in my rate limit, so fixing the validity check for master package.json actually significantly lowered the amount of total GitHub requests made, because if it's fixed in master pull requests are not searched)