當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TwitterOAuth::http方法代碼示例

本文整理匯總了PHP中TwitterOAuth::http方法的典型用法代碼示例。如果您正苦於以下問題:PHP TwitterOAuth::http方法的具體用法?PHP TwitterOAuth::http怎麽用?PHP TwitterOAuth::http使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TwitterOAuth的用法示例。


在下文中一共展示了TwitterOAuth::http方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testSearchResults

 public function testSearchResults()
 {
     global $THINKUP_CFG;
     $to = new TwitterOAuth('', '', '', '');
     $twitter_data = $to->http('http://search.twitter.com/search.json?q=%40whitehouse&result_type=recent');
     $api = new CrawlerTwitterAPIAccessorOAuth('111', '222', 1234, 1234, $this->getTestInstance(), 3200);
     $results = $api->parseJSON($twitter_data);
     //print_r($results);
     $this->assertEqual($results[0]['post_id'], 11837318124);
 }
開發者ID:rayyan,項目名稱:ThinkUp,代碼行數:10,代碼來源:TestOfTwitterAPIAccessorOAuth.php

示例2: testParseError

 public function testParseError()
 {
     $to = new TwitterOAuth('', '', '', '');
     //Public statuses
     $twitter_data = $to->http('https://twitter.com/statuses/user_timeline/ginatrasdfasdfasdapani.xml?count=100');
     $api = new CrawlerTwitterAPIAccessorOAuth('111', '222', 1234, 1234, 5, 3200, 5, 350);
     $results = $api->parseError($twitter_data);
     $this->debug(Utils::varDumpToString($results));
     $this->assertEqual($results['error'], 'Not found');
     $this->assertEqual($results['request'], '/statuses/user_timeline/ginatrasdfasdfasdapani.xml?count=100');
 }
開發者ID:ravi-modria,項目名稱:ThinkUp,代碼行數:11,代碼來源:TestOfTwitterAPIAccessorOAuth.php

示例3: testParseXMLStatusesPublic

 public function testParseXMLStatusesPublic()
 {
     $to = new TwitterOAuth('', '', '', '');
     //Public statuses
     $twitter_data = $to->http('https://twitter.com/statuses/user_timeline/ginatrapani.xml?count=100');
     $api = new CrawlerTwitterAPIAccessorOAuth('111', '222', 1234, 1234, 5, 3200, 5, 350);
     $results = $api->parseXML($twitter_data);
     $this->debug(Utils::varDumpToString($results));
     $this->assertEqual($results[0]['post_id'], '14846078418');
     $this->assertIsa($results[0]['is_protected'], 'int');
     $this->assertEqual($results[0]['is_protected'], 0);
 }
開發者ID:randi2kewl,項目名稱:ThinkUp,代碼行數:12,代碼來源:TestOfTwitterAPIAccessorOAuth.php

示例4: testSearchResults

 function testSearchResults()
 {
     global $THINKTANK_CFG;
     $r = array();
     $r["id"] = 0;
     $r['network_username'] = 'user';
     $r['network_user_id'] = 0;
     $r['network_viewer_id'] = 0;
     $r['last_status_id'] = 0;
     $r['last_page_fetched_replies'] = 0;
     $r['last_page_fetched_tweets'] = 0;
     $r['total_posts_in_system'] = 0;
     $r['total_replies_in_system'] = 0;
     $r['total_follows_in_system'] = 0;
     $r['total_users_in_system'] = 0;
     $r['is_archive_loaded_replies'] = 0;
     $r['is_archive_loaded_follows'] = 0;
     $r['crawler_last_run'] = '1/1/2007';
     $r['earliest_reply_in_system'] = 0;
     $r['api_calls_to_leave_unmade_per_minute'] = 5;
     $r['avg_replies_per_day'] = 0;
     $r['is_public'] = 1;
     $r['is_active'] = 1;
     $r['network'] = 'twitter';
     $i = new Instance($r);
     $to = new TwitterOAuth('', '', '', '');
     $twitter_data = $to->http('http://search.twitter.com/search.json?q=%40whitehouse&result_type=recent');
     $api = new CrawlerTwitterAPIAccessorOAuth('111', '222', $THINKTANK_CFG['oauth_consumer_key'], $THINKTANK_CFG['oauth_consumer_secret'], $i, $THINKTANK_CFG['archive_limit']);
     $results = $api->parseJSON($twitter_data);
     //print_r($results);
     $this->assertEqual($results[0]['post_id'], 11837318124.0);
 }
開發者ID:prop7,項目名稱:thinktank,代碼行數:32,代碼來源:TestOfTwitterAPIAccessorOAuth.php


注:本文中的TwitterOAuth::http方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。