Creating a Twitter Application

To interact with Twitter, you need to create a Twitter application. In this case you most likely also want to create a new Twitter account if you already have one to prevent testing the Twitter API and annoying your followers.

You can sign up for a Twitter account and pick a new, unique name at https://twitter.com/signup. The game you build in this chapter is a simple Hangman game. After you complete the signup and confirm your account, go to: https://dev.twitter.com. This is the Twitter developer site where you can find documentation and create Twitter applications. You need to log in again with the account that you just created.

When logged in, mouse over your account name in the top right and click My Applications. On the applications page, click Create New Application (see Figure 22-1).

Figure 22-1: The Application setup screen.

c22f001.tif

Fill in the first three required fields: Name, Description, and WebSite. (You may need to get a little creative to come up with a unique name.) Accept the terms of use, fill in the captcha, and submit the form. Your application’s settings screen displays.

Because the game is going to tweet, you need to change the permissions for the app. Click the Settings tab and then scroll down the page to Application Type. Change the type from Read Only to Read and Write and click Update.

To make it easier to start with the API ...

Get Professional HTML5 Mobile Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.