Twitter自动跟踪PHP脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Twitter自动跟踪PHP脚本相关的知识,希望对你有一定的参考价值。
Simple php script which allows you to specify your twitter log in details and a search term, then automatically follow users who have tweeted that term. Code is released as Open Source, use it as you wish - please leave my URL in the commented section though.
<?php // Twitter Auto-follow Script by Dave Stevens - http://davestevens.co.uk // Set the twitter user $user = ""; $pass = ""; // Set the term you want to follow (e.g. "soccer") $term = ""; // Get already followed $userApiUrl = "http://twitter.com/statuses/friends.json"; if ($apiresponse) { if ($json != null) { foreach ($json as $u) { $followed[] = $u->name; } } } $userApiUrl = "http://search.twitter.com/search.json?q=" . $term . "&rpp=100"; if ($apiresponse) { $count = 20; if ($results != null) { $resultsArr = $results->results; foreach ($resultsArr as $result) { $from_user = $result->from_user; if ($apiresponse) { if ($response != null) { if (property_exists($response,"following")) { if ($response->following === true) { echo "Now following " . $response->screen_name . " "; } else { echo "Couldn't follow " . $response->screen_name . " "; } } else { echo "Follow limit exceeded, skipped " . $from_user . " "; } } } } else { echo "Already following " . $from_user . " "; } } } } } ?>
以上是关于Twitter自动跟踪PHP脚本的主要内容,如果未能解决你的问题,请参考以下文章
php 一个短代码片段准备在WooCommerce Thank You页面上输出货件跟踪UI。
PHP 搜索引擎排名跟踪器 - RankTrackr访问片段
php Wordpress functions.php片段使用Yoast的插件将Google Analytics跟踪添加到wp_nav_menu