Created
May 2, 2011 12:18
-
-
Save hj91/951521 to your computer and use it in GitHub Desktop.
Get Facebook Notifications on sms using Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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