Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # This dumb script is public domain. Have fun with it! If it pees on
- # your carpet, it's not my fault!
- # You'll need http://code.google.com/p/python-twitter/, and this
- # script currently uses a patch that's not incorporated in the
- # trunk. If you feel inclined, just hack the source to catch a
- # urllib2.HTTPError in the method GetUser().
- import twitter
- import sys
- api = twitter.Api(username='YOUR_USERNAME_GOES_HERE',
- password='YOUR_PASSWORD_GOES_HERE')
- msg = sys.argv[1:]
- at_user = None
- if msg[0].startswith('@'):
- try:
- at_user = api.GetUser(msg[0][1:]).GetId()
- except TwitterError:
- sys.stderr.write("Could not find user %s. Ignoring.\n" % msg[0][1:])
- msg = msg[1:]
- api.PostUpdate(" ".join(msg), in_reply_to_status_id=at_user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement