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


PHP Twitter::getMentionsReplies方法代碼示例

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


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

示例1: execute

 protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'])->getConnection();
     $t = new Twitter(sfConfig::get('twitter_username'), sfConfig::get('twitter_password'));
     $last_message = RawMessagePeer::getLastMessage($connection);
     $since = null;
     if ($last_message) {
         $since = $last_message->getMessageId();
     }
     $messages = $t->getMentionsReplies($since);
     foreach ($messages as $message) {
         $rawmessage = RawMessagePeer::saveMessage($message, $connection);
         if ($rawmessage instanceof RawMessage) {
             $need = NeedPeer::convertMessage($rawmessage, $con);
         } else {
             var_dump($rawmessage);
         }
     }
 }
開發者ID:pascaldevink,項目名稱:twneed,代碼行數:21,代碼來源:twneedHarvestMessagesTask.class.php

示例2: parsePics

(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once 'twitter.php';
require_once 'function.resize.php';
require_once 'snoopy.class.php';
require_once 'htmlsql.class.php';
/**
 * 1. Get and cache mentions
 * 2. Parse twitpics
 * 3. Get images and crop
 */
// Instantiate Twitter class
$twitter = new Twitter('<username>', '<password>');
// Get all tweets @hunt_and_gather
$tweets = $twitter->getMentionsReplies();
// Instantiate HTMLSql
$wsql = new htmlsql();
// Path to log file
$cacheFile = 'cache/pics.log';
// Refresh always for now
$cacheMinutes = 0;
// Open log file
$fh = fopen($cacheFile, 'a') or die("can't open file");
function parsePics($tweets)
{
    $picUrls = array();
    $twitpicPattern = '%(http://twitpic\\.com/\\w+)%i';
    $yfrogPattern = '%(http://yfrog\\.com/\\w+)%i';
    foreach ($tweets as $tweet) {
        if (preg_match($twitpicPattern, $tweet['text'], $matches) || preg_match($yfrogPattern, $tweet['text'], $matches)) {
開發者ID:jkochis,項目名稱:scwape,代碼行數:31,代碼來源:scwape.php


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