Harry Tormey

October 4, 2009

PyGameSF meetup Thursday October 8th 6pm @ 3rd floor Main San Francisco Public Library

Filed under: Facebook, Interesting, Programming, Pylons, Python, Social Networks, Technology — Tags: — admin @ 9:59 pm
The October PyGameSF meet up will be at the PALEY (not the STONG) conference room on the third floor of the main San Francisco public library besidecivic center BART. The library closes at 8pm so we will reconvene to frjtz on hayes street for dinner/drinks afterwords.This month’s presentations are:

  • Shannon -jj Behrens, How to Blow Up Helicopters Using Pygame. The talk will consists of a summary of some of the libraries and tricks JJ used for his two PyWeek entries. It will be covering topics such as PGU, generator-based animations, and state machine based levels.
  • Harry Tormey, Who is it? This talk will cover the in’s and outs of working with Facbook and pylons while giving an update on a social network game I am currently working on. (This talk will cover a lot of the material skipped over in the August presentation)

    JqueryTwitter: A simple Twitter Pylons example using Jquery and python-twitter

    Being able to write applications for facebook is nice but if you really want to be all hip and buzzword 2.0 compliant you need to be able to add ajax and Twitter to your repertoire. With this in mind I decided to put together a simple little demo which uses Jquery/python-twitter to scrape, search and update a list from the twitter public time line in “real time” every time you type a letter in a text box. You can grab the source here.

    In times of yore developing any web application involving Javascript meant wading through a sewer of browser incompatabilites and crafting inelegant hacks to deal with the fact that the majority of people surf the web using old non standards compliant web browsers (i.e internet explorer 6). To add insult to injury the tools available for developing Javascript back in those ancient times totally sucked.

    Fast forward to 2009 and we have awesome debugging tools like firebug and webkit inspector which make web development a somewhat more manigable proposition. Apart from nicer debugging tools the Javascript scene has been flooded with a wave of sweet libraries (mochikit, yui, Jquery, etc) all designed to abstract away common tasks and annoyances (browser incompatabilities I’m looking at you). Add to all of this the recent focus by brower makers on Javascript performance (v8, JavaScriptCore, etc) and you will find that developing Javascript today is incomparably nicer than in the bad old days.

    Most of the secret ajax sauce that powers this example can be found in demo/public/search.js. My library of choice for this project is Jquery, which I picked due to the fact that there has been a ton of plugins written for it, it’s been around since 2006 and is very straight forward to use.

    The application comes bundled with Jquery and python-twitter. It assumes a basic familiarity with both Javascript/Jquery, that you have read chapter two and three of the excellent freely available pylons book and or that you know your way around Pylons. Unlike my facebook example this demo should serve straight out of the box (after you serve up development.ini with paster visit http://127.0.0.1:5330/search/index). Enjoy.

    October 1, 2009

    HelloPylons: A hello world example for Facebook using Pylons and PyFacebook

    As a follow up to my talk at the PyWebSF meet up I decided to put together a “hello world” style facebook app. The goal of the app is to illustrate clearly the relationship between what gets displayed on your facebook app’s canvas page and what get’s sent back to the sever hosting your app via it’s facebook callback. You can download this application here. To reiterate some points I made in my presentation, the basic flow of a facebook application is like so:

    • Someone visits your application (i.e http://apps.facebook.com/yourapp/), what they see is the canvas.
    • Visiting the canvas causes facebook to makes a callback to your application (i.e http://www.harryisawesome.com/yourapp/callback/)
    • The information passed by facebook in the callback is parsed by your application which then determines what gets returned and hence displayed in the canvas.
    • Think proxy (indirect connections).
    The full list of goals for the HelloPylons application are: Keep syntax as simple as possible (no decorators, etc), Keep all logic in the controller so its easy for a Pylons novice to see whats going on, print and decode everything that gets sent in the facebook callback to the console in plain english.

    The application comes bundled with the pyfacebook library and assumes that you have read chapter two and three of the excellent freely available pylons book and or are familiar with the basics of how Pylons works. I also assume that you have read the facebook developer getting started page.

    In order for this demo to work you will need to edit development.ini, change the port to something appropriate and add the api_key, app_id, url and secret key for your application. All of these should be provided when you create an application on facebook (follow the instructions on the facebook developer getting started page).

    September 30, 2009

    Slides from my talk on Facebook and Pylons

    I had a great time speaking about the challenges of developing Facebook applications in Python using Pylons at the PyWebSF meet up last night. The focus of my talk was on Facebook’s canvas/callback http request flow and how to handle it within your Pylons controller. I will be doing a follow up talk at the October PyGameSF meet up where I will demo a Facebook game I have been working on. The slides for the meetup can be found here. I will post a hello world Facebook/Pylons example in the near future.

    Powered by WordPress