Created
May 14, 2015 20:36
-
-
Save glortho/c6418e2ade17e64c1d88 to your computer and use it in GitHub Desktop.
Gnip Powertrackreplay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
"exec" "twxec" "-e" "replay_stream()" "$0" "$@" | |
from trickle.gnip import PowerTrackReplayStream | |
import datetime as dt | |
user = {{string User_Name}} | |
account = {{string Account_Name}} | |
password = {{password Account_Password}} | |
config = {{string GNIP_Configuration}} | |
end_date = dt.datetime.utcnow() - dt.timedelta(hours=1) | |
start_date = end_date - dt.timedelta(days=5) | |
def replay_stream(): | |
with PowerTrackReplayStream(user, password, account, config, start_date, end_date) as stream: | |
for tweet in stream: | |
yield tweet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment