diff options
| author | Tulir Asokan <tulir@maunium.net> | 2024-06-19 12:02:39 +0300 |
|---|---|---|
| committer | Tulir Asokan <tulir@maunium.net> | 2024-06-19 12:02:52 +0300 |
| commit | 804014f3b490192e90bf1dc9a60431d2310fc450 (patch) | |
| tree | 3686c9d60dbdc391eeef331c1a0b0ed5128aa0da | |
| parent | 5da539ad8409b8902effb59a04d061516e236761 (diff) | |
Add cats to giphy proxy
| -rw-r--r-- | giphyproxy/main.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/giphyproxy/main.go b/giphyproxy/main.go index 279afcb..8954a46 100644 --- a/giphyproxy/main.go +++ b/giphyproxy/main.go @@ -22,6 +22,7 @@ import ( "fmt" "os" "regexp" + "time" "go.mau.fi/util/exerrors" "gopkg.in/yaml.v3" @@ -53,6 +54,13 @@ func main() { } func getMedia(_ context.Context, id string) (response mediaproxy.GetMediaResponse, err error) { + // This is not related to giphy, but random cats are always fun + if id == "cat" { + return &mediaproxy.GetMediaResponseURL{ + URL: "https://cataas.com/cat", + ExpiresAt: time.Now(), + }, nil + } if !giphyIDRegex.MatchString(id) { return nil, mediaproxy.ErrInvalidMediaIDSyntax } |
