Skip to content

Commit

Permalink
Added kaufda (german shopping comparison portal) to the available pro… (
Browse files Browse the repository at this point in the history
#162)

* Added kaufda (german shopping comparison portal) to the available providers.

* Added a provider openbsdman to quickly search the online OpenBSD manual pages.
  • Loading branch information
xoro authored Dec 28, 2021
1 parent 7b6a3aa commit 98ce802
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ Custom providers require a few things:
* imgur
* inbox
* instagram
* kaufda
* kickasstorrents
* libgen
* linkedin
Expand All @@ -296,6 +297,7 @@ Custom providers require a few things:
* npmsearch
* npr
* nvd
* openbsdman
* overstock
* packagist
* phandroid
Expand Down
30 changes: 30 additions & 0 deletions providers/kaufda/kaufda.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package kaufda

import (
"fmt"
"net/url"

"github.com/zquestz/s/providers"
)

func init() {
providers.AddProvider("kaufda", &Provider{})
}

// Provider merely implements the Provider interface.
type Provider struct{}

// BuildURI generates a search URL for kaufda.de.
func (p *Provider) BuildURI(q string) string {
return fmt.Sprintf("https://www.kaufda.de/webapp/?query=%s", url.QueryEscape(q))
}

// Tags returns the tags relevant to this provider.
func (p *Provider) Tags() []string {
switch providers.Language() {
case "de":
return []string{"shopping"}
default:
return []string{}
}
}
25 changes: 25 additions & 0 deletions providers/openbsdman/openbsdman.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package openbsdman

import (
"fmt"
"net/url"

"github.com/zquestz/s/providers"
)

func init() {
providers.AddProvider("openbsdman", &Provider{})
}

// Provider merely implements the Provider interface.
type Provider struct{}

// BuildURI generates a search URL for the OpenBSD online man pages dictionary.
func (p *Provider) BuildURI(q string) string {
return fmt.Sprintf("https://man.openbsd.org/%s", url.QueryEscape(q))
}

// Tags returns the tags relevant to this provider.
func (p *Provider) Tags() []string {
return []string{}
}
2 changes: 2 additions & 0 deletions s.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import (
_ "github.com/zquestz/s/providers/imgur"
_ "github.com/zquestz/s/providers/inbox"
_ "github.com/zquestz/s/providers/instagram"
_ "github.com/zquestz/s/providers/kaufda"
_ "github.com/zquestz/s/providers/kickasstorrents"
_ "github.com/zquestz/s/providers/libgen"
_ "github.com/zquestz/s/providers/linkedin"
Expand All @@ -83,6 +84,7 @@ import (
_ "github.com/zquestz/s/providers/npmsearch"
_ "github.com/zquestz/s/providers/npr"
_ "github.com/zquestz/s/providers/nvd"
_ "github.com/zquestz/s/providers/openbsdman"
_ "github.com/zquestz/s/providers/overstock"
_ "github.com/zquestz/s/providers/packagist"
_ "github.com/zquestz/s/providers/phandroid"
Expand Down

0 comments on commit 98ce802

Please sign in to comment.