I was wondering if any could point me in the right direction.
I'm trying to fetch twitter data and save it to a DB (with Django ORM / models).
My first approach was to create a model with all relevant information of a tweet (Status) like this:
class Tweet(models.Model):
"""
A tweet (Status) with all the respective metadata
"""
id = models.BigIntegerField()
lang = models.CharField(max_length=10)
retweet_count = models.PositiveIntegerField()
text = models.CharField(max_lenght=150)
source = ....
....
And then fetching like:
#Almost pseudocode
from monitoring.models import Tweet
status = api.get_status('xxxx') # A simple tweet status with tweepy
newtweet = Tweet(id=status.id, screen_name = status.screen_name, followers_count = status.followers_count)
newtweet.save()
I guess I could do better and easy with tweepy models factory but I can't go in the right direction by my own...any suggest? Any example/link/article would be great.