lib/snoo/listings.rb
def search query, opts = {}
      # This supports searches with and without a subreddit
      url = "%s/search.json" % ('/r/' + opts[:subreddit] if opts[:subreddit])

      # Construct the query
      httpquery = {q: query}
      opts.delete :subreddit
      httpquery.merge! opts

      get(url, query: httpquery)
    end
def search query, opts = {}
      # This supports searches with and without a subreddit
      url = "%s/search.json" % ('/r/' + opts[:subreddit] if opts[:subreddit])

      # Construct the query
      httpquery = {q: query}
      opts.delete :subreddit
      httpquery.merge! opts

      get(url, query: httpquery)
    end
Search reddit

 @param query [String] The search query.
 @param (see LinksComments#info)
 @option opts [true, false] :restrict_sr Restrict to the calling subreddit
 @option opts [String] :subreddit The calling subreddit.
 @option opts [1..100] :limit The amount of results to return
 @option opts [String] :before Return things *before* this id
 @option opts [String] :after Return things *after* this id
 @option opts [relevance, new, top] :sort The sorting of the results.
 @option opts [cloudsearch, lucene] :syntax The search syntax.
 @return (see #clear_sessions)