Copy link to clipboard
Copied
Does anyone know if there are any libraries that are still maintained or at least valid for working with the Twitter API?
Thanks.
the following is an excerpt from a book (Flash Game Development: In a Social, Mobile and 3D World) i published 2 years ago,
Two main steps are needed to use requests that requires authentication. First, you must register your game with Twitter. Second, you must either implement the OAuth protocol or use a library like Tweetr that implements the protocol.
To use requests that require authentication (and those for which it is supported), you must
...Copy link to clipboard
Copied
the following is an excerpt from a book (Flash Game Development: In a Social, Mobile and 3D World) i published 2 years ago,
Two main steps are needed to use requests that requires authentication. First, you must register your game with Twitter. Second, you must either implement the OAuth protocol or use a library like Tweetr that implements the protocol.
To use requests that require authentication (and those for which it is supported), you must first register your game with Twitter at https://dev.twitter.com/apps/new. (See Fig11-12.)
***Insert Fig11-12.tif***
[The Twitter application registration page at https://dev.twitter.com/apps/new.]
Fill out their form, agree with all those rules, prove you are a human being by filling out the Captcha form and click the Create your Twitter application button. You should see Fig11-13.
***Insert Fig11-13.tif***
[After successful registration, copy your Consumer key and secret.]
Copy your Consumer key and Consumer secret. You will need both to make authenticated requests on behalf of users. These numbers are used by Twitter to identify your game when a user gives your game permission to make requests on their behalf.
Click the Settings tab (see Fig11-14) and add an icon or change your settings, if needed. In particular, note the Application Type settings. If you need more than read-access, tick the Read and Write or Read, Write and Access direct messages.
***Insert Fig11-14.tif***
[The Twitter application registration page at https://dev.twitter.com/apps/new.]
Click the Update this Twitter application's settings if you made any changes or additions.
Tweetr is a free open-source ActionScript library that implements the OAuth protocol and allows your game to make Twitter requests that require authentication. Setting up your game to use Tweetr is a multi-step process.
All the needed files are in support files/Chapter 11/twitter/authentication. But to ensure you have the latest files go to http://wiki.swfjunkie.com/tweetr.
***Insert Fig11-15.tif***
[You should have both TweetrWEB.swc and as3crypto.swc in your library path and both should have Link Type: Merged into code. Your paths will be different from that shown.]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript" type="text/JavaScript" src="js/tweetrOAuth.js"></script>
</head>
<body>
<script type="text/JavaScript">
OAuth.verify();
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<script language="JavaScript" type="text/JavaScript" src="js/tweetrOAuth.js"></script>
<script language="JavaScript" type="text/JavaScript" src="js/swfobject.js"></script>
</head>
<body>
<div id="flashDiv">
no flash
</div>
<script type="text/JavaScript">
var so = new SWFObject("twitter.swf", "twitter", "700", "400", "9", "#336699");
so.addParam("allowScriptAccess", "always");
so.write("flashDiv");
</script>
<script type="text/JavaScript">
OAuth.setFlashElement("twitter");
</script>
</body>
</html>
Your now ready to create your game, twitter.swf. In the document class code below, I show how to use the Tweetr class to obtain authentication and make requests that require authentication.
Copy link to clipboard
Copied
Thanks!!!!
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now