logo

scripts

A bunch of scripts, some to be moved to their own repository git clone https://anongit.hacktivis.me/git/scripts.git/

track.py (433B)


  1. #!/usr/bin/python3
  2. # -*- encoding: utf-8 -*-
  3. from TwitterAPI import TwitterAPI, TwitterOAuth, TwitterRestPager
  4. import sys
  5. o = TwitterOAuth.read_file('credentials.txt')
  6. api = TwitterAPI(
  7. o.consumer_key,
  8. o.consumer_secret,
  9. o.access_token_key,
  10. o.access_token_secret)
  11. try:
  12. r = api.request('statuses/filter', {'track': sys.argv[1:]})
  13. for item in r:
  14. print(item['text'] if 'text' in item else item)
  15. except:
  16. print(sys.exc_info())