From fe47042bdf20f13845d8dc16f87c8a7f7b80843b Mon Sep 17 00:00:00 2001 From: quest Date: Fri, 11 Mar 2022 19:09:55 -1000 Subject: [PATCH] Add Gibiru and bump version to 0.6.5 --- README.md | 5 +++-- cmd/search.go | 2 +- providers/gibiru/gibiru.go | 25 +++++++++++++++++++++++++ s.go | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 providers/gibiru/gibiru.go diff --git a/README.md b/README.md index 5c6cb4f..ed5e2c6 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,7 @@ Custom providers require a few things: * foursquare * freebsdman * freshports +* gibiru * giphy * gist * github @@ -362,7 +363,7 @@ s is released under the MIT license. [ReportCard-Image]: https://goreportcard.com/badge/github.com/zquestz/s [Build-Status-URL]: http://travis-ci.com/zquestz/s [Build-Status-Image]: https://travis-ci.com/zquestz/s.svg?branch=master -[Release-URL]: https://github.com/zquestz/s/releases/tag/v0.6.4 -[Release-Image]: http://img.shields.io/badge/release-v0.6.4-1eb0fc.svg +[Release-URL]: https://github.com/zquestz/s/releases/tag/v0.6.5 +[Release-Image]: http://img.shields.io/badge/release-v0.6.5-1eb0fc.svg [Chat-Image]: https://badges.gitter.im/zquestz/s.svg [Chat-URL]: https://gitter.im/zquestz/s?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge diff --git a/cmd/search.go b/cmd/search.go index a1101ba..f8874f1 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -15,7 +15,7 @@ import ( const ( appName = "s" - version = "0.6.4" + version = "0.6.5" defaultPort = 8080 defaultProvider = "presearch" ) diff --git a/providers/gibiru/gibiru.go b/providers/gibiru/gibiru.go new file mode 100644 index 0000000..18b2e57 --- /dev/null +++ b/providers/gibiru/gibiru.go @@ -0,0 +1,25 @@ +package gibiru + +import ( + "fmt" + "net/url" + + "github.com/zquestz/s/providers" +) + +func init() { + providers.AddProvider("gibiru", &Provider{}) +} + +// Provider merely implements the Provider interface. +type Provider struct{} + +// BuildURI generates a search URL for Gibiru. +func (p *Provider) BuildURI(q string) string { + return fmt.Sprintf("https://gibiru.com/results.html?q=%s", url.QueryEscape(q)) +} + +// Tags returns the tags relevant to this provider. +func (p *Provider) Tags() []string { + return []string{"search"} +} diff --git a/s.go b/s.go index 22dedc5..827f9fe 100644 --- a/s.go +++ b/s.go @@ -48,6 +48,7 @@ import ( _ "github.com/zquestz/s/providers/foursquare" _ "github.com/zquestz/s/providers/freebsdman" _ "github.com/zquestz/s/providers/freshports" + _ "github.com/zquestz/s/providers/gibiru" _ "github.com/zquestz/s/providers/giphy" _ "github.com/zquestz/s/providers/gist" _ "github.com/zquestz/s/providers/github"