Module: SearchApi::ModuleMethods

Included in:
SearchApi
Defined in:
lib/searchapi/module_methods.rb

Instance Method Summary collapse

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, options = nil, &block )
  GoogleFinanceRequest.new.quote( symbol, options, &block )
end

#flights(options = nil, &block) ⇒ Object

Google Flights



40
41
42
# File 'lib/searchapi/module_methods.rb', line 40

def flights( options = nil, &block )
  GoogleFlightsRequest.new.search( options, &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, options = nil, &block )
  GoogleSearchRequest.new.search( query, options, &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, options = nil, &block )
  GoogleLightRequest.new.search( query, options, &block )
end

#images(query, options = nil, &block) ⇒ Object

Google Images



65
66
67
# File 'lib/searchapi/module_methods.rb', line 65

def images( query, options = nil, &block )
  GoogleImagesRequest.new.search( query, options, &block )
end

#instagram(username, options = nil, &block) ⇒ Object

Instagram Profile



25
26
27
# File 'lib/searchapi/module_methods.rb', line 25

def instagram( username, options = nil, &block )
  InstagramProfileRequest.new.profile( username, options, &block )
end

#local(query, options = nil, &block) ⇒ Object

Google Local



70
71
72
# File 'lib/searchapi/module_methods.rb', line 70

def local( query, options = nil, &block )
  GoogleLocalRequest.new.search( query, options, &block )
end

#news(query, options = nil, &block) ⇒ Object

Google News



50
51
52
# File 'lib/searchapi/module_methods.rb', line 50

def news( query, options = nil, &block )
  GoogleNewsRequest.new.search( query, options, &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, options = nil, &block )
  GoogleNewsLightRequest.new.search( query, options, &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, options = nil, &block )
  GoogleNewsPortalRequest.new.search( query, options, &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, options = nil, &block )
  GoogleScholarRequest.new.search( query, options, &block )
end

#tiktok(username, options = nil, &block) ⇒ Object

TikTok Profile



30
31
32
# File 'lib/searchapi/module_methods.rb', line 30

def tiktok( username, options = nil, &block )
  TikTokProfileRequest.new.profile( username, options, &block )
end

#youtube(query, options = nil, &block) ⇒ Object

YouTube Search



20
21
22
# File 'lib/searchapi/module_methods.rb', line 20

def youtube( query, options = nil, &block )
  YouTubeSearchRequest.new.search( query, options, &block )
end