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



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

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



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

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