Authored by Vicky Steeves

SHARE ATOM feed -> Twitter Script


Adapted from Remi Rampin's YAML -> Twitter script found here: He also helped me debug a lot, so thanks 😸


You'll need python (this script is written for python 3, but can be easily adapted to python 2) and a few key libraries, including:

  • feedparser
  • tweepy
  • sqlite3
  • smtplib

This script presupposes you have a database called tweets.sqlite3 & that it has a table called 'feed' - you can make it with this quick python script (or in just plain sqlite3 if you want):

import sqlite3

conn = sqlite3.connect("/PATH/tweets.sqlite3")

cur = conn.cursor()

    CREATE TABLE feed(link VARCHAR(255) PRIMARY KEY, title VARCHAR(255), date DATETIME)


Running It

I'm running this currently on an EC2 instance, but you could probably run it on whatever server.

Edited 2.99 KB
  • Need to be updated for new Twitter character limit! I don't have access...

    Also note that the way you truncate the title is not optimal, in particular it will add the "..." even if the title fits in a tweet. Consider using shorten() from @ReproFeed

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment