ScraperWiki is a powerful cloud-based service that lets you scrape data from online documents and websites.
When you write a scraper – a script to pull information from a web resource and then parse out the bits you want – it will execute inside the ScraperWiki environment.
You can store the data that is scraped inside a data store and then access the data from outside the ScraperWiki environment using their API. Scrapers can be written in one of several different languages – Ruby, PHP and Python.
ScraperWiki and Tropo operate in a very similar way. The Tropo scripting environment allows you to write scripts in one of several different languages, including Ruby, PHP and Python (Groovy and JavaScript are also supported).
Your script executes inside the Tropo environment, which means you can make direct connections to external resources – like the ScraperWiki API – from within your executing script. There is no need for extra HTTP overhead, and the additional step of posting to a back end server to connect to other APIs or resources.
In the following screencast, I demonstrate how to use Tropo and ScraperWiki to quickly and easily build an airport information system for the Philadelphia International Airport.
All of the code for this example can be found here. If you’d like to view the actual scraper I wrote on ScraperWiki, you can find it here.
This is still a work in progress – I’d like to run this script multiple times per day (ideally, maybe once an hour) to get updates to flight information and ensure that the app has the most up to date flight status. The voice dialog could also use a little tweaking, and I’d like to offer the option of repeating the information.
But even with these refinements aside, it is evident how combining these two powerful cloud resources can generate a pretty useful application in a very short time.
Tropo and ScraperWiki are a powerful combination. Happy flying!
Tim Strimple joined us at the LA Holiday Hackathon to get in on the competition of building Tropo applications for prizes and won a $50 Tropo Production credit for his Tropo SMS and Wolfram Alpha mashup!
You can ask the application virtually any question via SMS using the following phone number 661-206-2681 and it responds to your inquiry via SMS using Wolfram Alpha’s search results. Here’s a video of Tim demonstrating his application in action!
Here’s the code behind Tim’s Tropo SMS Wolfram Alpha mashup! It’s written in PHP and uses the Tropo Scripting API.
<?php
function CheckForShortcut($request)
{
if(stripos($request, "siri") !== false)
{
return "I don't like to talk about her.";
}
if(stripos($request, "remind") !== false)
{
return "I am not your personal assistant.";
}
if(stripos($request, "tropo") !== false)
{
return "Tropo is great, I love it!";
}
return false;
}
function ParseResponse($response)
{
// Replace with real XML parsing
$min = strpos($response, "</plaintext>");
$startPos = strpos($response, "<plaintext>", $min) + 11;
$endPos = strpos($response, "</plaintext>", $startPos);
$length = $endPos - $startPos;
if($min > 0)
{
return substr($response, $startPos, $length);
}
else
{
return "Go ask Siri...";
}
}
function GetResults($request)
{
$shortcut = CheckForShortcut($request);
if($shortcut)
{
return $shortcut;
}
$request = str_replace (" ", "%20",$request);
$wolframApiKey = "XXXXXX-XXXXXXXXXX";
$url = "http://api.wolframalpha.com/v2/query?appid=" . $wolframApiKey . "&input=" . $request;
$response = file_get_contents($url);
return ParseResponse($response);
}
if($currentCall->channel == "TEXT")
{
$result = GetResults($currentCall->initialText);
say($result);
}
else
{
say("I do not support voice currently. Try sending me a text message instead.");
}
?>
Approximately 30 Los Angeles .NET, Ruby, PHP, and Javascript developers attended this Saturday’s LA Holiday Hackathon at Outlook Amusements sponsored by RightNow Technologies and Tropo. The theme of the event consisted of building a Voice, SMS, or Instant Messaging holiday application based on the Tropo Scripting or Web API. Here is a photo of everyone hard at work hacking on their holiday Tropo application.
I love the sound of phones ringing in the morning! By noon, the applications were starting to take shape with some definite front runners in the competition. In addition to Tropo APIs, many of the teams also used Phono, SMSified, RightNow, Wolfram Alpha, and Google’s Shopping APIs to deliver their new applications.
Here are the winners of the LA Holiday Hackathon listed in order:
First place goes to Gift Finder winning an iPad2 compliments of RightNow Technologies. This application allows the user to enter a phone number, name, and email address to place an outbound call to someone to recommend gifts for loved ones. Speech recognition was used to ask the user for their zip code, gender, price range range, and category of the gift. The application uses the Google Shopping API to find gifts in their area for the gender and age of the recipient and reads them off one by one using text to speech. This application was built using Ruby and Sinatra and hosted on Heroku as well as using the Javascript Tropo Scripting API.
Second place goes to Santa’s Book winning a Kindle Fire compliments of RightNow Technologies. This application asks for two phone numbers and starts by calling the first number to ask a series of five questions using speech recognition to determine if the person is naughty or nice along with asking them to record the present that they would like to receive. The application proceeds to call the second number to relay the naughty/nice determination and playback their gift recording. The application also sends an SMS text message to the second number with the naughty/nice determination along with the transcribed gift request. This application also used RightNow’s CRM API to log the call and data related to the surveys. This application was built using PHP and the Tropo WebAPI along with RightNow’s CRM API.
Third place goes to Santa Hack winning a $75 Fry’s Electronics gift card compliments of Outlook Amusements. This application used Phono and Tropo to schedule and bridge appointments to speak with Santa. This application was built using C# and the Tropo WebAPI.
Fourth place goes to Tropo WA (Wolfram Alpha) winning a $50 Tropo production credit. This application was a Wolfram Alpha and Tropo SMS mashup written in PHP using the Tropo Scripting API. You can ask the application various questions via SMS on the following number 661-206-2681.
Ushahidi is a platform for crowdsourcing information. Members of the public submit reports that are geo-located and then put on a map. The platform is used in disaster relief, election monitoring and just about any other situation where people need to learn things from one another quickly and concisely. Out of the box, Ushahidi allows people to submit reports via the web, mobile applications, Twitter, Facebook with support for a few SMS APIs as well.
We have created an easy-to-use application that lets people use Tropo to input data into Ushahidi via SMS. We’ve put the code up on Github and you’re welcome to submit pull requests if you find bugs or add features.
To use the code, you don’t have to install anything on Ushahidi. Here are the steps:
In Ushahidi, create a user with “Admin” privileges.
check out the code from Github
edit the configuration lines at the top with your Ushahidi credentials and URL
create a new Scripting API Application on Tropo.com.
Once your Tropo app is created, you can add an SMS-enabled number (US and Canada currently) and optionally configure it to talk on any IM networks or Twitter.
Now, when you send a message to any of your configured numbers the application will attempt to geo-locate the message based on its contents. The app then submits a report via the Ushahidi API in an unverified state. Admins of the site can then verify the reports and publish them to the web.
In our example here, we simulated a flood in Milwaukee. The instance pulls in feeds from local media and disaster response community, accepts reports via the web and accepts reports from a Tropo app I created. We sent a message to the number configured in the app with the following content:
Columbia St. Mary’s Hospital Milwaukee WI is flooded. Power is out.
This was submitted to Ushahidi in an unverified state. The reviewer then added text to flush out the report based on other incoming data and then published the report:
This sort of crowdsourced data, gathered at the source, is valuable for many reasons. It gets the word to responders and the public more quickly so that people can act appropriately (e.g. by not going to that hospital, go to another one.) First responders become aware of the weight of a problem when more people report the same thing or when the first report comes in of a very big event.
Watervoices.ca, developed this past weekend at RHoK, will be going live with this application soon and we hope to see others using it to help the world soon. Over time, we will be adding support for Voice, PhoneGap within Ushahidi and many other features.
This is a guest blog post by Jonathan Baldwin showcasing an application that he wrote using Tropo called The People’s Skype. It’s phone-powered, distributed voice and voting system for the #Occupy Movement!
As the Occupy Wall Street movement grew in popularity at Zucotti Park in NYC, and other occupations in North America, Jonathan noticed a problem with the primary method occupiers used to communicate in large groups. The People’s Mic, a method of augmenting a speaker’s voice by having listeners repeat their words, didn’t scale up when huge numbers of people attended rallies and General Assemblies. In these cases, the audience had to repeat the speaker’s words multiple times before it reached the far edges of the crowd – it became gradually harder to understand the original speaker’s words the further you are from the inner circle.
Motivated by this, Jonathan was determined to find a simple solution that anyone had access to. There were similar talks amongst the OWS Tech groups about ways to solve this problem, but those ideas never panned out (they included handheld radios and VoIP systems). He also wanted to address another problem of General Assemblies – hand signals are used to communicate consensus with ideas. In a massive crowd, it is hard to express opinion through visual cues, so he wanted to integrate this problem into a one package solution.
Thus, Jonathan created a one-way conference call solution, called The People’s Skype, through the Tropo phone system. Using PHP, MongoDB and Tropo, he created a simple interface that anyone with any kind of phone, no matter how old, could dial in and create a unique mic with. Upon mic creation, the speaker is given a 4 digit PIN to distribute to others that want to listen in (by holding up a sign or word of mouth). Anyone can call to the original number and listen by typing the unique PIN. Only the speaker is able to talk, while listeners can vote on issues by using their dial-tone, phone keypad (1 for Yes, 0 for No, etc.).
As the Tropo conference call system is able to support hundreds of people, audience members can either turn their speakerphones on to create a distributed PA system, or listen directly on their handsets. Due to the applications flexibility, it could potentially help fragmented occupiers communicate across police barriers or kettled areas.
Try out The People’s Skype yourself: http://www.peoplesskype.org! You can also download a copy of Jonathan’s source code from Github.
The theme of the LA Hackathon is “Build Voice/SMS apps for Holidays”! Here are a few ideas to get you thinking:
Santa Caller (similar to http://santacall.us) – Build a website that allows a parent to schedule a call to their kids from Santa. Have Santa ask the kid what they would like for Christmas and then email the parents their kid’s recorded message and/or transcribe the message for the email.
Holiday Greetings Hotline – Build a holiday greetings hot line where user can leave a voice message that will be transcribed into text and posted to “Holiday Greetings” twitter account.
Even though this event is sponsored by the .NET Developers Group, we will be supporting all development languages and will have Tropo expertise onsite in .NET, PHP, Ruby/Rails, and Javascript, and Node.JS!
We are excited to feature flockNote on this week’s Tropo Customer Spotlight! Today I sat down with Matthew Warner, the Founder of flockNote, and Jeff Geerling, their CTO, to discuss their business and learn more about how they are using Tropo for their Voice and SMS services.
What is flockNote?
flockNote is a custom registration and communication tool that takes care of your bulk emailing, text messaging, phone calling, social media and more – all from one place.
flockNote is made specifically for Catholic parishes, dioceses and organizations who want to connect with their members using the most effective communication tools of today.
It’s simple, friendly and effective. And it gives your leadership team a powerful way to organize and manage all of your communications across your many ministries.
flockNote uses PHP, Drupal, and the Tropo Scripting API to deliver Voice and SMS services to parishioners. They even use one of Tropo’s SMS short codes (84576) to deliver a very high volume of SMS messages on-demand as needed by churches.
As you may recall, Disruptive Technologies recently extended the capabilities of OpenVBX (the open source cloud PBX software) to run on our Tropo cloud communications platform. The original blog post announcing this project was entitled, “Jailbreaking OpenVBX“. This title was chosen carefully because at the time of the post, OpenVBX only ran on a single cloud platform. Disruptive Technologies was able to extend the communications layer of this application to not only add support for Tropo but also simplify future efforts involved in adding support for other platforms such as Asterisk, FreeSwitch, and others.
As it turns out, the original repository maintainers declined to accept Disruptive Technologies’ GitHub pull request to merge the code bases and asked that the name of the new project be changed, effectively requesting a formal fork of the open source project. Here is the new GitHub repository for TropoVBX.
The TropoVBX fork still provides support for multiple platforms – including the platform of the original repository maintainer. Disruptive Technologies will also be merging updates from the original fork where possible and continuing to add new features to TropoVBX as time permits. Because TropoVBX now runs on the Tropo platform, there are many new and advanced features only supported Tropo which include:
Speech Recognition in 24 languages
Text-to-Speech in 24 languages with male and females voices for each
Support for biometrics on password resets
Ability to route Skype calls into TropoVBX
Ability to support true SIP VoIP in and out of the platform
Please feel free to clone, contribute, and fork the new TropoVBX project and use our logo as you see fit. Our version of this project will remain truly open in every sense of the word and spirit of open source.
In this post I’d like to tell you about the latest project I’ve been working on, which is built using the Tropo API. It’s an elaboration of the “Moveable” series of apps, which I have written about previously here. It’s also supercharged with some ideas lifted directly from Telephony Black Magic, originally presented by Mark Headd.
My app is called Info Balloon, and you can check it out at www.infoballoon.org. You move a hot air balloon avatar around on a Google map, and get access to a number of location-based services. The app also features a text input field I call the “WormHole”, which allows you to jump directly to another location on the U.S. map. It uses an html5 text input element, so it accepts either typed or spoken text. And for added fun, courtesy of Google, it knows how to deal with colloquial names for places, like “This Big Apple” and “The Windy City”.
This app is all about retrieving location-based data. It calls out to a REST-like API I created, on the backend, so it should be readily extensible to more services. Right now, I’ve got it hooked up to:
The National Registry of Historic Places (via NRHP database)
Tides (via NOAA data)
Google Places (via Google Places API)
Weather (via Google Weather API)
For services like the tide and the weather, you get the local information applying to the zip code where your Info Balloon is located. For other services, like the National Registry of Historic Places, and Google places, each time you click the “Next” button you get the next entry, in an ever-expanding perimeter.
Another feature, which I’ll have more to say about later, is that you can get the information delivered to you in any one of 10 languages, from French to Chinese. Thanks to JQuery, whenever you change a parameter, the app immediately responds by displaying in the appropriate language, with the appropriate data from the appropriate service.
But wait, there’s one more thing, and I’ve been saving the best for last. You dial a special Tropo access number on your phone, and get all the info window data read to you, by a language -appropriate speaker, over the phone, in real time.
This real time spoken output on your personal voice channel is what make this app fun. You can rapidly switch between services, languages, and locations, and the speech output keeps chugging away. It’s all because of the magic of Node.js, Socket.io, Redis, and of course, Tropo.
Here’s the code, in PHP, that orchestrates the output of this voice data:
I’m excited about the notion of a personal voice channel, a number you dial up to to listen to your personalized fire hose of data. Here, it’s data about locations you are visiting on a map, but really, it could be anything. It could be a real time translation of an SMS message, or a feed of your favorite news clipping service. There’s lots of potential here which I hope to explore in future posts.
Remember when the iPhone was only available on AT&T? That was true until October 11, 2009 when a young coder named geohot (and friends) released the first iPhone/iPod jailbreak. Suddenly iPhones weren’t tied to to just AT&T…now you could give AT&T the boot and choose Verizon or T-Mobile as your service provider. Score!
In the spirit of geohot’s jailbreaking efforts, the rapscallions at Disruptive Technologies took on the the task of “jailbreaking” OpenVBX.
OpenVBX is a web-based open source phone system. It’s essentially a virtual PHP/MySQL PBX and it’s available for download from GitHub. Users of OpenVBX can make phone calls, send text messages…all very cool.
The catch is…you’re locked into one service provider: Twilio. There’s no way to choose to use another cloud telephony provider…until now.
Today we’re pleased to announce a new fork of OpenVBX that adds support for Tropo. For the first time, users of OpenVBX will have a choice of multiple platforms on which to run it, making it REALLY OpenVBX.
The coders at Disruptive Technologies added full support for the the Tropo API and Phono SIP-based VoIP web phone to the communications layer of the OpenVBX project. Of course, when selecting the Tropo API, users will now get access to all of the more advanced features of the Tropo network: speech recognition and text-to-speech in 24 languages, phone numbers in over 40 countries, international SMS, in/outbound SIP VoIP support, inbound Skype support, multiple phone numbers per callflow script, improved conferencing.
Disruptive Technologies also extended OpenVBX with the VoiceVault API to support Voice Biometrics in password resets. After adding VoiceVault credentials on the API Accounts Tab, the password reset dialog will provide an option to request a phone call to reset your OpenVBX account password.
The OpenVBX fork with Tropo can be found on GitHub. We have sent the maintainer of the OpenVBX project a pull request to merge these updates into the project. The following features and bugfixes have been added to the OpenVBX package:
Fixed a redirect bug. OpenVBX no longer incorrectly redirects users to 404 pages.
Fixed bug in Twilio client. 60 seconds after the user has been “inactive”, the client is no longer able to be called for that user. This prevents calling the client if the user has closed their browser. (This also works for the Phono Client)
Added support for the Tropo API. You can now add a “Tropo API account” on the system settings page, and from the installer. Either a Tropo or Twilio account is required. Included in the new Tropo API additions are:
Support for Tropo domestic and international phone numbers, on the “numbers” page.
All applets in the “flows” page now support Tropo JSON as well as TwiML. Any number can be assigned any flow – so a tropo number and a twilio number can both be assigned the same flow.
Support for existing Tropo numbers & applications. If the user prefers to set up their numbers initially in Tropo.com, the application will see these numbers and they can be assigned a flow within the application.
Recordings, and Voicemail, as well as outbound dialing with Tropo.
Several theme changes. The OpenVBX logo has been modified to include both the Tropo and Twilio logo. If only one of the accounts is active, only that logo will show in the VBX logo – so if a user only has a Twilio account, only the Twilio logo will show, and vice versa. Other minor theme changes:
Several pages in the System Settings tabs have been reworked. Notibly the API accounts page, which now has each API accounts logos.
Step 3 of the installation has been reworked.
Several Twilio-specific content has been changed to be more ambiguous.
Added support for “Phono” browser phone, in addition to the Twilio Client. Any non-Twilio based numbers will use the new Phono browser phone.
This project has since been renamed to TropoVBX. Please refer to the updated blog post and new source code repository on GitHub.