1 |
douglas |
1179 |
# Facebook |
2 |
|
|
# |
3 |
|
|
# Douglas Thrift |
4 |
|
|
# |
5 |
|
|
# $Id$ |
6 |
|
|
|
7 |
|
|
import icalendar |
8 |
|
|
import urllib, urllib2 |
9 |
|
|
import warnings |
10 |
|
|
|
11 |
|
|
def main(calendar, config, debug): |
12 |
|
|
with warnings.catch_warnings(): |
13 |
|
|
warnings.filterwarnings('ignore', r'object\.__init__\(\) takes no parameters', DeprecationWarning) |
14 |
|
|
|
15 |
|
|
for event in icalendar.Calendar.from_string(urllib2.urlopen('http://www.facebook.com/ical/u.php?' + urllib.urlencode({'uid': config.get('uid'), 'key': config.get('key')})).read()).walk('vevent'): |
16 |
|
|
print event |