Share Your Work in the Wave Samples Gallery

Monday, June 22, 2009 | 11:45 PM

Labels:

In the last three weeks, we've seen an amazing amount of activity in the Wave APIs community, with developers churning out new robots and gadgets by the dozens. Some developers have created waves listing their demos, other developers have posted in the forum, and others have created whole domains listing extensions. We wanted to make one central place for developers to share their work - and for people without Sandbox access to get a glimpse of their work - so we created the Wave Samples Gallery. The gallery is based off the code that powers the Youtube, GWT, and App Engine project galleries, but is customized for the Wave APIs.

If you're a Wave developer looking to show off your extension, you can sign in and fill out a form to submit your sample. After going through a moderation queue(we have to look out for evil robots!), your extension will appear on the front page and you can edit its information at any time.

If you're a Wave developer looking for inspiration, you can browse through recent submissions or filter by the language or API used. For each sample listed, you can check out screenshots, click through to a sample Wave (if you have sandbox access), view the source code, and read the technical details.

Currently, the gallery is mostly Googler-created submissions (denoted by a "G" badge), but the featured sample, Napkin Gadget, is from an Australian developer that attended our Google Wave APIs Day in Sydney. It's a collaborative Flash doodling app, and Marcin has open sourced the Gadget XML as well as an ActionScript <-> JavaScript bridge. Follow his lead, and let the world benefit from your code as well!


TwilioBot: Bringing Phone Conversations into Waves

Tuesday, June 16, 2009 | 9:37 PM

Labels:

Evan is Co-Founder and CTO of Twilio and he shares his experience building twiliobot on the Google Wave API.

One of the powerful features of Google Wave is the ease with which developers can integrate it with existing APIs. Lars and Stephanie demonstrated several Wave extensions that leverage other APIs such as Mappy using the Google Maps API and Rosy using the Google Language API. At the Post-I/O hackathon, I used the Twilio API to extend Wave into the world of telephony.

The result was twiliobot, a robot written in Python that uses the Twilio Phone API to create "voice waves." When a user adds twiliobot to a wave, the robot automatically finds and transforms the phone numbers in that wave into click-to-call links. When a user clicks a link, a call is placed to the user's cell phone or landline and to the phone number in the link and the two are connected. The subsequent phone conversation can then be recorded, transcribed, and automatically inserted into the wave as text with a link to the audio of the conversation.

Phoning from a wave with twiliobot

Here is a video of twiliobot in action, and a quick look at the code:

You can view, download, and see instructions on using twiliobot here.

The twiliobot code in svn is still very much a work in progress. For example, there's currently no way to store your own phone number and the logic for recording and transcribing calls isn't checked in yet. We'll be working on improving twiliobot over the next several weeks. If you have patches or ideas please submit them to the issue tracker. Also, feel free to drop us a line at help at twilio.com.

Easy API Integration

If you are a developer and thinking about building something on top of Google Wave — do it! Google has provided an amazingly powerful API, and I bet you'll have real code running in Wave in under an hour. At Twilio, we appreciate what it takes to build a straightforward API. Check out our docs, demos, and sign up for 1000 free minutes you can use to experiment with phone integration for your Wave extension or web app.

A big thanks to the Google Wave team for the opportunity to attend the hackathon and experiment with the API.


1 Wave Sandbox, 5 Hours, 17 Awesome Demos

Thursday, June 11, 2009 | 10:45 PM

Labels:

On May 28th, the second day of Google I/O, we unveiled Google Wave as a developer preview. But, we'd never actually had non-Google developers use it, and we were eager to see how it'd play out... So, on the Friday after I/O, about 60 developers assembled down at Google HQ for the very first Google Wave API hackathon.

After five hours of hacking and ad-hoc discussions with members of the Wave APIs team, there were a whopping 17 demos to show off. We were awed by how enthusiastically developers dove in to the APIs that day, and excited to see what they created. Their accomplishments were especially amazing as no one had even used the product prior to the hackathon.

