how to work with twitter if the xml feed is deprecated?
Hi,
some time ago I downloaded and modified this code so that my most recent tweet could be displayed in flash:http://www.republicofcode.com/tutori...witter_widget/
However, it seems like http://twitter.com/statuses/user_tim...=my_screenName no longer contains any data---XML or otherwise.
How is this accomplished now? Do you have to use oAuth or a proxy.php file? I couldn't get the latter to function or find a good tutorial on the former.
Any help would be greatly appreciated.
function processXML(e:Event):void {
var myXML:XML=new XML(e.target.data);
trace(myXML.channel.item[0].title);
if (oldTweet!=(myXML.channel.item[0].title)) {
containerTweets.ctext.tweet_1.text=myXML.channel.item[0].title;
oldTweet=myXML.channel.item[0].title;
trace(oldTweet,"oldTweet");
tweet();
}
However, it only works locally--There is a commented out line in the original code:
Code:
myXMLLoader.load(new URLRequest("proxy.php"));
which I removed the commenting from and commented out the following line:
but, the proxy.php file which looks like this:
<?php
echo file_get_contents("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=myusername");
?>
isnt returning the XML---I have a crossdomain.xml file too, which looks like this:
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="mysite.com" />
<allow-access-from domain="www.twitter.com" />
<allow-access-from domain="twitter.com" />
</cross-domain-policy>
but that doesnt help.
function processXML(e:Event):void {
var myXML:XML=new XML(e.target.data);
trace(myXML.channel.item[0].title);
if (oldTweet!=(myXML.channel.item[0].title)) {
containerTweets.ctext.tweet_1.text=myXML.channel.item[0].title;
oldTweet=myXML.channel.item[0].title;
trace(oldTweet,"oldTweet");
tweet();
}
However, it only works locally--There is a commented out line in the original code:
Code:
myXMLLoader.load(new URLRequest("proxy.php"));
which I removed the commenting from and commented out the following line:
but, the proxy.php file which looks like this:
<?php
echo file_get_contents("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=myusername");
?>
isnt returning the XML---I have a crossdomain.xml file too, which looks like this:
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="mysite.com" />
<allow-access-from domain="www.twitter.com" />
<allow-access-from domain="twitter.com" />
</cross-domain-policy>
but that doesnt help.
function processXML(e:Event):void {
var myXML:XML=new XML(e.target.data);
trace(myXML.channel.item[0].title);
if (oldTweet!=(myXML.channel.item[0].title)) {
containerTweets.ctext.tweet_1.text=myXML.channel.item[0].title;
oldTweet=myXML.channel.item[0].title;
trace(oldTweet,"oldTweet");
tweet();
}
However, it only works locally--There is a commented out line in the original code:
Code:
myXMLLoader.load(new URLRequest("proxy.php"));
which I removed the commenting from and commented out the following line:
Still doesnt work.
If I go to the twitter.php on my site--http://mysite/twitter.php-
it returns this:
/statuses/user_timeline.xml?screen_name=myname Rate limit exceeded. Clients may not make more than 150 requests per hour