-
Notifications
You must be signed in to change notification settings - Fork 5
/
ftd_tweets.py
22 lines (16 loc) · 887 Bytes
/
ftd_tweets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python3
# Tweets from the FOIA The Dead script.
# Tweets a subset of new requests, and blog post updates with digests.
import yaml
from twython import Twython
config = yaml.load(open("config.yaml"))
twitter_account = config['twitter_account']
twitter_app_key = config['twitter_app_key']
twitter_app_secret = config['twitter_app_secret']
twitter_oauth_token = config['twitter_oauth_token']
twitter_oauth_token_secret = config['twitter_oauth_token_secret']
twitter = Twython(twitter_app_key, twitter_app_secret, twitter_oauth_token, twitter_oauth_token_secret)
def tweet_request(name,obit_url):
twitter.update_status(status='Just filed a FOIA request for the FBI file of {name}. NY Times obituary: {obit_url}'.format(**locals()))
def tweet_digest_post(post_title,post_url):
twitter.update_status(status='Blog post: {post_title} {post_url}'.format(**locals()))