Skip to content

Instantly share code, notes, and snippets.

@maeharin
Created April 20, 2012 03:13
Show Gist options
  • Save maeharin/2425636 to your computer and use it in GitHub Desktop.
Save maeharin/2425636 to your computer and use it in GitHub Desktop.
view twitter time line at command line (witten by php)
#!/usr/local/bin/php
<?php
$user_id = $argv[1];
if ($user_id) {
$url = 'https://twitter.com/statuses/user_timeline.json?id=' . $user_id;
$tweet = file_get_contents($url);
$tweet = json_decode($tweet);
foreach($tweet as $v) {
echo $v->text . "\n";
}
} else {
echo "please enter argv \n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment