Public
Authored by Vicky Steeves

SHARE ATOM feed -> Twitter Script

Edited

Thanks/Citations

Adapted from Remi Rampin's YAML -> Twitter script found here: https://github.com/ViDA-NYU/reproducibility-news/tree/master/build. He also helped me debug a lot, so thanks 😸

Dependencies

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()

cur.execute('''
    CREATE TABLE feed(link VARCHAR(255) PRIMARY KEY, title VARCHAR(255), date DATETIME)
    ''')

conn.commit()
conn.close()

Running It

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

share-feed-to-twitter.py 2.58 KB
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