Wow, I loved this presentation! Feel like a programming kung fu master… – Will
Revenge Of Kick-Ass Mash-Ups with Punk Rock APIs
Kent Brewster
@kentbrew
  • Notable Mash-Ups
    • Google Maps Mash-Up: first recorded AJAX mach-up, probably inspired most of the state of the modern art.
    • Flickr Blog badges
  • Punk Rock: DIY ethic
    • Other generative things
      • lego blocks, erectors sets, refrigerator boxes
      • original apple //e
    • is your site sterile?
      • users are cows, not customers
      • real customers are coke and GM
      • any unauthorized use is abuse
  • Your existing API
    • you already have an API: HTML
    • you’re already being screen-scraped
      • you know this
  • If you open up an API, you get pinpoint data about how it is being used.
    • Sterile APIs: HTML, RSS
    • Generative APIs: Free.
    • Punk Rock APIs: use generative APIs to turn sterile APIs into generative APIs.
  • Job interview at netflix: asked to review code. looking through real source code, he found that they had cribbed his own code. hired.
  • Netflix Bubble Widgets
    • single line javascript include
  • Pipes.yahoo.com
    • this is why yahoo is still relevant. they are doing amazing stuff like pipes.
  • Some very little javascript can do amazing things because it relies on Yahoo Pipes to do the heavy lifting.
  • YQL: yahoo query language. amazing tool.
    • select * from twitter.search where q=‘earthquake’;
    • This works because the community contributes tables (see community tables) that actually do the fetching/parsing of the data.
  • bit.ly/kb_twit 
  • bit.ly/kb_sxsw
    • used YQL, and a bit of xpath.
    • filtered results, nice presentation, runs fast.
  • Advice for Hackers
    • Go easy on the server. Since every request comes from a separate IP address, client-side mash-ups look like botnet attacks.
    • Respect robots.txt
      • Pipes and YQL respect robots.txt
    • Create and pass an application ID even if it’s not required. 
    • Let the site now what you’re doing. They might hire you. 
  • Advice for Site Owners
    • Build your API first. Build your site on your API, and then open it up to the community. Example: Flickr.
    • Whitelist Pipes and YQL: It’s the right thing to do.
      • They are giving you a free API caching mechanism
      • Twitter has done it. If you are running up against twitter API limits, try it.
  • How to open an API where you work
    • Build an interesting mash-up
    • Write the documentation for the API you wish you had.
    • Don’t write a spec. Write the actual docs.
    • Give it to the back-end guys.
  • To Be Useful for Client-Side Mash-Ups
    • Return Javascript
    • Wrap the requested JSON in the client’s preferred Javascript callback
  • To be useful for repeated calls… (some complicated stuff I didn’t get)
    • something having to do with square brackets
  • Every Javascript reply must have HTTP Status 200
    • If it comes back with anything else, the browser won’t see the response and the calling script will hang forever.
  • Demo the Last: Missing Kids CAPTCHA
  • Questions…
    • What if a call never returns?
      • You have to set a timeout. Probably requires a global variable. 
    • Examples of business mashups? Examples of doing it to correct a company’s bad UI?
      • People are more interesting to me… so not so aware.
      • Don’t surprise anyone in your IT group. If you should it to your boss, and they think it is awesome, you’ve really stuck the IT group in a corner.
    • If you’re a company, and you’ve never done this before, go talk to Mashery, or other companies like that.