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 include a User Agent will be rate limited to fewer API calls per hour than applications including a User Agent string. Try using curl instead of file_get_contents to set a meaningful user agent....

On Oct 25, 2009, at 10:20 AM, TrixJo <> wrote:

I have used the ampersand which is displayed in my code here:

are there any other takers who can give me advice on why I get the

failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

On Oct 24, 1:23 pm, Mark Mcbride <> wrote:
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 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:


I am trying to search twitter content using a mySQL/PHP entry in a

$contents = file_get_contents(

$json = json_decode($contents);

I am returning the results via AJAX as an XML file

The problem that I get is:

XML Parsing Error: not well-formed
Line Number 77, Column 44:    [refresh_url] => ?

where "Indonesia" happens to be the value of $row[topicTitle]

The problem is with the value of $row[topicTitle]  -- doesn't matter
if the term is "Indonesia" or any other word or phrase (I tried a
bunch) -- I keep getting that XML error

I also tried enclosing it with single quotes, same error

help please?

Internets. Serious business.

Reply via email to