# Files for turning an RSS feed into Mastodon toots ## Introduction: The python code takes an RSS feed It takes the latest entry in the feed If that entry is different to the last entry tooted, it crafts a Mastodon toot announcing the new feed content, and updates the Mastodon timeline ## Files: * ### [secrets.py] The Python file that contains the access Token and other needed connection info * ### [last_post.txt] The text file that contains the ID of the last RSS entry * ### [last_toot.txt] The text file that contains the ID of the last RSS entry that was posted ## What are all these different Python files? There are six (6) variants, based on the content to be sent to Mastodon This varies according to the feed provided, i.e. some RSS feeds have more characters than Mastoson allows, some feeds have a URL in them etc These are all similar reworkings of the same Python code, the only difference being the string sent, i.e. whether to include the #hastags etc All of the variants come in two (2) flavours: * **bot_all*** - Will loop through all of the available RSS content, from the bottom up and post that to Mastodon * **bot***- Takes the latest (and only the latest) RSS content and posts that ## The Variants: * ### [bot_all_no_image.py] * ### [bot_no_image.py] Posts the following RSS content ('title', 'description', 'link') along with a comment and the hashtags i.e everything There is no fixed image included * ### [bot_all_no_image_no_desc.py] * ### [bot_no_image_no_desc.py] Posts the following RSS content ('title', 'link') along with a comment and the hashtags i.e everything apart from the 'description' There is no fixed image included * ### [bot_all_no_image_no_desc_hashtags.py] * ### [bot_no_image_no_desc_hashtags.py] Posts the following RSS content ('title', 'link') along with the hashtags i.e everything apart from the 'description' and a comment There is no fixed image included * ### [bot_all_no_image_no_tags.py] * ### [bot_no_image_no_tags.py] Posts the following RSS content ('title', 'description', 'link') Just that; no comment, no hastags There is no fixed image included * ### [bot_all_no_image_no_tags_no_desc.py] * ### [bot_no_image_no_tags_no_desc.py] Posts the following RSS content ('title', 'link') Just that; no 'description', no comment, no hastags There is no fixed image included * ### [bot_all_with_image.py] * ### [bot_with_image.py] Posts the following RSS content ('title', 'description', 'link') along with a comment and hashtags i.e everything. There **is** a fixed image included ## Deploying: I have set this up to monitor multiple RSS feeds Personally I prefer each feed to have it's own Mastodon API key As each feed will (probably) need a different Variant, I put the API details (secrets.py), the chosen Variant, and the two (2) text files in folders |root | |_RSS feed 1 | |_Files and chosen Variant | |_RSS feed 2 | |_Files and chosen Variant The 'root' folder then contains an executable bash script to call the bots in the sub-folders 'cron' then calls this bash script regularly to update all of the bots