Skip to content

Instantly share code, notes, and snippets.

@mgng
Created July 22, 2010 08:58
Show Gist options
  • Save mgng/485748 to your computer and use it in GitHub Desktop.
Save mgng/485748 to your computer and use it in GitHub Desktop.
稲川さんの怪談抜き出すやつ
<?php
// inagawaさんの会談抜き出すやつ
$url = 'http://twitter.com/statuses/user_timeline/83834401.json?count=200';
$src = @file_get_contents($url);
if ($src === false) {
exit("{$url} read error");
}
$json = json_decode($src);
if ($json === null) {
exit("json decode error");
}
$list = array();
$check = '#kaidan8';
foreach($json as $row) {
if (strpos($row->text, $check) !== false) {
$list[] = trim(str_replace($check,'',$row->text));
}
}
krsort($list);
foreach($list as $row) {
echo $row , PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment