TwitRSS.me Gentoo Guide

TwitRSS.me

TwitRSS.me is a service that attempts to help people easily set up RSS feeds to scrape Twitter and produce an RSS feed, but recently it has met trouble in the form of Twitter rate limiting the requests coming from the creator's servers. However, the scraper script is available under a GPLv2 license, meaning that you're free to download and use the scraper privately.

Private use

The scraper for user feeds works fine at the time of writing this, and as long as your RSS feed reader is a little flexible you can just run the scraper every time you want to update the RSS feed.

Installing the scraper script

Emerge the atom dev-perl/App-cpanminus to conveniently install the scraper's perl dependencies.
Clone the repository from https://github.com/ciderpunx/twitrssme.git.
Enter the newly created directory twitrssme and run cpanm --installdeps . as root.
If you encounter errors, they can be viewed in /root/.cpanm/work/<your build id>/build.log
I had to install dev-perl/ExtUtils-PkgConfig, and add --force to the cpanm, because one test failed, returning undef instead of ''.

Testing

The following should produce an RSS feed from the twitter feed @ciderpunx

cd fcgi
perl twitter_user_to_rss.pl

Set up with newsboat

Move the scraper script (twitrssme/fcgi/twitter_user_to_rss.pl) to where you want it, then create an executable script twitrssme with the contents:

#!/bin/bash
perl /path/to/twitter_user_to_rss.pl user=$1 | sed "1,4d"

Then in your newsboat urls file:

"exec:twitrssme dril" sometags

Apache server without FastCGI

The official installation instructions describe installing FastCGI, but this is only necessary if you want to set up another public instance. If you're setting up a server to share with a small group of people, FastCGI is not necessary.

Installing dependencies

Make sure you have built www-servers/apache with the cgi USE flag.
Install the scraper script like described above.

Configuring Apache

First, move all of the files in the repository to a new apache content directory:

mkdir -p /var/www/twitrssme/htdocs
cp -r twitrssme/* /var/www/twitrssme/htdocs/
mv /var/www/twitrssme/htdocs/fcgi/ /var/www/twitrssme/cgi-bin/

Add a virtual host to /etc/apache2/vhosts.d/ with the following configuration:
/etc/apache2/vhosts.d/02_twitrssme_vhost.conf

<VirtualHost *:80>
    ServerName twitrssme.localhost
    Include /etc/apache2/vhosts.d/twitrssme_vhost.include

    <IfModule mpm_peruser_module>
        ServerEnvironment apache apache
    </IfModule>
<VirtualHost>

/etc/apache2/vhosts.d/twitrssme_vhost.include

ServerAdmin root@localhost

DocumentRoot "/var/www/twitrssme/htdocs"

# This should be changed to whatever you set DocumentRoot to.
<Directory "/var/www/twitrssme/htdocs">
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>

<IfModule alias_module>
  ScriptAlias /cgi-bin/ "/var/www/twitrssme/cgi-bin/"
</IfModule>

<Directory "/var/www/twitrssme/cgi-bin">
  AllowOverride None
  Options None
  Require all granted
</Directory>

Then add the hostname to /etc/hosts

127.0.0.1 localhost
127.0.0.1 twitrssme.localhost

Edit the /var/www/twitrssme/htdocs/index.html file, changing the line:

<form action="/twitter_user_to_rss/" method="get">

to

<form action="/cgi-bin/twitter_user_to_rss.pl" method="get">

And do the same with twitter_search_to_rss.pl if you wish.

Run the apache server: rc-service apache2 start

Now you should be able to visit and use the instance at twitrssme.localhost, and hook up http://twitrssme.localhost/cgi-bin/twitter_user_to_rss.pl?user=dril to get spicy RSS updates from your favorite twitter users (as long as the apache server is running!)

With FastCGI

If you want to create a public instance and share it with the general population, FastCGI would be a good idea. The installation process is like the above, but also install the atom www-apache/mod_fcgid.

Then enable FCGID in /etc/conf.d/apache2:
APACHE2_OPTS="... -D FCGID"

I don't know how to configure further, but the following resources should help:
https://httpd.apache.org/mod_fcgid/
https://wiki.gentoo.org/wiki/Apache#Enabling_PHP_through_fcgid
https://github.com/ciderpunx/twitrssme/blob/master/INSTALL.md#step-4-configure-the-web-server