вторник, 11 июня 2013 г.

GoogleReader replacement with RaspberryPi + rss2email + cron + GMail


1. Install rss2email
sudo apt-get install rss2email

2. Configure rss2email
#It stores things in ~/.rss2email
r2e new email-example@gmail.com
cat <<EOF >~/.rss2email/config.py
HTML_MAIL = 1
DATE_HEADER = 1
DEFAULT_FROM = "email-example@gmail.com"
FORCE_FROM = 1
SMTP_SERVER=  "smtp.gmail.com"
AUTHREQUIRED=1
SMTP_SEND = 1
SMTP_USER = "email-example@gmail.com"
SMTP_PASS = 123456
SMTP_SSL = 1
TRUST_GUID=1
EOF

3. Import subscriptions
Use Google Takeaway to get a copy of your Reader subscription data.

#import to rss2email
r2e opmlimport subsciptions.xml
#get list of subsciptions
r2e list

4. Fetch data
#fetch rss data but don't send. we are already had read them
r2e run --no-send
#some time later fetch to get new ones
r2e run

5. Automate
#the better way is to use cron to automaticaly fetch each 2 time in hour
sudo crontab -u user1 -e
#add this line and save
*/30 * * * * r2e run

6. Some useful rss2email commands
r2e add http://www.example.com/feed/
r2e opmlexport > subscriptions.xml
r2e list
r2e delete 123

7. In gmail create filters for you feeds.