Evan Cooke kicked off the demos with an amazing app that showed off the Twilio API by calling a phone number from a Wave, transcribing the conversation to text, and pasting it back into the wave. Andres Ferrate, who had never before programmed in Python or App Engine, showed off the first monetizing extension: a robot that searched Amazon for DVDs and books, and gave him a cut of any purchases made off the links.

Takashi Matsuo, who only showed up halfway through the afternoon, showed his simple but adorable app, a robot named 'Kay' that responds to you in a scrambled version of your original message, akin to baby talk. This robot is named after Takashi's upcoming product launch - a daughter named Kay. We believe 'Kay' to be the first Wave robot named after a future human.

Two developers demonstrated musically inclined gadgets; Dave Peck with his Dum Drumz" gadget, and Yasushi Ando with an HTML5-powered Piano gadget. The two have since collaborated to create the first collaborative Wave band.

Several of the Google engineers had stuff to show as well. David Byttow, lead on the Python Client library, showed off "Monty", an app that runs Python code and evaluates CALC macros. We suspect that this is just another of David's attempts to prove Python is the best language ever, but it was a great demo nonetheless. Alex North, a backend API engineer, showed off a bot based on the classic "Alice" AI. When Alex told Alice that "Google Wave is the shit", she responded, "But is it the only one?" Touché.

At the end of all the demos (too many to describe here!), Lars thanked all the developers and said, "I was so happy after seeing the first two demos, I nearly cried." We were all awed by how enthusiastically the developers dove into the APIs that day, and the great stuff they came up with in such a short period of time. We're hoping to replicate the awesomeness at the upcoming Google Wave API Day in Sydney on June 19th, and perhaps see some Australian themed extensions (Kangaroo-ey? Matey?).

We won't be able to personally organize hackathons all over the world, but we encourage co-located Wave developers to hold their own events and share the results. Always ahead of the trends, a group of Japanese developers held a meetup last week and shared their photos in a Wave.

If you're a developer that's eager to hack on Wave, read through the documentation, check out the various samples, and make sure to request sandbox access. A few enterprising developers have even created Google Wave gadget emulators, so you can get started hacking before you even have access. Have fun, and let us know in the forum if you have questions or problems.

(Note: Some of the links in this blogpost require WaveSandbox.com access to view.)

The Making of the Sudoku Gadget

Tuesday, June 9, 2009 | 9:32 AM

Labels:

If you watched the Google I/O keynote, you may have seen Lars and Stephanie playing each other in a furious game of competitive Sudoku - and Lars failing miserably (well, he has to fail at something). I originally wrote this as a single-player game, but when I joined the Google Wave team, I realized it would make a perfect fit for a Wave-enabled Gadget.

To make a game or app take advantage of the real-time Wave experience, you need to have a good understanding of how the gadget data is shared and propagated among all the Wave participants. Shared gadget data is stored as states, which are simply name/values pairs - like an associative array or hash map. So, when designing the Sudoku Gadget, I first had to decide what data needed to be stored, how to store it, and how to detect their changes.

When the Sudoku game first begins, we need states to remember the sequences of numbers that represents the puzzle and the solution. Since state data can only be of type string, I elected to store the JavaScript array of the puzzle and solution as JSON literals:

var PUZZLE = "[0,8,2,4,0,5,7,0,3,0,1,0,6,8,3,5,0,0,5,3,9,7,0,0,6,4,8,0,7,4,3,5,6,1,8,9,8,0,0,9,0,7,0,0,6,9,6,3,1,2,8,4,7,0,7,4,5,0,0,9,2,3,1,0,0,8,5,3,4,0,6,0,3,0,6,2,0,1,8,5,0]";
var SOLUTION = "[6,8,2,4,9,5,7,1,3,4,1,7,6,8,3,5,9,2,5,3,9,7,1,2,6,4,8,2,7,4,3,5,6,1,8,9,8,5,1,9,4,7,3,2,6,9,6,3,1,2,8,4,7,5,7,4,5,8,6,9,2,3,1,1,2,8,5,3,4,9,6,7,3,9,6,2,7,1,8,5,4]"

