diff -r 3823611919ef -r 2b17b26ca153 script/lib/iri_tweet/export_twitter_alchemy.py --- a/script/lib/iri_tweet/export_twitter_alchemy.py Fri Jan 21 18:44:01 2011 +0100 +++ b/script/lib/iri_tweet/export_twitter_alchemy.py Tue Jan 25 15:45:55 2011 +0100 @@ -144,11 +144,7 @@ query_res = session.query(Tweet).join(EntityHashtag).join(Hashtag).filter(~Tweet.id.in_(select([tweet_exclude_table.c.id]))).filter(Hashtag.text.contains(options.hashtag)).filter(Tweet.created_at >= start_date).filter(Tweet.created_at <= end_date).all() - - #hashtag = u"%#"+unicode(options.hashtag)+u"%" - - #cursor.execute("select tt.id, tt.text, tt.created_at_ts, tu.name, tu.screen_name from tweet_tweet as tt join tweet_user as tu on tt.user = tu.rowid where text like ? and tt.created_at_ts >= ? and tt.created_at_ts <= ? and tt.id not in (select id from tweet_exclude) order by tt.created_at_ts asc;", (hashtag,ts,te)); - + root = None ensemble_parent = None @@ -218,7 +214,7 @@ if polemic_added: meta_element.append(polemics_element) - etree.SubElement(meta_element, u"twitter").text = etree.CDATA(unicode(tw.original_json)) + etree.SubElement(meta_element, u"source", attrib={"url":u"http://dev.twitter.com", "mimetype":u"application/json"}).text = etree.CDATA(unicode(tw.original_json)) if content_file and os.path.exists(content_file):