This is a simple prototype of a larger idea. As a kid I remembered one of the things I loved doing was to call numbers for information: TV schedules, time, weather...before the internet, the phone line was the fastest way to get information. I wanted to develop a project that could emulate it, yet at the same time play with the concept of the internet making the telephone increasingly obsolete. I wanted to create a phone line that one can call for the latest internet trends: essentially using a call to complete a task one might normally do with a smartphone. I started with twitter trends. With the twitter API I was able to find out which places twitter had trend information for, and I wrote a python script that could pull the available information. I tried to build an extension for some major cities around the world, but it seemed like asterisk was unable to process the results within the dialplan. I hope to find a way to get around this problem in a future iteration.
Currently, it uses the most direct, and likely counter-intuitive workflow. I run the api calls via the Shell() command in the dialplan, store the result in a variable, and have Google API (using googletts) to recite the text. One predictable result was that the voice would read hashtags like a mess: a computer, of course, cannot read "#icantbreathe" without a few errors. However, I am pretty happy with the overall results.
Right now, it is set to call an api every time someone dials the extension, which is a problem if too many people call. I will try my best to find a way to fix this problem by ideally turning the api call into a cron job that is executed every 15 minutes, and have the results fed into the dialplan, so that the dialplan is accessing already saved results (since the twitter trends is updated every 15 minutes or so, there won't be any lag in the system).
I'll post my number for the project once I've fixed this problem, so I don't get banned from twitter before then!
Here is a recording of Dial-A-Twitter-Trend in action. I asked for London, and the trends at the time of the phone call are as follows:
#bbcqt #BBCMusicAwards #Questiontime Enoch Powell Farage Camilla Cavendish Penny Mordaunt Mary Creagh #RIPRosy Christmas