Skip to content

Instantly share code, notes, and snippets.

@hj91
Created May 2, 2011 12:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hj91/951521 to your computer and use it in GitHub Desktop.
Save hj91/951521 to your computer and use it in GitHub Desktop.
Get Facebook Notifications on sms using Python
# This code is meant to show how to get latest notifications on sms using python-gammu library
# Very simple and primitive code..
# To Do - Create a mysql backend and run this program every 10 minutes. The notifications sent before shoudent be sent on sms again (i need someone to write code for that ;)
import feedparser
import gammu
import urllib2
import gammu
sm = gammu.StateMachine()
sm.ReadConfig()
sm.Init()
a=urllib2.urlopen("your FB notifications RSS link ")
b=feedparser.parse(a)
c=[]
for i in range(len(b.entries)):
c.append(b.entries[i].title)
#send me the latest 5 notifications
for i in c[:5]:
print "\n"+i
message3 = {'Text': i, 'SMSC': {'Location': 1}, 'Number': 1234567890}
sm.SendSMS(message3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment