I am looking to write an application that can track a hashtag in twitter, get the id and text, and storing this in a MySQL database. So the application should be able to -
- Keep checking to see if anyone has tweeted on a particular hashtag (eg - #example).
- Store the details of the tweet.
I have code that can request twitter to search for a hashtag, and returns a list of 20 tweets with the given hashtag.
So now my questions are:
- How do I make sure that the same tweet is not pulled up again? (I can always store the tweet ID and check to see if it already exists when adding a new tweet, but not sure if this is the right way to go about it)
- I want to do this over a few hours, so will I need to include any kind of refresh code or something that can constantly keep running the search? (Specifically, I want to search for NEW tweets with the hashtag, not existing ones. So anyone who tweets the hashtag AFTER I start tracking, I want those tweets to get saved)
Any more information/code that is needed, please do ask and I can post it here! Bear with me, I am a beginner at this.