I'd like to create a script that searches the Twitter API every minute for a list of phrases. I will provide the list of phrases. And I would like to be able to add more phrases to the list at any time in the future.
Create a database table with four columns:
3. Number of mentions
4. Average number of mentions
Count the number of mentions of each phrase per minute. Take a moving average of the last 10 tweets. Do this by adding the last 10 number of mentions together and dividing by 10.
If the number of mentions of one phrase increases by 10 times more than the average from one minute to the next, copy all the tweets that contain those phrases into the database and publish them to a page. Use the first tweet that mentioned the phrase as the title of the page.
On a separate page display a chart, which shows the number of mentions per minute for the phrase. Do this for all the phrases provided in a list.