diff --git a/widgets/twitch-drops/README.md b/widgets/twitch-drops/README.md new file mode 100644 index 00000000..fe60bdde --- /dev/null +++ b/widgets/twitch-drops/README.md @@ -0,0 +1,45 @@ +# Twitch Drops + +Show active Twitch Drops campaigns with game art and end dates. + +![](preview.png) + +```yaml +- type: custom-api + title: Twitch Drops + cache: 6h + url: https://twitch-drops-api.sunkwi.com/drops + headers: + Accept: application/json + User-Agent: Mozilla/5.0 + template: | + {{ if eq (len (.JSON.Array "")) 0 }} +

No active Twitch drops found.

+ {{ else }} +
+ {{ range .JSON.Array "" }} + {{ $image := .String "gameBoxArtURL" }} + {{ $dropID := .String "rewards.0.id" }} + {{ if eq $dropID "" }} + {{ $dropID = .String "gameId" }} + {{ end }} +
+ + {{ .String + +
+ {{ .String "gameDisplayName" }} +

Ends {{ slice (.String "endAt") 0 10 }}

+
+
+ {{ end }} +
+ {{ end }} +``` + +## Notes + +Credit to [SunkwiBOT](https://github.com/SunkwiBOT/twitch-drops-api) for the API. Changes to API requests can follow the structure in that github repo. + +This widget uses a public Twitch Drops API endpoint and does not require any extra environment variables. diff --git a/widgets/twitch-drops/meta.yml b/widgets/twitch-drops/meta.yml new file mode 100644 index 00000000..c5aecadb --- /dev/null +++ b/widgets/twitch-drops/meta.yml @@ -0,0 +1,3 @@ +title: Twitch Drops +description: Show active Twitch Drops campaigns with game art and end dates +author: jonathand-cf diff --git a/widgets/twitch-drops/preview.png b/widgets/twitch-drops/preview.png new file mode 100644 index 00000000..f74b5e5e Binary files /dev/null and b/widgets/twitch-drops/preview.png differ