22
Jun
09

Not Drowning, Waving

I spent some time with the good folks at Google Sydney and a heap of fun Australian developers exploring Googles new “wave” technology.

In short is pretty cool, an already neat GUI wrapping some serious back-end firepower to creat a collaborative environment that merges Realtime Publishing, Chat and Email. After a morning briefing on the tech, I Spent my afternoon with fellow Python lover Carlo Piva (http://www.linkedin.com/pub/carlo-piva/7/260/33b) creating a robot that objected to foul language and censored it. For those on Wave, try it by adding invectivedeleted@appspot.com to any wave (aka conversation) and just try to be rude or racist :-)

The code to do this is short and sweet - we decided in the name of expediency to use an existing site noswearing.com for the swearing correction.

This example shows off a couple of cool things :

  1. how to make a basic bot that communicate with an external ”web service” for its functionality
  2. how to do POST requests
  3. how to screen scrape the results
  4. how to update existing blips (posts)

Here is the Python me and my coding buddy came up with:

from waveapi import events
from waveapi import model
from waveapi import robot
from google.appengine.api import urlfetch
from google.appengine.ext.webapp.util import run_wsgi_app
import urllib

def OnParticipantsChanged(properties, context):
  “”"Invoked when any participants have been added/removed.”"”
  added = properties['participantsAdded']
  for p in added:
    Notify(context)

def OnRobotAdded(properties, context):
  “”"Invoked when the robot has been added.”"”
  root_wavelet = context.GetRootWavelet()
  root_wavelet.CreateBlip().GetDocument().SetText(”I’m alive!”)

def Notify(context):
  root_wavelet = context.GetRootWavelet()
  root_wavelet.CreateBlip().GetDocument().SetText(”Hi everybody!”)

def OnBlip(properties, context):
  “”"Invoked when the robot sees a blip”"”
  blip = context.GetBlipById(properties['blipId'])
  contents = blip.GetDocument().GetText()
  good = unswear(contents)
  if (good!=contents):
    blip.GetDocument().SetText(good)

def unswear(bad):
  url = “
http://www.noswearing.com/index.php

  form_fields = {
    “action”: “translate”,
    “p”: bad,
    “racial”: “on”,
    “submit”: “Filter”
  }

  form_data = urllib.urlencode(form_fields)
  result = urlfetch.fetch(url=url,
    payload=form_data,
    method=urlfetch.POST,
    headers={’Content-Type’: ‘application/x-www-form-urlencoded’})
  html = result.content
  key_start = ‘<span style=”font-family: arial; font-size:12px;”>’
  key_end = ‘</span></div><br>’
  return html[html.find(key_start)+len(key_start):html.find(key_end)]

if __name__ == ‘__main__’:
  myRobot = robot.Robot(’invectivedeleted’,
      image_url=’http://s44.photobucket.com/albums/f39/philonikes/aim%20icons/th_fuck.gif’,
      version=’9′,
      profile_url=’http://invectivedeleted.appspot.com/’)
  myRobot.RegisterHandler(events.WAVELET_PARTICIPANTS_CHANGED, OnParticipantsChanged)
  myRobot.RegisterHandler(events.WAVELET_SELF_ADDED, OnRobotAdded)
  myRobot.RegisterHandler(events.BLIP_SUBMITTED, OnBlip)
  myRobot.Run()

Have fun!

26
Feb
09

Media 09

I covered Media09 in Sydney for Digital Media Journal. The article is here.

Highlights are the stuff about the online Obama Campaign by Ben Self, program director and founding partner of Blue State Digital.

28
Nov
08

Marque Owen on webcasting from Everest

Hear all about Marque’s adventures supporting the first ever mother/daughter climb of Everest by Nikki Bart and her mother, Cheryl Bart.

hear about everest here.

Marque and the Mountain

Marque and the Mountain

10
Nov
08

Here is my take on some recent microsoft tech announcements

I sometimes write for digital media, a journal in Australia. Here and here (pdf, page 2) you can read what I had to say about recent microsoft tech announcements.

10
Nov
08

Scott Hanselman discusses the new frameworks from Microsoft

Scott

Scott

Listen to Scott describe his role as a developer advocate at Microsoft and give his thoughts on the new web frameworks from Microsoft and others.

listen to Scott hanselman here!

17
Oct
08

The Delicate Genius and Shane discuss Silverlight

-)

The Genius :-)

He likes it purdy

He likes it purdy

 

 

 

 

 

 

 

 

 

 

 

Kordahi and Morris from the Australian Evangelist Team at Microsoft discuss Silverlight and how it is shaping up against the Adobe Flash Monster.

Special Thanks to www.digital-media.net.au for getting me access to these fine individuals!

michael and shane

02
Oct
08

Angus Logan on Microsoft Live

Angus Logan

Angus Logan

Jeremy chats to Angus about all things Microsoft live including the implications of new “Live Mesh” cloud storage for digital media.

Angus Logan on Microsoft Live

02
Oct
08

Welcome !

strage devices podcast

strange devices podcast

Welcome to the home of the Strange Devices podcast. Coming Soon – Interviews with Local and International Digital Media Luminaries.