name mode size 100644 11.36kB 100644 5.41kB 100644 5.09kB
cwlist.txt 100644 937B 100755 8.42kB 100644 7.72kB
python_needs.txt 100644 305B
rss_social.ini 100644 622B
rss_social.rc 100644 147B
rss_social_feeds.rc 100644 147B 100755 2.84kB 100755 2.27kB 100755 6.04kB
tweet.patch 100644 3.42kB 100755 3.89kB 100755 576B
rss-to-toot ================================== To take a list of RSS feeds and to send them to Mastodon, Twitter, Facebook, and Google Pluse with images, content warnings, and sensitive image links when those are available. Intended for *single user* use, as personal logins, cookies, and API keys are required. Currently works well with feeds from []( and [shaarli]( instances. Will probably work fine with other well-formed RSS/Atom feeds. *Probably.* * TODO - to make twitter thing not have API keys in open * TODO - work with less standardized RSS, duh. * TODO - Have the tags from shaarli be used for content warning text * TODO - Actually get the FB and G+ posting working automatically * TODO - test the sending # Requirements * [xml2]( * [toot]( * [twython]( * [twython-tools]( - **IMPORTANT- SEE BELOW** * [pexpect]( AND (these are probably already installed or easily available from your package manager/distro) * [uuidgen]( * [wget]( * [awk]( * [grep]( * [elinks]( # Installation Install `xml2` from your package manager, `toot` and `twython` via pip3. Use of a virtual enviroment is encouraged for `toot`, at least, but is not required. ## Twython-tools (sort of) In this archive are two files - `` and `tweet.patch` - that require a little explanation. I did not need the full functionality of twython-tools, and in fact, had a bit of a problem getting the gpg encoding of my app keys to work. Further, the functionality I *did* want, that is posting an image to Twitter, was always *interactive* when I wanted to enter the file on the command line. So I (thank you Apache2 license) ripped out the authentication portions and hardcoded them, ripped out all the interactive bits, and remade the Twython-tools program `` into ``. 1.) First of all you have to copy the checkmailrc to ~/.checkmailrc and edit it. DonĀ“t forget to change its permissions to 600. If you wish to see the difference, `tweet.patch` is included for you to verify my changes to the code. You must register a [Twitter application]( and get **user** API codes and type them manually into ``. Usage is ` --message "Thing to tweet" --file /path/to/file/to/tweet`. * Posting to Facebook, Google Plus, etc ## IMPORTANT NOTE: These do not work great (if at all) yet; you might want to put `FALSE` in the appropriate sections of the configuration Due to crappy API restrictions, there isn't a real programmatic way to post to these services. However, this is *linux* so, dammit, there is. We are going to get around this by the use of `elinks` and the `pexpect` python library. Prior to use, you will need to use elinks and to log in to Facebook (use [the mobile site]( ) and to [the main Google page]( By default, elinks saves cookies, so you should be good there. ## Configuration Files These configuration files are expected to be in `$HOME/.config` . * `rss_social.rc` Each line has a single value, without any key. The order is important. Sane defaults are in the example file. * The location of the executable for `toot` * The location of the executable for `` * The location of `elinks` (for posting to FB, see below) * The location of `elinks` (for posting to G+, see below) * The location of the list of feeds * The location for the cache of urls * How many articles to send per run * The location of the URL encoder. One is included for convenience If you do not wish to post to any service, put a FALSE on the appropriate line in the configuration file. * `rss_social_feeds.rc` This file is simply parsed from the top to the bottom. Only three line beginnings matter here: * @CON=Content Warning Text * @SEN * @FEED= The first two are entirely option (and separately toggleable, as seen in the example). If @SEN exists, all images processed from that feed will have the "sensitive" tag on Mastodon. If @CON exists, everything after the equals sign will be the content warning descriptor for Mastodon. (See the example file). Finally, any line starting with @FEED should be an ATOM/RSS feed which will be processed. # Usage * Run `` on a semi-regular basis (e.g. a cron job) * Run `` on a semi-regular basis (e.g. a cron job) * Profit. Items are sent on a first _published_ first out, so slapping as many feeds into this as you like will still result in the first published articles being shared first. # Credits and where a lot of this started [] [] [] [] [] [] []