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).
- 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
- If the room is invite-only, invite the hook bot to the room (by using
/invite hookID@partychat-hooks.appspotchat.com
- (Optional) give the hook bot a nicer alias by using the appropriate form on its edit page
- Create a new post hook
- 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 - 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:
Hooks aren't working for invite-only rooms :( I couldn't get them to join a room once invited, now it wont recognize the hook ID as a valid email address.
ReplyDeleteMax,
ReplyDeleteIf you wouldn't mind emailing partyvhapp@googlegroups.com with some more details (room name, hook ID, etc.) we can see what's going on.
Err, partychapp@googlegroups.com
ReplyDelete