A facade pattern that glues together different Medium APIs to get a Medium user feed.
It contains all the code neccesary to be deployed using Cloudflare Workers.
To get a glance of how easy is to fetch your own Medium Feed, do the following:
- Clone this repository locally
- Install Wrangler via
pnpm install
- Change the
USERNAME
variable inwrangler.toml
to your Medium username - Head to rss2json and sign up for an account
- Copy your rss2json API key
- Run
wrangler secret put API_KEY
then paste your API key when prompted - Run
wrangler login
and create a Cloudflare account if you don't already have one - Create a worker subdomain with
wrangler subdomain desired_name_here
- Run
wrangler dev
to test locally orwrangler publish
to push your code to production - Retrieve your Medium feed!
Each request brings up to 10 posts. However, the next
attribute can be use to retrieve the following 10 entries. Simply call your worker with the query param next
with the value of it.
For an example of how to implement this behavior, look here. Simply put:
Initial request:
https://medium-feed.ajmeese7.workers.dev
Follow up request:
https://medium-feed.ajmeese7.workers.dev?next=1483371523050
Once all posts are fetched, the attribute next
will not longer be present.