Module: SearchApi::ModuleMethods
- Included in:
- SearchApi
- Defined in:
- lib/searchapi/module_methods.rb
Instance Method Summary collapse
- #api_key(api_key = nil) ⇒ Object
- #connection(connection = nil) ⇒ Object
-
#finance(symbol, options = nil, &block) ⇒ Object
Google Finance.
-
#flights(options = nil, &block) ⇒ Object
Google Flights.
-
#google(query = nil, options = nil, &block) ⇒ Object
Google Search.
-
#google_light(query, options = nil, &block) ⇒ Object
Google Light (fast, lightweight search).
-
#images(query, options = nil, &block) ⇒ Object
Google Images.
-
#instagram(username, options = nil, &block) ⇒ Object
Instagram Profile.
-
#local(query, options = nil, &block) ⇒ Object
Google Local.
-
#news(query, options = nil, &block) ⇒ Object
Google News.
-
#news_light(query, options = nil, &block) ⇒ Object
Google News Light.
-
#news_portal(query = nil, options = nil, &block) ⇒ Object
Google News Portal.
-
#scholar(query = nil, options = nil, &block) ⇒ Object
Google Scholar.
-
#tiktok(username, options = nil, &block) ⇒ Object
TikTok Profile.
-
#youtube(query, options = nil, &block) ⇒ Object
YouTube Search.
Instance Method Details
#api_key(api_key = nil) ⇒ Object
9 10 11 12 |
# File 'lib/searchapi/module_methods.rb', line 9 def api_key( api_key = nil ) @api_key = api_key || @api_key @api_key end |
#connection(connection = nil) ⇒ Object
4 5 6 7 |
# File 'lib/searchapi/module_methods.rb', line 4 def connection( connection = nil ) @connection = connection if connection @connection ||= Faraday.new { | builder | builder.adapter Faraday.default_adapter } end |
#finance(symbol, options = nil, &block) ⇒ Object
Google Finance
35 36 37 |
# File 'lib/searchapi/module_methods.rb', line 35 def finance( symbol, = nil, &block ) GoogleFinanceRequest.new.quote( symbol, , &block ) end |
#flights(options = nil, &block) ⇒ Object
Google Flights
40 41 42 |
# File 'lib/searchapi/module_methods.rb', line 40 def flights( = nil, &block ) GoogleFlightsRequest.new.search( , &block ) end |
#google(query = nil, options = nil, &block) ⇒ Object
Google Search
15 16 17 |
# File 'lib/searchapi/module_methods.rb', line 15 def google( query = nil, = nil, &block ) GoogleSearchRequest.new.search( query, , &block ) end |
#google_light(query, options = nil, &block) ⇒ Object
Google Light (fast, lightweight search)
45 46 47 |
# File 'lib/searchapi/module_methods.rb', line 45 def google_light( query, = nil, &block ) GoogleLightRequest.new.search( query, , &block ) end |
#images(query, options = nil, &block) ⇒ Object
Google Images
65 66 67 |
# File 'lib/searchapi/module_methods.rb', line 65 def images( query, = nil, &block ) GoogleImagesRequest.new.search( query, , &block ) end |
#instagram(username, options = nil, &block) ⇒ Object
Instagram Profile
25 26 27 |
# File 'lib/searchapi/module_methods.rb', line 25 def instagram( username, = nil, &block ) InstagramProfileRequest.new.profile( username, , &block ) end |
#local(query, options = nil, &block) ⇒ Object
Google Local
70 71 72 |
# File 'lib/searchapi/module_methods.rb', line 70 def local( query, = nil, &block ) GoogleLocalRequest.new.search( query, , &block ) end |
#news(query, options = nil, &block) ⇒ Object
Google News
50 51 52 |
# File 'lib/searchapi/module_methods.rb', line 50 def news( query, = nil, &block ) GoogleNewsRequest.new.search( query, , &block ) end |
#news_light(query, options = nil, &block) ⇒ Object
Google News Light
60 61 62 |
# File 'lib/searchapi/module_methods.rb', line 60 def news_light( query, = nil, &block ) GoogleNewsLightRequest.new.search( query, , &block ) end |
#news_portal(query = nil, options = nil, &block) ⇒ Object
Google News Portal
55 56 57 |
# File 'lib/searchapi/module_methods.rb', line 55 def news_portal( query = nil, = nil, &block ) GoogleNewsPortalRequest.new.search( query, , &block ) end |
#scholar(query = nil, options = nil, &block) ⇒ Object
Google Scholar
75 76 77 |
# File 'lib/searchapi/module_methods.rb', line 75 def scholar( query = nil, = nil, &block ) GoogleScholarRequest.new.search( query, , &block ) end |
#tiktok(username, options = nil, &block) ⇒ Object
TikTok Profile
30 31 32 |
# File 'lib/searchapi/module_methods.rb', line 30 def tiktok( username, = nil, &block ) TikTokProfileRequest.new.profile( username, , &block ) end |
#youtube(query, options = nil, &block) ⇒ Object
YouTube Search
20 21 22 |
# File 'lib/searchapi/module_methods.rb', line 20 def youtube( query, = nil, &block ) YouTubeSearchRequest.new.search( query, , &block ) end |