本文整理汇总了PHP中Api::followersIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::followersIds方法的具体用法?PHP Api::followersIds怎么用?PHP Api::followersIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::followersIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
protected function fire(InputInterface $input, OutputInterface $output)
{
$usernames = $input->getArgument('usernames');
$api = new Api();
foreach ($usernames as $username) {
$followers = $api->followersIds($username);
$followings = $api->followingsIds($username);
$this->db->relationships->insert(array('username' => $username, 'time' => new MongoDate(), 'followers' => $followers, 'followings' => $followings));
if (!$output->isQuiet()) {
$this->info(sprintf("Synced %s:\t Following %s\t Followers %s", $username, count($followings), count($followers)));
}
}
}
示例2: fire
protected function fire(InputInterface $input, OutputInterface $output)
{
$usernames = $input->getArgument('usernames');
$api = new Api();
$merged = [];
foreach ($usernames as $username) {
$followers = $api->followersIds($username);
dump('data/followers-' . $username . '.json', $followers);
foreach ($followers as $f) {
$merged[] = [$f, $username];
}
}
$tmpFilename = sprintf('merged-%s', date('Ymd-His'));
dump('data/' . $tmpFilename, $merged);
$md5 = md5_file(app_path('data/' . $tmpFilename));
rename(app_path('data/' . $tmpFilename), app_path('data/' . $tmpFilename . '-' . $md5 . '.json'));
}