script/lib/iri_tweet/export_twitter_alchemy.py
changeset 83 4a759c70e40f
parent 82 210dc265c70f
child 84 b1029aa40ec3
--- a/script/lib/iri_tweet/export_twitter_alchemy.py	Fri Mar 18 15:45:49 2011 +0100
+++ b/script/lib/iri_tweet/export_twitter_alchemy.py	Mon Mar 21 19:30:14 2011 +0100
@@ -273,11 +273,14 @@
                     tweet_ts = int(time.mktime(tweet_ts_dt.timetuple()))
                     tweet_ts_rel = (tweet_ts-ts) * 1000
                     username = None
+                    profile_url = ""
                     if tw.user is not None:
                         username = tw.user.name
+                        profile_url = tw.user.profile_image_url
                     if not username:
                         username = "anon."
-                    element = etree.SubElement(elements, u"element" , {u"id":unicode(uuid.uuid4())+u"-"+unicode(tw.id), u"color":unicode(options.color), u"author":unicode(username), u"date":unicode(tweet_ts_dt.strftime("%Y/%m/%d")), u"begin": unicode(tweet_ts_rel), u"dur":u"0", u"src":u""})
+                    
+                    element = etree.SubElement(elements, u"element" , {u"id":unicode(uuid.uuid4())+u"-"+unicode(tw.id), u"color":unicode(options.color), u"author":unicode(username), u"date":unicode(tweet_ts_dt.strftime("%Y/%m/%d")), u"begin": unicode(tweet_ts_rel), u"dur":u"0", u"src":unicode(profile_url)})
                     etree.SubElement(element, u"title").text = unicode(username) + u": " + unicode(tw.text)
                     etree.SubElement(element, u"abstract").text = unicode(tw.text)