The python script in this repository generates a Atom feed with
- Top posts from Reddit
- Top posts from HackerNews
- Posts from other RSS/Atom feeds
Reasons for writing this script:
- Want to use Feedly as a single point for browsing through 'interesting' posts
- Do not want to look at posts in Reddit/HackerNews which have zero comments
- Do not want to look at posts which I have already seen (This happens with Google News feeds. If a particular topic does not have new news stories frequently, I keep seeing the same new stories again and again).
Directly adding Sub-Reddits, HackerNews or Google News in Feedly, does not solve the issue of not wanting to see the zero comments posts, or repeated posts. Hence wrote a simple script to achieve my goals.
Instructions:
- Install the following python modules:
- praw
- feedgen
- hackernews-python
- numpy
- pandas
- tzlocal
- Edit the config file (Description of the config file below)
- Run the script by invoking the command
python3 generate_feed.py config.json
- Run the script periodically, by adding to cron
Config file description:
subreddits
: Specify the list of subreddits from which to gather the posts. Each element here is a key-value pair, with the key being the subreddit name, and the value being the time filter that needs to be used (all, day, hour, month, week, year).reddit_credentials
: Specify the reddit access credentials. Look here to know how to acquire access codes.reddit_min_comments
: Only add posts with the number of comments greater than this value.reddit_num_posts
: Number of posts to gather from each subredditfeed_sources
: Specify RSS feed urls from which to gather posts fromadd_hn_entries
: true if posts from HackerNews need to be acquiredhn_num_posts
: Only add posts with the number of comments greater than this valuemax_items_feed
: Maximum number of items in the generated feedcache_path
: Location where the cached data can be storedfeed_url
: URL to the location where the generated feed will be publishedsave_path
: Location where the generated feed file needs to be saved