Sponsored By

Newsletter #58 - Cross-Site AJAX

Loradon 3.0 Preview progress update, development of a new site, cross-site AJAX, new sketches, and more.

Michael Grand, Blogger

January 8, 2010

3 Min Read


News

Overall progress for the Loradon 3.0 Preview has reached 98%!
www.ifthensoftware.net/loradon_online/progress/


From the Programmer
Written by Invisible

I spent most of the past week brushing up on my HTML/CSS/javascript knowledge since we are working on a new site for IfThen Software. The site will use our Facebook page and my Twitter account as news sources, rather than have its own. However, while the widget provided by Twitter can be customized, the Facebook widget is fairly static. After testing the site, we decided that the widgets made it look ugly, so I started researching ways to get the Twitter and Facebook status without using their widgets.

Twitter provides an easy way to do this; visiting the address http://twitter.com/statuses/user_timeline/<name>.xml returns an xml document which includes all of the information for each status update (up to a max). Using XMLHttpRequest (a core part of AJAX) I can visit that site and parse the xml that it returns, displaying it in whatever format we need it in.

After unsuccessfully trying to find a similar link for Facebook, I started looking into alternatives such as parsing the Facebook page itself for the status. Doing so would not have been pretty. Luckily for me, johnhattan of #gamedev on AfterNet pointed out that the page has an RSS feed which I could use just as easily as the Twitter link.

Thus armed, I started work on the actual code to download and parse the xml returned by those two links. XMLHttpRequest makes this a very simple task; you just tell it where the page is, then wait for it to return the result. However, no matter what I tried, it kept returning a status code of 0 (200 means success, 0 means it didn't even get to the point where it could return a failure code). After looking around the internet for a solution, I finally found the cause; apparently the browser does not allow you to access a remote site using XMLHttpRequest. With this information in mind, I created a simple php script which accesses the Twitter/Facebook XML document and returns it. As far as the browser is concerned, it is connecting to the same website.


Artist's Easel
Written by GreyKnight

iScribble Sketches #16

(Click to enlarge)

(Click to enlarge)


Community Spotlight
Written by Jay

Just a week ago RageMan1990 decided to quit SAO and give his account information to the public. This came as quite a shock to the community because of his high level and seemingly great interest in the game. RageMan1990 will be missed by some, and disregarded by others.

Last week, InvisibleMan released information that a new ITS website is in the making. Many players and loyal fans had many questions about what the new site would look like, but to no avail; they were told to wait until it's released. We will do just that; and we look forward to the amazing new look.

Read more about:

2010Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like