Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #3585 from bluesky-social/download_url

Add a handler for /download that directs you to the device-appropriat…

authored by

Jaz and committed by
GitHub
4a771b93 8864e9ae

+17
+17
bskyweb/cmd/bskyweb/server.go
··· 170 170 // home 171 171 e.GET("/", server.WebHome) 172 172 173 + // download 174 + e.GET("/download", server.Download) 175 + 173 176 // generic routes 174 177 e.GET("/hashtag/:tag", server.WebGeneric) 175 178 e.GET("/search", server.WebGeneric) ··· 269 272 "statusCode": code, 270 273 } 271 274 c.Render(code, "error.html", data) 275 + } 276 + 277 + // Handler for redirecting to the download page. 278 + func (srv *Server) Download(c echo.Context) error { 279 + ua := c.Request().UserAgent() 280 + if strings.Contains(ua, "Android") { 281 + return c.Redirect(http.StatusFound, "https://play.google.com/store/apps/details?id=xyz.blueskyweb.app") 282 + } 283 + 284 + if strings.Contains(ua, "iPhone") || strings.Contains(ua, "iPad") || strings.Contains(ua, "iPod") { 285 + return c.Redirect(http.StatusFound, "https://apps.apple.com/tr/app/bluesky-social/id6444370199") 286 + } 287 + 288 + return c.Redirect(http.StatusFound, "/") 272 289 } 273 290 274 291 // handler for endpoint that have no specific server-side handling