Skip to content

Commit 2b4bd8d

Browse files
committed
updated for new twarc.py
1 parent ad3d494 commit 2b4bd8d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

utils/tweet.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
#!/usr/bin/env python
22

3+
"""
4+
Fetch a single tweet as JSON using its id.
5+
"""
6+
37
import sys
48
import json
59
import twarc
610

711
tweet_id = sys.argv[1]
8-
tw = twarc.TwitterClient()
9-
tweet = tw.fetch('https://api.twitter.com/1.1/statuses/show/%s.json' % tweet_id)
12+
tw = twarc.Twarc()
13+
tweet = tw.get('https://api.twitter.com/1.1/statuses/show/%s.json' % tweet_id)
1014

11-
print json.dumps(tweet, indent=2)
15+
print json.dumps(tweet.json(), indent=2)
1216

1317

1418

0 commit comments

Comments
 (0)