aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2024-06-19 12:02:39 +0300
committerTulir Asokan <tulir@maunium.net>2024-06-19 12:02:52 +0300
commit804014f3b490192e90bf1dc9a60431d2310fc450 (patch)
tree3686c9d60dbdc391eeef331c1a0b0ed5128aa0da
parent5da539ad8409b8902effb59a04d061516e236761 (diff)
Add cats to giphy proxy
-rw-r--r--giphyproxy/main.go8
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
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage