Class: SL::AmazonSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/searchlink/searches/amazon.rb

Overview

Amazon Search

Class Method Summary collapse

Class Method Details

.search(_, search_terms, link_text) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/searchlink/searches/amazon.rb', line 16

def search(_, search_terms, link_text)
  az_url, = SL.ddg("site:amazon.com #{search_terms}", link_text)
  url, title = SL::URL.amazon_affiliatize(az_url, SL.config['amazon_partner'])
  title ||= search_terms

  [url, title, link_text]
end

.settingsObject



7
8
9
10
11
12
13
14
# File 'lib/searchlink/searches/amazon.rb', line 7

def settings
  {
    trigger: 'a',
    searches: [
      ['a', 'Amazon Search']
    ]
  }
end