August 21st, 2009 by Eddie Sullivan
Get it? It's a fantasy sports draft application, but it's spelled draught. Like draught beer. I like to watch football with a beer or two, and everyone loves a good pun. So there you go.
In my fantasy football and baseball leagues, we wanted to do a live draft, but we have players who live on both coasts, who work varying schedules, and some of whom have kids. Plus one of our rules is we allow keeping two to four players from year to year, to give some continuity.
Because of those two factors, it's impossible for us to use Yahoo!'s live draft or autodraft. So what does your trusty software engineer do? He codes up his own draft application, of course!
Read the rest of this entry »
Posted in JavaScript, django, programming, python - 1 Comment »
September 29th, 2008 by Eddie Sullivan
Welcome to the third part in my series of posts about creating a
Facebook application. I am using Django as my web development
framework, and this post will focus on some of the backend
techniques I have worked out to make this work easier. This is
not a tutorial, but a set of tools that I have developed. This
is a long post, with a lot of source code; I hope you find at
least some of it useful.
Keep in mind as you read this that the Facebook platform is
still very new, and likely to change. In fact, if you're a FB
user, you are probably aware they recently completed a major
transition to a new profile design. This included many changes
behind the scenes for developers, some of which are still
playing out. I recommend keeping up with
the Facebook
Platform Developer Forum and
the Facebook
Developer Blog.
Also, I will assume you have already read
the API
Documentation and the documentation
for PyFacebook,
and that you know how to create a web app
using Django. If not,
you will want to start there.
Read the rest of this entry »
Posted in JavaScript, django, facebook, programming, python - 3 Comments »
August 17th, 2008 by Eddie Sullivan
Welcome to the second part in my series of posts about creating
a Facebook application. I am using Django as my web development
framework, but this post doesn't have much to do with Django,
since it deals with the front end. In particular, it talks about
how to write JavaScript that can work both in and out of
Facebook.
As I mentioned last time, Facebook lets developers use a subset
of JavaScript, which they call FBJS. The FBJS is transformed on
the fly into JavaScript as the page is loaded. All variables and
functions you define or reference are prepended with a string
like "a123456789_", including calls
to document.getElementById
and setTimer and the like. This is
done in order to restrict what you can do with DOM elements, to
avoid cross-site-scripting attacks and unwanted user-hostile
behavior. FBJS is fairly well documented, so if you plan to do
some Facebook JavaScript development, you should start there.
The biggest restriction that FBJS imposes is that you can no
longer access the attributes of DOM elements directly, but must
go through an abstraction API consisting of a series of setters
and getters. For example, instead of saying something like
imageEl.src = myImageUrl, you instead need
to call imageEl.setSrc(myImageUrl).
Read the rest of this entry »
Posted in JavaScript, django, facebook, programming, python - 2 Comments »