Skip to content

Instantly share code, notes, and snippets.

@glortho
Created May 14, 2015 20:36
Show Gist options
  • Save glortho/c6418e2ade17e64c1d88 to your computer and use it in GitHub Desktop.
Save glortho/c6418e2ade17e64c1d88 to your computer and use it in GitHub Desktop.
Gnip Powertrackreplay
#!/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