Created
March 24, 2009 22:37
-
-
Save vanpelt/84406 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'httparty' | |
| class CrowdFlower | |
| include HTTParty | |
| base_uri "https://crowdflower.com/jobs/" | |
| def initialize(key = nil) | |
| key ||= YOUR_KEY | |
| self.class.default_params(:key => key) | |
| end | |
| def get(id, page = 1, limit = 10) | |
| self.class.get("/#{id}.json", {:query => {:limit => limit, :page => page}}) | |
| end | |
| end | |
| (ARGV[0].to_i || 1).upto(ARGV[0].to_i + 100) do |page| | |
| puts "\n#{page}" | |
| CrowdFlower.new.get(369, page).each do |unit_id, data| | |
| #Do something awesome here... | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment