Created
July 22, 2010 08:58
-
-
Save mgng/485748 to your computer and use it in GitHub Desktop.
稲川さんの怪談抜き出すやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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