Method: ScraperWiki::API#scraper_usersearch

Defined in:
lib/scraperwiki-api.rb

#scraper_usersearch(opts = {}) ⇒ Array

Note:

The date joined field is datejoined (without underscore) on #scraper_getuserinfo

Search for a user by name.

Example output:

[
  {
    "username": "johndoe",
    "profilename": "John Doe",
    "date_joined": "1970-01-01T00:00:00"
  },
  ...
]

Parameters:

  • opts (Hash) (defaults to: {})

    optional arguments

Options Hash (opts):

  • :searchquery (String)

    search terms

  • :maxrows (Integer)

    number of results to return [default 5]

  • :nolist (Array, String)

    space-separated list of usernames to exclude from the output

  • :requestinguser (String)

    the name of the user making the search, which changes the order of the matches

Returns:

  • (Array)


327
328
329
330
331
332
# File 'lib/scraperwiki-api.rb', line 327

def scraper_usersearch(opts = {})
  if Array === opts[:nolist]
    opts[:nolist] = opts[:nolist].join ' '
  end
  request '/scraper/usersearch', opts
end