Skip to content

Commit

Permalink
Add Qwant provider
Browse files Browse the repository at this point in the history
  • Loading branch information
shevabam committed Oct 12, 2018
1 parent 09fae1e commit 56e4962
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -287,6 +287,7 @@ Custom providers require a few things:
* postgresql
* python
* quora
* qwant
* reddit
* regex
* rottentomatoes
Expand Down
25 changes: 25 additions & 0 deletions providers/qwant/qwant.go
@@ -0,0 +1,25 @@
package qwant

import (
"fmt"
"net/url"

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

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

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

// BuildURI generates a search URL for Qwant.
func (p *Provider) BuildURI(q string) string {
return fmt.Sprintf("https://qwant.com/?q=%s", url.QueryEscape(q))
}

// Tags returns the tags relevant to this provider.
func (p *Provider) Tags() []string {
return []string{"search"}
}
1 change: 1 addition & 0 deletions s.go
Expand Up @@ -83,6 +83,7 @@ import (
_ "github.com/zquestz/s/providers/postgresql"
_ "github.com/zquestz/s/providers/python"
_ "github.com/zquestz/s/providers/quora"
_ "github.com/zquestz/s/providers/qwant"
_ "github.com/zquestz/s/providers/reddit"
_ "github.com/zquestz/s/providers/regex"
_ "github.com/zquestz/s/providers/rottentomatoes"
Expand Down

0 comments on commit 56e4962

Please sign in to comment.