Game Development Reference
In-Depth Information
color":"8f000e","profile_image_url":"http:\/\/a3.twimg.
com\/profile_images\/1263338441\/Photo_on_2010-11-
30_at_20.36__3_normal.jpg","default_
profile_image":false,"show_all_inline_
media":false,"lang":"en","geo_enabled":false,"profile_
sidebar_border_color":"BDDCAD","time_zone":"Eastern
Time (US & Canada)","followers_count":6989945,"screen_
name":"aplusk"},"in_reply_to_user_id":null,"in_reply_
to_status_id":null," text ":"Joey Roth's stuff is legit
http:\/\/t.co\/pGQbtuX via
@Fab","geo":null,"favorited":false,"created_at":"Mon Jun
20 20:32:47 +0000
2011","in_reply_to_status_id_str":null,"id_
str":"82908775849267200","in_reply_to_screen_
name":null,"in_reply_to_user_id_str":null,"id":829
08775849267200,"contributors":null,"retweeted":fal
se,"source":"\u003Ca href=\"http:\/\/twitter.com\/
tweetbutton\"rel=\"nofollow\"\u003ETweet
Button\u003C\/a\u003E","coordinates":null,"retweet_
count":46,"place":null}]
Data returned are in a format called JSON (JavaScript Object Notation).
It was designed as a human-readable text data interchange standard.
Although it's difficult to make immediate sense of it by just looking at
Listing 8.8 (because it is standardized), computer algorithms can be
written to extract data into a more meaningful format. Messages in JSON
are in the format key : data. To find messages typed in by Ashton among
the other text, the key “ text ” is searched for and the following text in
double quotes is the actual message. For the reader's benefit, the key “ text
has been typed in bold in Listing 8.8 after which you will find the message.
Posting messages to Twitter on behalf of a user is much more complex.
There are three authentication steps to which you need to adhere.
The first step is to send Twitter a message from your application asking
for permission to access the user's account. The user's Web browser then
opens, asking them if it is ok for the application they are using to access
the Twitter account. If the user permits this access he or she receives a PIN
number. The user enters this PIN number into the application. Following
this, the application sends another message to Twitter telling it that it
has the PIN. Once Twitter determines that this PIN is correct, it sends
personalized authority tokens back to the application. These tokens can be
stored inside the application so that the user doesn't have to go through
the authorization process again. With the tokens, the application can post
tweets to the user's Twitter account.
The authorization process and sending tweets from a Unity application are
examined in the next workshop.
Search Nedrilad ::




Custom Search