kumistatus/tweet.py

19 lines
566 B
Python
Raw Normal View History

2016-03-18 20:09:50 +00:00
#!/usr/bin/env python3
import argparse, twitools
2016-03-18 20:09:50 +00:00
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Send a tweet from the status monitor\'s account.')
parser.add_argument('-r', '--reply', default=None, metavar='ID', type=int, help='reply to tweet ID')
parser.add_argument('-t', '--text', default=None, type=str, help='tweet provided string')
args = parser.parse_args()
2016-03-18 20:09:50 +00:00
two = twitools.twObject()
try:
if not args.text:
text = input("> ")
else:
text = args.text
2016-03-18 20:09:50 +00:00
except KeyboardInterrupt:
exit(0)
two.tweet(text, args.reply)