Who Am I – A Facebook Game, Part 3

This is the third part of ‘Who Am I – A Facebook Game’. If you didn’t already, check out part 1 and part 2.
This post’s code can be found on the whoami repository on github.

Where Were We?

In the first part we introduced Who Am I – a Facebook game that helps you get a better understanding of your personality through friends feedback.
In the second part we developed all the basic functionality of the game using Python and Flask.

In This Post

In this post we are going to register our game on facebook.
We’ll go over the steps needed to register a game and configure it.
While at it, we will introduce ngrok – a tool that will allow you to host the game on your computer.
We will then integrate our game with the facebook API so it can use the player’s facebook data such as her name, photo and friends list.
Finally we are going to create test users and test our game.
Continue reading

Who Am I – A Facebook Game, Part 2

This is the second part of ‘Who Am I – A Facebook Game’. The first part can be found here.

Where Were We?

In the first part we introduced Who Am I – a Facebook game that helps you get a better understanding of your personality through friends feedback.
We talked a little about Python and Flask and then proceeded to create a simple hello world web application in Flask.

In This Post

The final code for this post can be found in the whoami repository on github.
In this post we are going to add the core game functionality into our application – we will create the player’s home page that shows her personality and the test pages that allows the player to define his personality and give feedback to her friends.
Initially I wanted to make the game a facebook game in this post but it got too long. So facebook will have to wait for the next post.
Continue reading

Who Am I – A Facebook Game, Part 1

UPDATE Part 2 in now published!
UPDATE Part 3 in now published!

Who Am I is a simple Facebook game built with Python and Flask.

In this and following posts I will introduce the game and develop it step by step. I will use the following stuff to develop the game:

  • Python (you need basic skill in Python)
  • Flask – a web framework for Python
  • HTML + CSS + Javascript – and the ubiquitous jQuery library
  • Facebook APIs – GraphAPI mostly

You probably need some experience in programming and web applications in order to follow along. If you ever programmed using a web framework (in any language) you will have easier time understanding the concepts.

Continue reading

Why Learn Python? Because It’s FUN!

After leaving my job in a big american corporate, I spent some time thinking about how I want my next job to look like.
Browsing job description I came to a conclusion that I must learn a scripting language in order to find a job I like. Seems like most consumer web apps are written using some kind of scripting language. More structured languages like Java are used mainly in corporates (they are calling it Enterprise Java for a reason).
OK, so which scripting language to learn?
I looked for:

  1. A language that would help me find a job I like – it should be used in companies I find interesting
  2. A language that makes it easy to write consumer web applications – Java, for example, does not make it easy to write web applications. It is very good for writing code that interacts with other code but it’s verbosity makes it very hard to write code that interacts with humans
  3. It should be fun to use the language and it should have decent tools and libraries – IDE, web frameworks, etc.

Three very popular scripting languages are – Ruby, PHP and Python.
Javascript is another popular language and with the advent of node.js it can also be used for server side programming. But we’ll not look at Javascript since you must know javascript if you’re planning on doing any web programming anyway.
Ruby is very popular due to Ruby on Rails.
PHP is also very popular. A lot of very popular open source content management systems are written in PHP. Two very known examples are WordPress and Drupal. Facebook also uses PHP extensively.
Python is a little less popular for web applications. But I chose Python. Why? Read on to find out
Continue reading