-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added kaufda (german shopping comparison portal) to the available pro… (
#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
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters