You requested an answer from me on Twitter, so here I go.
1. "The XML page cannot be displayed" sounds like an error which your
webbrowser gives, definitely not the Twitter API.
2. If you use PHP, you should use JSON, not XML.
3. The code you provided is completely useless if I want to answer your
question.
4. You might want to use @abraham's TwitterOAuth class instead of
writing your own OAuth/cURL code. https://github.com/abraham/twitteroauth
5. You might like to set $resource before using it.
Tom
On 6/10/11 7:47 PM, Randomness wrote:
I just created some php code to retweet a tweet that meets certain
criteria. The code executes fine from one webserver when called from a
browser on my vista laptop. The same webpage gives an error mesage on
anoher XP machine like this:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Only one top level element is allowed in an XML document. Error
processing resource
When called from another webserver (and any machine) I get the
following error message:
Request Entity Too Large
The requested resource....does not allow request data with POST
requests, or the amount of data provided in the request exceeds the
capacity limit
I suspect it has something to do with the Curl libraries but I can't
figure out what needs to be corrected. The Curl code looks like this
after all base and header stuff is done:
$_h = array('Expect:');
$_h[] = substr($header, 0);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $resource);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $_h);
$result = curl_exec($curl);
$resultArray = curl_getinfo($curl);
curl_close($curl);
$resource='http://api.twitter.com/1/statuses/retweet/'.
$thistweet.'.xml';
I am really stuck here and would appreciate some help
--
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
https://groups.google.com/forum/#!forum/twitter-development-talk