第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用推特資產(chǎn)交換按日期搜索推文

使用推特資產(chǎn)交換按日期搜索推文

PHP
慕娘9325324 2022-09-30 16:20:42
我正在嘗試使用推特apiexchange包裝器搜索給定日期范圍內(nèi)的推文。這是我的代碼require_once('TwitterAPIExchange.php');$settings = array('oauth_access_token' => "xx",'oauth_access_token_secret' => "xx",'consumer_key' => "xx",'consumer_secret' => "xx");$url = "https://api.twitter.com/1.1/search/tweets.json";$requestMethod = "GET"$getfield = "?q=from:manutd&until:2018-01-20&since:2018-01-01";$twitter = new TwitterAPIExchange($settings);$string = json_decode($twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest(),$assoc = TRUE);if(array_key_exists("errors", $string)) {echo "<h3>Sorry, there was a problem.</h3>   <p>Twitter returned the following error message:</p><p><em>".$string[errors][0]   ["message"]."</em></p>";exit();}  foreach($string as $items)  {    echo "Time and Date of Tweet: ".$items['created_at']."<br />";    echo "Tweet: ". $items['full_text']."<br />";    echo "Tweeted by: ". $items['user']['name']."<br />";    echo "Screen name: ". $items['user']['screen_name']."<br />";    echo "Followers: ". $items['user']['followers_count']."<br />";    echo "Friends: ". $items['user']['friends_count']."<br />";    echo "Listed: ". $items['user']['listed_count']."<br /><hr />";   }這將返回來(lái)自指定用戶(hù)的最新推文,日期字段似乎被忽略。是否可以使用 API 按日期搜索?
查看完整描述

1 回答

?
哈士奇WWW

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超6個(gè)贊

搜索 API 支持此功能,但您必須像這樣組合查詢(xún):

https://api.twitter.com/1.1/search/tweets.json?q=from%3Atwitterdev&result_type=mixed&count=2

參考:https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets

上面的查詢(xún)字符串是以下網(wǎng)址編碼形式:

所以你會(huì)通過(guò)像

https://api.twitter.com/1.1/search/tweets.json?q=%3Afrom:manutd&until:2018-01-20&since:2018-01-01

搜索運(yùn)算符列表可在此處找到。


查看完整回答
反對(duì) 回復(fù) 2022-09-30
  • 1 回答
  • 0 關(guān)注
  • 139 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)