Class: SL::SoftwareSearch

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

Overview

Software Search

Class Method Summary collapse

Class Method Details

.search(_, search_terms, link_text) ⇒ Object



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

def search(_, search_terms, link_text)
  excludes = %w[apple.com postmates.com download.cnet.com softpedia.com softonic.com macupdate.com]
  search_url = %(#{excludes.map { |x| "-site:#{x}" }.join(' ')} #{search_terms} app)

  url, title, link_text = SL.ddg(search_url, link_text)
  link_text = title if link_text == '' && !SL.titleize

  [url, title, link_text]
end

.settingsObject



5
6
7
8
9
10
11
12
# File 'lib/searchlink/searches/software.rb', line 5

def settings
  {
    trigger: 's',
    searches: [
      ['s', 'Software Search']
    ]
  }
end