Attempting to update $id";
} else {
if (!mkdir("u/$id", 0777, true)) {
die("Failed to create u/$id directory.");
}
}
chdir("u/$id");
symlink ("../../index.html", "index.html");
symlink ("../../grep.php", "grep.php");
if (strpos($id, '_') !== false) {
echo "Goto http://$HTTP_HOST/u/$id to grep!
";
} else {
echo "Goto http://$id.$HTTP_HOST to grep!
";
}
$logfile = "fetch-" . time() . ".log";
// Only update Appcache file once we are done with the fetch
exec(sprintf("../../fetch-tweets.sh %s > %s 2>&1 && sed -e 's,TIMESTAMP,%s,' ../../greptweet.appcache > greptweet.appcache &", $id, $logfile, date("c")));
// Remove logs older than a day
`find -name '*.log' -mtime +1 -exec rm {} \; &`;
?>
Fetching tweets can take time! And it's limited by Twitter to 3200 maximum at any one time. Please view the >logfile to see its progress.