# HG changeset patch # User ymh # Date 1537708825 -7200 # Node ID b5098fdacc60bd06692663e86dd812bf56e11682 # Parent a8f1006005c783cba2898c52099273ee000b0ba1 Additionnal corrections for extended mode diff -r a8f1006005c7 -r b5098fdacc60 web/res/js/live-polemic.js --- a/web/res/js/live-polemic.js Sun Sep 23 14:13:29 2018 +0200 +++ b/web/res/js/live-polemic.js Sun Sep 23 15:20:25 2018 +0200 @@ -139,11 +139,20 @@ options.pages || (options.pages = 1); options.rpp || (options.rpp = 100); options.currentPage = 0; - var baseurl = "search_tweets.php", - firstparams = "?q=" + encodeURIComponent(options.keyword)+ "&count=" + options.rpp - + (options.lang ? "&lang=" + options.lang : '' ), - lastparams = (options.since_id ? "&since_id=" + options.since_id : '' ), - jsonurl = baseurl + firstparams + lastparams; + + var urlParams = { + tweet_mode: 'extended', + q: options.keyword, + count: options.rpp + }; + if ( options.lang ) { + urlParams.lang = options.lang; + } + if ( options.since_id ) { + urlParams.since_id = options.since_id; + } + + var jsonurl = "search_tweets.php?"+$.param(urlParams); getTweetUrl(jsonurl); } diff -r a8f1006005c7 -r b5098fdacc60 web/search_tweets.php --- a/web/search_tweets.php Sun Sep 23 14:13:29 2018 +0200 +++ b/web/search_tweets.php Sun Sep 23 15:20:25 2018 +0200 @@ -31,11 +31,9 @@ $token = unserialize($_SESSION['TWITTER_ACCESS_TOKEN']); $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $token['oauth_token'], $token['oauth_token_secret']); - $parameters = array_merge([ - 'tweet_mode' => 'extended' - ], $_GET ? $_GET : []); - $statuses = $connection->get("search/tweets", $parameters); + // $statuses = $connection->get("search/tweets", $parameters); + $statuses = $connection->get("search/tweets", $_GET); // $client = $token->getHttpClient($configuration); // $client->setUri("https://api.twitter.com/1.1/$endpoint.json"); // $client->setMethod(Zend_Http_Client::GET);