本文整理匯總了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);
}
}
}
示例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)) {