Class: SL::SetappSearch

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

Overview

is.gd link shortening

Class Method Summary collapse

Class Method Details

.search(search_type, search_terms, link_text) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/searchlink/searches/setapp.rb', line 51

def search(search_type, search_terms, link_text)
  link = build_link(search_terms)
  link, rtitle, link_text = process_link(link, search_terms, link_text)
  return [false, rtitle, link_text] unless valid_setapp_url?(link)

  process_search_type(search_type, link, rtitle, link_text)
end

.settingsObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/searchlink/searches/setapp.rb', line 32

def settings
  {
    trigger: "set[ib]?",
    searches: [
      ["set", "Setapp Link with optional affiliate string"],
      ["seti", "Shorten Setapp Affiliate Link with is.gd"],
      ["setb", "Shorten Setapp Affiliate Link with bit.ly"]
    ],
    config: [
      {
        description: "Setapp affiliate string (optional).\nYou can find your affiliate string here: https://www.impact.com/affiliate/links",
        key: "setapp_affiliate_string",
        value: "''",
        required: false
      }
    ]
  }
end