Tuesday, June 22, 2010

Fun with web hooks

As alluded to on Twitter by Kushal, Partychat-hooks is a nerdyfun companion to Partychat that lets you send and receive data from Partychat rooms via WebHooks.

To give a sample use case, here's how to add a "commitbot" that notifies a room whenever there's a commit made on a code.google.com project (Jehiah provides samples for other project hosting sites).

  1. Add a hook bot to the room that you wish to send messages to. It'll get assigned a hook ID of the form hookID@partychat-hooks.appspotchat.com
  2. If the room is invite-only, invite the hook bot to the room (by using /invite hookID@partychat-hooks.appspotchat.com
  3. (Optional) give the hook bot a nicer alias by using the appropriate form on its edit page
  4. Create a new post hook
  5. Copy its HTTP endpoint URL (of the form http://partychat-hooks.appspot.com/post/hookID) into the WebHook field of the "Source" page of the "Administer" tab on your code.google.com project
  6. Use this format to parse the commit data into a message that will be sent to the room (this page explains more about the JSON format):
    {% for r in json_decode(request.body).get("revisions") %}
      {{r.get('author')}} committed: {{r.get('message')}}
      http://code.google.com/p/{{
          json_decode(request.body).get("project_name")
          }}/source/detail?r={{r.get('revision')}}
    {% end %}
    

Then, a few seconds after the commit, you'll get a notification:

commitbot in action

Wednesday, May 19, 2010

Friendlier web interface, /share is back, and more

Here's some recent changes that I've made to Partychat:

  • Make the homepage friendlier (and slightly prettier), especially the room creation form.
  • Improve web-based room management (building on what David started), so that you can join, leave, or request an invitation from the room's web page (here's a sample room for the current developers).
  • Prettify the plusplusbot display in the web UI.
  • Add a /share command that makes it easy to share URLs and give some context.
  • Clean up some data layer issues and fix some inconsistencies.
  • And of course, quite a few bug fixes (nothing like scanning the AppEngine logs looking for NPEs).

/share command

There's also been some recent production issues that have kept me busy. For example, yesterday a user invited room A as a member of room B, and vice-versa. As an unintentional side-effect of a change that I made to make the setup process more user-friendly, it became very easy to set off an infinite loop of messages. By the time I realized what was going on, we'd run out of App Engine bandwidth quota. Thankfully after some budget rejiggering and a some quick code change all was well. Similarly, a couple of weeks ago we had CPU usage issues (though optimizing that away was still fun).

It seems like chat is gaining in trendyness, with HipChat launching recently (presumably to challenge the incumbent Campfire) and Brizzly/Thing Labs's Picnics happening. Partychat will probably remain a hobby/fit-within-AppEngine-free-quota sort of project indefinitely, but it's been fun polishing it (and of coure, there's still quite a few things left to fix).

Semi-cross-posted from Mihai's blog.

Wednesday, February 24, 2010

Partychapp not responding to messages

Partychapp appears online, but is not responding to messages. We're not sure why, but we're assuming it's an issue with AppEngine. Will investigate

Update: Back to normal - issues were due to http://code.google.com/status/appengine