An experimentation to use Twilio Trial SMS as a notification medium for RSS Feed updates (Anime, Manga, etc)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add code and documentation Sep 29, 2016
LICENSE
README.md Moved crontab sample to README.md Sep 30, 2016
main.py Remove unicode messages for smaller message segments Oct 2, 2016
requirements.txt Add code and documentation Sep 29, 2016
screenshot.png Add code and documentation Sep 29, 2016
screenshot2.png Update screenshot for manga Sep 29, 2016
user.json Improve schema and add manga RSS example Sep 29, 2016

README.md

rss-twilio-bot

An experimentation to use Twilio Trial SMS as a notification medium for RSS Feed updates from http://www.nyaa.se/ (Anime) and http://mangastream.com/rss (Manga).

Screenshot

Requirements

Format (user.json)

{
  "Subaru": {
    "phone_number": "+818012345678",
    "subscribed_urls": [
        {
            "url": "http://www.nyaa.se/?page=rss&cats=1_37&term=720p+horriblesubs+01+mkv&minage=0&maxage=30"
        }
    ]
  },
  "Barusu": {
    "phone_number": "+818023456789",
    "subscribed_urls": [
        {
            "url": "http://mangastream.com/rss",
            "pattern": "Shokugeki no Souma [0-9]+"
        }
    ]
  }
}

Each records will have a unique identifier of a record (in this case, user's name).

phone_number should conform to Twilio phone number format.

subscribed_urls is a list of url feed (required) and pattern (optional, which is targeted to RSS title in entries) which you want to get notification from if a new update occurs.

The RSS Feed URL above will give you an update for all first (ep. 1) release from HorribleSubs.

Installation

It is recommended to use virtualenv instead of installing dependencies in global system with:

$ cd <this project directory>
$ virtualenv -p python27 venv
$ source venv/bin/activate

After that, you can install Python dependencies with:

$ pip install -r requirements.txt

Required TWILIO values (main.py):

  • TWILIO_ACCOUNT_SID
  • TWILIO_AUTH_TOKEN
  • TWILIO_PHONE_NUMBER

You can get those values for free with Twilio trial account. One of the side note of trial account is that you can only send your messages to verified number.

Twilio phone number can be acquired by following the tutorial here: https://support.twilio.com/hc/en-us/articles/223136107-How-does-Twilio-s-Free-Trial-work-

Run

After correctly configuring user.json, you can execute the script by running:

$ python main.py

For best usage, you need to set a cron job (e.g.: every 10 minutes) to run this script and check periodically. For Example:

*/10 * * * * /path/to/project/venv/bin/python /path/to/project/main.py

crontab.guru can help you for the human readable cron schedule

Future Idea

  • Add AWS Lambda (scheduled events) + S3 integration (db.json and user.json) to run this script serverless.

License

MIT License.

Last Updated: September 29, 2016