Skip to main content

Posts

Showing posts with the label facebook

Publicly query facebook using Python

In my cosc lab today a few students were asking about doing something "real" and "cool" with Python, something that isn't easy in excel. After a bit of a think I came to the conclusion that getting data from the internet is a "real" enough problem. As for "cool", since most people seem to have facebook open in the background during labs I thought getting some real live data off facebook could be interesting. First a disclaimer or two. Don't just run random code without reading it and satisfying yourself that its not trying to delete your operating system or do anything sinister! I don't make the test or the assignment. This is not at all related, except for the fact it is using Python (okay it uses a for loop to iterate over a list, if nothing else in this post is of interest to you, learn how to do that!) So if anyone is still reading, let me introduce the problem, then look into how we can solve it. We will take a quick look at f...

Facebook App

Well I thought I would have a crack at making a facebook application last weekend. Figured although theres no official python facebook api there were a few third party options so I might as well use my favorite language... I also decided that it would also be a nice opportunity to look at this Django framework thing... I also decided that it might as well run on Google's Appengine... So first I skimmed through the django tutorial again - I've only used django once before and that was just a quick look to get graphs from Matplotlib displayed on a webpage. Then I took my time going through the appengine tutorial.... There are a few things that you have to get used too in switching from django to appengine. The easiest but also most annoying is changing all the models to use Google db models. Once I was reasonably to grips with both engines I started the fun bit of getting a django app running on app engine. It is actually easy as! My mechanical engineering friend Jun is keen to h...