themattharris/tmhOAuth — Issue #30: ERROR: You must enter a query
Author: isilion
Created: 2012-02-29 17:01:31+00:00
State: open

Hi Matt.

Im trying to program a simple retwitter bot (basically).

I started making it with twitterOAuth library, and then changed to yours because its capable of more things. The error i got this time is in search( ); function, while trying to perform any search, 'pages' value is not correctly set (I think). This is what var_dump($_POST) and vardump($args) say:

array(6) { ["search"]=> string(25) "#LlamadmeRebeldeSiQuereis" ["selection"]=> string(15) "rt_with_mention" ["string"]=> string(13) "@ManuAlpuente" ["ckey"]=> string(0) "" ["csec"]=> string(0) "" ["ammount"]=> string(1) "5" } array(5) { ["q"]=> string(25) "#LlamadmeRebeldeSiQuereis" ["since_id"]=> string(1) "0" ["pages"]=> string(1) "1" ["rpp"]=> string(1) "5" ["lang"]=> string(2) "es" }

#LlamadmeRebeldeSiQuereis: 0: 1: 5: es: array(1) { ["page"]=> int(1) } Received page 0 http://search.twitter.com/search.json?page=1 There was an error. string(55) "{"error":"You must enter a query."}"

So arg['$pages'] should be a string. I found issue #17 and fixed its value to $pages = '0', but no result (same error). Here is the full code (functions are examples of yours).

######
CODE: http://pastebin.com/H58cRHVa