lib/scraperwiki-api.rb in scraperwiki-api-0.0.5 vs lib/scraperwiki-api.rb in scraperwiki-api-0.0.6

- old
+ new

@@ -5,13 +5,10 @@ # @see https://scraperwiki.com/docs/api class API include HTTParty base_uri 'api.scraperwiki.com/api/1.0' - class Error < StandardError; end - class ScraperNotFound < Error; end - RUN_INTERVALS = { never: -1, monthly: 2678400, weekly: 604800, daily: 86400, @@ -77,12 +74,12 @@ # @param [String] shortname the scraper's shortname (as it appears in the URL) # @param [String] query a SQL query # @param [Hash] opts optional arguments # @option opts [String] :format one of "jsondict", "jsonlist", "csv", # "htmltable" or "rss2" - # @option opts [String] :attach ";"-delimited list of shortnames of other - # scrapers whose data you need to access + # @option opts [Array,String] :attach ";"-delimited list of shortnames of + # other scrapers whose data you need to access # @return [Array,Hash,String] # @see https://scraperwiki.com/docs/ruby/ruby_help_documentation/ # # @note The query string parameter is +name+, not +shortname+ # {https://scraperwiki.com/docs/api#sqlite as in the ScraperWiki docs} @@ -187,16 +184,17 @@ # @param [String] shortname the scraper's shortname (as it appears in the URL) # @param [Hash] opts optional arguments # @option opts [String] :version version number (-1 for most recent) [default -1] # @option opts [String] :history_start_date history and runevents are # restricted to this date or after, enter as YYYY-MM-DD - # @option opts [String] :quietfields "|"-delimited list of fields to exclude - # from the output. Must be a subset of 'code|runevents|datasummary|userroles|history' + # @option opts [Array,String] :quietfields "|"-delimited list of fields to + # exclude from the output. Must be a subset of 'code|runevents|datasummary|userroles|history' # @return [Array] # # @note Returns an array although the array seems to always have only one item # @note The +tags+ field seems to always be an empty array + # @note Fields like +last_run+ seem to follow British Summer Time. # @note The query string parameter is +name+, not +shortname+ # {https://scraperwiki.com/docs/api#getinfo as in the ScraperWiki docs} def scraper_getinfo(shortname, opts = {}) if Array === opts[:quietfields] opts[:quietfields] = opts[:quietfields].join '|' @@ -316,11 +314,11 @@ # ] # # @param [Hash] opts optional arguments # @option opts [String] :searchquery search terms # @option opts [Integer] :maxrows number of results to return [default 5] - # @option opts [String] :nolist space-separated list of usernames to exclude - # from the output + # @option opts [Array,String] :nolist space-separated list of usernames to + # exclude from the output # @option opts [String] :requestinguser the name of the user making the # search, which changes the order of the matches # @return [Array] # # @note The date joined field is +datejoined+ (without underscore) on