-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several German television and shopping providers were added. Language…
… support was added to the Wikipedia and the google provider. (#159) * Added the second german television station (ZDF) to the available providers. * Added the first german television station (ARD) to the available providers. * Added google maps to the available providers. * Added idealo (german shopping comparison portal) to the available providers. * The Wikipedia provider was extended to support different regions. * The Google provider was extended to support different regions. * Renamed ard to ardmediathek and added it to the README. * Renamed ard to ardmediathek and added it to the README. Using tv as tag, it is shorter then television. * Tags of german sites are only provided to german users. * Idealo and ZDF are now mentioned in the README. * I missed something during renaming from ard to ardmediathek. * Forgot to close some brackets.
- Loading branch information
Showing
8 changed files
with
164 additions
and
2 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 ardmediathek | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/zquestz/s/providers" | ||
) | ||
|
||
func init() { | ||
providers.AddProvider("ardmediathek", &Provider{}) | ||
} | ||
|
||
// Provider merely implements the Provider interface. | ||
type Provider struct{} | ||
|
||
// BuildURI generates a search URL for ARD MEDIATHEK. | ||
func (p *Provider) BuildURI(q string) string { | ||
return fmt.Sprintf("https://www.ardmediathek.de/suche/%s/", url.QueryEscape(q)) | ||
} | ||
|
||
// Tags returns the tags relevant to this provider. | ||
func (p *Provider) Tags() []string { | ||
switch providers.Language() { | ||
case "de": | ||
return []string{"tv"} | ||
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
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 googlemaps | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/zquestz/s/providers" | ||
) | ||
|
||
func init() { | ||
providers.AddProvider("googlemaps", &Provider{}) | ||
} | ||
|
||
// Provider merely implements the Provider interface. | ||
type Provider struct{} | ||
|
||
// BuildURI generates a search URL for Google Maps. | ||
func (p *Provider) BuildURI(q string) string { | ||
return fmt.Sprintf("https://www.google.com/maps/search/?api=1&query=%s", url.QueryEscape(q)) | ||
} | ||
|
||
// Tags returns the tags relevant to this provider. | ||
func (p *Provider) Tags() []string { | ||
return []string{"search"} | ||
} |
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 idealo | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/zquestz/s/providers" | ||
) | ||
|
||
func init() { | ||
providers.AddProvider("idealo", &Provider{}) | ||
} | ||
|
||
// Provider merely implements the Provider interface. | ||
type Provider struct{} | ||
|
||
// BuildURI generates a search URL for IDEALO. | ||
func (p *Provider) BuildURI(q string) string { | ||
return fmt.Sprintf("https://www.idealo.de/preisvergleich/MainSearchProductCategory.html?q=%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
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 zdf | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/zquestz/s/providers" | ||
) | ||
|
||
func init() { | ||
providers.AddProvider("zdf", &Provider{}) | ||
} | ||
|
||
// Provider merely implements the Provider interface. | ||
type Provider struct{} | ||
|
||
// BuildURI generates a search URL for ZDF. | ||
func (p *Provider) BuildURI(q string) string { | ||
return fmt.Sprintf("https://www.zdf.de/suche?q=%s&synth=true&sender=Gesamtes+Angebot", url.QueryEscape(q)) | ||
} | ||
|
||
// Tags returns the tags relevant to this provider. | ||
func (p *Provider) Tags() []string { | ||
switch providers.Language() { | ||
case "de": | ||
return []string{"tv"} | ||
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