Created
April 8, 2011 14:13
-
-
Save zooniverse/909912 to your computer and use it in GitHub Desktop.
Capture all of the tweets that have the word 'bieber' in them and save them to a file
This file contains 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 | |
$fp = fopen("http://USERNAME:[email protected]/1/statuses/filter.json?track=bieber","r"); | |
while($data = fgets($fp)) | |
{ | |
$time = date("YmdH"); | |
if ($newTime!=$time) | |
{ | |
@fclose($fp2); | |
$fp2 = fopen("{$time}.txt","a"); | |
} | |
fputs($fp2,$data); | |
$newTime = $time; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment