Skip to content

prettyflowerss/shower-thoughts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shower-thoughts

A simple Cloudflare Worker that returns random shower thought data from r/showerthoughts.

How it works

A fetch request is made once the API is called. The response is parsed and data is returned. The worker uses Cloudflare KV to temporally store the shower thoughts once their generated. Thoughts already stored in the KV are not generated again, and are ignored.

Usage

The API is available at https://shower-thoughts.paintbrush.workers.dev/.

curl https://shower-thoughts.paintbrush.workers.dev/
{
  "data": {
      "title": "The word \"shower\" is a verb and a noun.",
      "url": "<url>",
      "author": "<author>",
      "subreddit": "Showerthoughts"
  }
}

Caveats

  • The API may get rate limited by Reddit (unlikely, but possible).
  • The API may get congested and not return data. This is due to how we "cache" posts, as there's unfortunately not unlimited posts in the subreddit.

Releases

No releases published

Packages

No packages published