Skip to content

Commit

Permalink
Added npr provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zquestz committed Mar 11, 2016
1 parent a1d4cc2 commit 1374159
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Custom providers require a few things:
* nhaccuatui
* npm
* npmsearch
* npr
* nvd
* overstock
* packagist
Expand Down
20 changes: 20 additions & 0 deletions providers/npr/npr.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package npr

import (
"fmt"
"net/url"

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

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

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

// BuildURI generates a search URL for NPR.
func (p *Provider) BuildURI(q string) string {
return fmt.Sprintf("http://www.npr.org/templates/search/index.php?searchinput=%s", url.QueryEscape(q))
}
1 change: 1 addition & 0 deletions s.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import (
_ "github.com/zquestz/s/providers/nhaccuatui"
_ "github.com/zquestz/s/providers/npm"
_ "github.com/zquestz/s/providers/npmsearch"
_ "github.com/zquestz/s/providers/npr"
_ "github.com/zquestz/s/providers/nvd"
_ "github.com/zquestz/s/providers/overstock"
_ "github.com/zquestz/s/providers/packagist"
Expand Down

0 comments on commit 1374159

Please sign in to comment.