xml - How to save twitter feed entries to a django model? -
xml - How to save twitter feed entries to a django model? -
so, here twitter feed want save model: #stackoverflow. able each entry in feed dictionary using feedparser. , info looks this:
{ 'author': u'stackfeed (stackoverflow)', 'author_detail': { 'href': u'http://twitter.com/stackfeed', 'name': u'stackfeed (stackoverflow)'}, 'authors': [ { 'href': u'http://twitter.com/stackfeed', 'name': u'stackfeed (stackoverflow)'}], 'content': [ { 'base': u'http://search.twitter.com/search.atom?lang=en&q=stackoverflow', 'language': u'en-us', 'type': u'text/html', 'value': u'how inject single mill instance multiple repositories , unit of work using ninject?: first, have ... <a href="http://t.co/vyqlswj5">http://t.co/vyqlswj5</a>'}], 'guidislink': true, 'href': u'http://twitter.com/stackfeed', 'id': u'tag:search.twitter.com,2005:164382321993187328', 'link': u'http://twitter.com/stackfeed/statuses/164382321993187328', 'links': [ { 'href': u'http://twitter.com/stackfeed/statuses/164382321993187328', 'rel': u'alternate', 'type': u'text/html'}, { 'href': u'http://a2.twimg.com/sticky/default_profile_images/default_profile_3_normal.png', 'rel': u'image', 'type': u'image/png'}], 'published': u'2012-01-31t16:19:34z', 'published_parsed': time.struct_time(tm_year=2012, tm_mon=1, tm_mday=31, tm_hour=16, tm_min=19, tm_sec=34, tm_wday=1, tm_yday=31, tm_isdst=0), 'summary': u'how inject single mill instance multiple repositories , unit of work using ninject?: first, have ... <a href="http://t.co/vyqlswj5">http://t.co/vyqlswj5</a>', 'title': u'how inject single mill instance multiple repositories , unit of work using ninject?: first, have ... http://t.co/vyqlswj5', 'title_detail': { 'base': u'http://search.twitter.com/search.atom?lang=en&q=stackoverflow', 'language': u'en-us', 'type': u'text/plain', 'value': u'how inject single mill instance multiple repositories , unit of work using ninject?: first, have ... http://t.co/vyqlswj5'}, u'twitter_geo': u'', u'twitter_lang': u'en', u'twitter_metadata': u'', u'twitter_result_type': u'recent', u'twitter_source': u'<a href="http://twitterfeed.com" rel="nofollow">twitterfeed</a>', 'updated': u'2012-01-31t16:19:34z', 'updated_parsed': time.struct_time(tm_year=2012, tm_mon=1, tm_mday=31, tm_hour=16, tm_min=19, tm_sec=34, tm_wday=1, tm_yday=31, tm_isdst=0)}
and want save info model. how should build model?
i start this
class author(models.model): name = models.charfield(... uri = models. ... class tweet(models.model): author = models.foreignkey('author'), related_name='tweets') title content = models.textfield published_datetime summary
and add together more fields needed.
xml django-models twitter
Comments
Post a Comment