mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 12:11:05 -05:00
Only update appcache once fetch-tweets.sh is done! (duh)
This commit is contained in:
@@ -13,6 +13,7 @@ if(empty($id)) {
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Fetching tweets of <?php echo $id; ?></title>
|
<title>Fetching tweets of <?php echo $id; ?></title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link href="/style.css" rel="stylesheet">
|
<link href="/style.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -36,10 +37,14 @@ echo "<a href=\"/u/$id/\"><h1 class=\"alert alert-success\">Goto http://$HTTP_HO
|
|||||||
echo "<a href=\"/u/$id/\"><h1 class=\"alert alert-success\">Goto http://$id.$HTTP_HOST to grep!</h1></a>";
|
echo "<a href=\"/u/$id/\"><h1 class=\"alert alert-success\">Goto http://$id.$HTTP_HOST to grep!</h1></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo `sed -e "s,TIMESTAMP,$(date)," ../../greptweet.appcache > greptweet.appcache`;
|
|
||||||
|
|
||||||
$logfile = "fetch-" . time() . ".log";
|
$logfile = "fetch-" . time() . ".log";
|
||||||
exec(sprintf("../../fetch-tweets.sh %s > %s 2>&1 &", $id, $logfile));
|
|
||||||
|
// 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 {} \; &`;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<p>Fetching tweets can take time! And it's limited by Twitter to 3200 maximum at any one time. Please view the <a href=/u/<?php echo "$id/$logfile";?>>logfile</a> to see its progress.</p>
|
<p>Fetching tweets can take time! And it's limited by Twitter to 3200 maximum at any one time. Please view the <a href=/u/<?php echo "$id/$logfile";?>>logfile</a> to see its progress.</p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user