Skip to content

Commit

Permalink
Made little modifications to the source
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsvetan Tsvetanov committed Jul 6, 2012
1 parent 6006ed2 commit 494949f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions python/greet.py
@@ -1,7 +1,10 @@
import fbconsole
from urllib import urlretrieve
import imp
import fbconsole
import time
from datetime import date, timedelta

urlretrieve('https://raw.github.com/facebook/fbconsole/master/src/fbconsole.py', 'fbconsole.py')
fb = imp.load_source('fb', 'fbconsole.py')
fb.AUTH_SCOPE = ['publish_stream', 'publish_checkins', 'friends_birthday']
fb.authenticate()
Expand All @@ -15,8 +18,12 @@
"substr(birthday_date, 3, 5) <= \'" + nextDay.strftime("%d") + "\')")
names = fb.fql(query)

message = "Chestit rojden den! :)"
for name in names:
path = "/" + name.get('username') + "/feed"
fb.graph_post(path, {'message':message})

print "Birthdays greeted: "
if names == []:
print "None"
else:
message = "Chestit rojden den! :)"
for name in names:
path = "/" + name.get('username') + "/feed"
fb.graph_post(path, {'message':message})
print name.get('username')

0 comments on commit 494949f

Please sign in to comment.