You can easily generate or parse the JSON literals of JavaScript arrays or objects with the library from json.org. Then use the method submitDelta() to submit this data as gadget states to the server:

var states = {};
var states["PUZZLE"] = puzzle;
var states["SOLUTION"] = solutoin;
wave.getState().submitDelta(states);

As soon as this call is made, each Wave participant that has registered a state update callback via setStateCallback() will receive a callback. In the callback, the gadget can use the value of the "PUZZLE" state to display the same Sudoku puzzle to all its participants, and uses the value of the "SOLUTION" state to determine if an input is correct.

To make the game competitive, I also needed to maintain state data to keep track of the correct answers for each participant. When a correct answer is verified, the gadget will submit a "cell_INDEX" state, where INDEX is the position of the board, with the value set as the username. So, if I answered the third square on the first row of the sudoku correctly, I would set this gadget state:

var states = {};
var states["cell_2"] = "Austin Chau"
wave.getState().submitDelta(states);

The setting of this state would again trigger the state callback method for each participant. The callback has logic to detect state updates that have names beginning with "cell_" (using this RegEx: /^cell_([0-9]+)$/ to do that) and then updates the UI to reflect a square being correctly filled.

A similar approach can be applied to other types of collaborative gadgets. In fact, I know there are plenty of variants to make collaborative sudoku. How about "Speed Sudoku" where all users get to play with the same puzzle and see who can finish first? Or maybe "Team Sudoku" where you can really work with other participants to complete the puzzle? Please check out the documentation for the Google Wave Gadgets API, we can't wait to see what you guys can come up with!

Happy coding :)


Google Wave API Office Hours

Monday, June 8, 2009 | 7:42 PM

Labels:

Starting this week, we're going to be holding regular office hours for developers in the Google Wave developer sandbox. Members of the Wave API engineering team will be on hand to answer questions about building robots or gadgets or embedding waves. We'll post transcripts on the Wave API discussion group shortly thereafter for permanent archiving and to benefit developers who don't yet have a sandbox account.

We've arranged our office hours to accommodate as many different schedules as possible. For at least the next few weeks, there will be two sessions:

  • Tuesdays, 6 p.m. to 7 p.m. PDT
  • Thursdays, 11 a.m. to 12 p.m. PDT

Watch for a wave from us kicking things off at these times. We hope to see you there — well, your caret anyway!

Google Wave team heads to Google Developer Days in Asia

Tuesday, June 2, 2009 | 10:34 AM

Labels:

Since Google Wave was unveiled as a developer preview at Google I/O, a few of us are heading on the road to let more developers know about the API platform and the underlying federation protocol. Later this week, some of us will be participating in Google Developer Day Beijing (Friday, June 5). Here are a couple of the sessions:

The Google Wave APIs

Speaker: David Byttow

In this session, we will show how to use the Google Wave APIs through demos and code samples. Learn how to add waves to your web site, extend Google Wave with both client- and server-side code, and integrate Google Wave with other services like Twitter or your favorite bug database.

The Google Wave Client: Powered by GWT

Speaker: Adam Schuck

This talk follows the Google Wave team's experience building the Google Wave client using Google Web Toolkit (GWT). We'll cover some recent advances in GWT which enabled Google Wave to look and feel like a desktop application with comparable performance. In addition, we will discuss the use of WebDriver (an automated web testing tool) which is integral to the project's success.

Next week, if you're in Japan, you can join Greg D'alesandre, Douwe Osinga, David Wang, and Daniel Danilatos at Google Developer Day Tokyo (Tuesday, June 9). Douwe will be presenting about the Google Wave APIs as well.

To get a deeper understanding of the Google Wave APIs, please request a sandbox account, check out the documentation, and review the code samples.

Stay tuned for more about our plans for events later in June in Sydney, AU and Sao Paulo, Brazil.


Posted By: Dan Peterson, Product Manager, Google Wave