Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Paste Description for sms2twitter

Posting incoming SMS messages to Twitter account on S60 smart phones using PyS60.

sms2twitter
Monday, June 29th, 2009 at 2:55:00pm MDT 

  1. # Copyright (c) 2009 Andreas Schreiber <Andreas.Schreiber@dlr.de>
  2.  
  3. import sys
  4. sys.path.append("e:\\Python")
  5.  
  6. # PyS60
  7. import appuifw
  8. import e32
  9. import inbox
  10.  
  11. # Twyt
  12. from twyt import twitter
  13.  
  14. def message_received(msg_id):
  15.     box = inbox.Inbox()
  16.     sms_text = box.content(msg_id)
  17.     appuifw.note(u"SMS content: " + sms_text , "info")
  18.     api = twitter.Twitter()
  19.     api.set_auth('python_demo', '*')
  20.     api.status_update(sms_text)
  21.     app_lock.signal()
  22.  
  23. def quit():
  24.     app_lock.signal()
  25.     appuifw.app.set_exit()
  26.  
  27.  
  28. box = inbox.Inbox()
  29. box.bind(message_received)
  30.  
  31. print "Waiting for new SMS messages..."
  32. appuifw.app.exit_key_handler = quit
  33. app_lock = e32.Ao_lock()
  34. app_lock.wait()

Paste Details

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
worth-right