Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter Search API and $_POST max_id parameter
    primarykey
    data
    text
    <p>I'm using this twitter.class script to get some tweets limited by a <strong>max_id</strong> parameter:</p> <pre><code>&lt;?php $max_id = $_POST['max_id']; class Twitter { public function __construct(){ } public function searchResults( $search = null ) { $url = "http://search.twitter.com/search.atom?q=" . urlencode( $search ) . "&amp;result_type=recent&amp;rpp=4&amp;max_id=" . $max_id; $curl = curl_init(); curl_setopt( $curl, CURLOPT_URL, $url ); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 ); $result = curl_exec( $curl ); curl_close( $curl ); $return = new SimpleXMLElement( $result ); return $return; } public function echok() { echo $this-&gt;max_id; } } ?&gt; </code></pre> <p><strong>This script is required_once</strong> by another (test.class.php) that launch a loop and echoes the tweets.<br><br> I want to dinamically load 'max_id' depending on the tweets already loaded in page. I get the last 'id' with jQuery and then POST it<br><br></p> <p>I tried to post this variable by jQuery Ajax, and only when finished, load the other scipr to get the tweets. Like this:</p> <pre><code>var max_id_pre = $('.ids:last').text(); var max_id = 'max_id=' + max_id_pre; $.ajax({ url: "twitter.class.php", data: max_id, type: "POST", success: function(){ $('#container').load("test.class.php"); } }); </code></pre> <p>Is not working since twitter.clas.php is not getting 'max_id' variable, BEFORE being required by test.class.php to stamp the tweets. <br><br> I know I'm trying to post a variable to a class, is it possible?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    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.
    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