Feeds 2 Pocket fetches and store RSS items into Pocket for you to read later. Motivation for this project is to have a simple way to read my RSS feeds on my Kobo e-reader.
This project is designed to be run as a cron job in Cloudflare Workers.
Notice that this project doesn't have a user interface. You will need to configure everything is a non-fancy way, unfortunately.
- Fetch RSS feeds
- Store RSS items into Pocket
- Retry mechanism in case of failure to fetch or store an item
- Avoid duplicates
- Allow to specify tags for each feed
You will need to create a D1 Database in Cloudflare to run the migration scripts. You can do this by running the following command:
wrangler d1 create f2p-db
Then you can run the migration script:
wrangler d1 migrations apply --remote F2P_DB
Copy the wrangler.toml.example
to wrangler.toml
and update it with your database ID (you can get it from Cloudflare dashboard).
Add your Pocket access token to the database (you can do it with migration scripts or from Cloudflare dashboard):
--- Check here how to get your Pocket access token: https://getpocket.com/developer/docs/authentication
INSERT INTO users (username, access_token) VALUES ('your_username', 'your_access_token');
Add the feeds you want to fetch:
INSERT INTO feeds (url, tags, user_id) VALUES ('https://lobste.rs/top/rss', 'programming,tech', 1);
Now you can run the worker:
npm run deploy
Notice that by default the worker runs once a day. You can change this by updating the cron expression in the wrangler.toml
file or from Cloudflare dashboard.
Before running the cron, don't forget to define the following environment variable:
POCKET_CONSUMER_KEY
: See Pocket API for how to get your consumer key.
Which can be added directly from Cloudflare dashboard or by running the following command:
wrangler secret put POCKET_CONSUMER_KEY