[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-25 Thread Mark McBride
Issue 1: You don't want to encode the ampersands in line 12... they're valid (and required) characters in URIs. Switch those back to just & and you should get 200 responses. Issue 2: it looks like you want trends, however you're calling the search results URL. This will return a JSON object tha

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-25 Thread Michael Steuer
You're getting 403 errors from Twitter. You're being rate limited because you're not passing a user agent. From the search API wiki: Applications must have a meaningful and unique User Agent when using this method. A HTTP Referrer is expected but not required. Search traffic that does not i

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-25 Thread EastSideDev
For what it's worth (if it helps debug the problem), my code was working just fine, until about two weeks ago, and then the same piece of code, started returning the failed to open stream error. On Oct 25, 10:20 am, TrixJo wrote: > I have used the ampersand which is displayed in my code here: >

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-25 Thread TrixJo
I have used the ampersand which is displayed in my code here: http://pastebin.com/m51f7a9dd are there any other takers who can give me advice on why I get the errors: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden On Oct 24, 1:23 pm, Mark Mcbride wrote: > If you're emb

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-25 Thread EastSideDev
I am having similar problems using file_get_contents, with certain API calls, and JSON, but it works fine with other API calls. On Oct 24, 10:11 am, TrixJo wrote: > Hello > > I am trying to search twitter content using a mySQL/PHP entry in a > table: > > $contents = file_get_contents( >        

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-24 Thread Mark Mcbride
If you're embedding that URL in XML you will need to XML encode it... In this specific case the ampersand (&q=...) needs to be replaced with & Sent from mobile device On Oct 24, 2009, at 10:19 AM, JDG wrote: > You sure that's where the error is? there have been numerous > reported problem

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-24 Thread TrixJo
Ok. Thanks. I changed it to & Still now working. I am trying to query Twitter content and then display my query in XML format. To get a better idea of what I am trying to do I have pastebin'd the code: http://pastebin.com/m51f7a9dd The error I am getting is that my file_get_contents() is fa

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-24 Thread JDG
OH. I see what you're saying now. Again, the problem isn't with "indonesia" ... it's the fact that you're putting "&" in an xml tag. You need to change it to "&" On Sat, Oct 24, 2009 at 11:55, TrixJo wrote: > > JDG, > > I am certain that is where the error is coming from because the error > supp

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-24 Thread TrixJo
JDG, I am certain that is where the error is coming from because the error supplied by the browser is pointing at my query string Dewald, I am processing the data via JSON into an array I then take that array and simply echo the relevant errors into XML format (because I have other queries fo

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-24 Thread Dewald Pretorius
Isn't it because you are trying to process a JSON object as XML data? Dewald On Oct 24, 2:11 pm, TrixJo wrote: > Hello > > I am trying to search twitter content using a mySQL/PHP entry in a > table: > > $contents = file_get_contents( >                     "http://search.twitter.com/search.json?

[twitter-dev] Re: XML parsing error when using JSON search.twitter.com/search.json?

2009-10-24 Thread JDG
You sure that's where the error is? there have been numerous reported problems with PHP's JSON decoder that it doesn't handle the very large numbers of Twitter's IDs well. On Sat, Oct 24, 2009 at 11:11, TrixJo wrote: > > Hello > > I am trying to search twitter content using a mySQL/PHP entry in