Retrieve list of Github users by location, Singapore in this case
ruby main.rb
, optionally add access token to speed up things by running ruby main.rb YOUR_TOKEN
Result will be dumped as json into current folder as a file named users.json
Go to https://github.com/search?utf8=%E2%9C%93&q=location%3Asingapore
for current user count
2017 May 8: 9975 users in Singapore
- Only allow paging through first 1000 results per search
- Has rate limiting
- Divide and Conquer: split searchs into smaller chunks, so that each search has less than 1000 results per search, but try dividing as few times as possible
- Wait until rate limit is reset
- Use recursion to simplify logics and re-use codes
- Do simple binary split
- Assume Github API is always working
- Assume good network condition from begining to end
- Can't resume progress yet
- Add persistence
- Add state management