Note that there are some explanatory texts on larger screens.

plurals
  1. POGot error using Twitter Search in PHP
    primarykey
    data
    text
    <p>While searching on Twitter using PHP after searching 2 or 3 I got error of you have been rate limited.enhance your calm in PHP</p> <pre><code> function twitter_class() { $this-&gt;realNamePattern = '/\((.*?)\)/'; $this-&gt;intervalNames = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year'); $this-&gt;intervalSeconds = array( 1, 60, 3600, 86400, 604800, 2630880, 31570560); $this-&gt;badWords = array('somebadword', 'anotherbadword'); } function searchURL($language, $query) { $func_args=func_get_args(); $vars = array_map('urlencode', $func_args + array('', '')); return vsprintf('http://search.twitter.com/search.atom?lang=%s&amp;q=%s', $vars); } function getTweets($q,$lang, $limit=15) { $output = ''; // get the seach result $ch = curl_init($this-&gt;searchURL($lang, $q)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); $response = curl_exec($ch); if ($response !== FALSE) { $xml = simplexml_load_string($response); $output = ''; $tweets = 0; for($i=0; $i&lt;count($xml-&gt;entry); $i++) { $crtEntry = $xml-&gt;entry[$i]; $account = $crtEntry-&gt;author-&gt;uri; $image = $crtEntry-&gt;link[1]-&gt;attributes()-&gt;href; $tweet = $crtEntry-&gt;content; // skip tweets containing banned words $foundBadWord = false; foreach ($this-&gt;badWords as $badWord) { if(stristr($tweet, $badWord) !== FALSE) { $foundBadWord = true; break; } } $tweet = str_replace('&lt;a href=', '&lt;a target="_blank" href=', $tweet); // skip this tweet containing a banned word if ($foundBadWord) continue; // don't process any more tweets if at the limit if ($tweets==$limit) break; $tweets++; // name is in this format "acountname (Real Name)" preg_match($this-&gt;realNamePattern, $crtEntry-&gt;author-&gt;name, $matches); $name = $matches[1]; // get the time passed between now and the time of tweet, don't allow for negative // (future) values that may have occured if server time is wrong $time = 'just now'; $secondsPassed = time() - strtotime($crtEntry-&gt;published); if ($secondsPassed&gt;0) { // see what interval are we in for($j = count($this-&gt;intervalSeconds)-1; ($j &gt;= 0); $j--) { $crtIntervalName = $this-&gt;intervalNames[$j]; $crtInterval = $this-&gt;intervalSeconds[$j]; if ($secondsPassed &gt;= $crtInterval) { $value = floor($secondsPassed / $crtInterval); if ($value &gt; 1) $crtIntervalName .= 's'; $time = $value . ' ' . $crtIntervalName . ' ago'; break; } } } </code></pre> <p>Here is my code please have a look on it and find exact solution what i am laging</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload