mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 12:11:05 -05:00
Offline first
http://natalian.org/archives/2012/07/16/navigator.onLine/
This commit is contained in:
16
grep.php
16
grep.php
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
header('Content-type: application/json');
|
||||
if (empty($_GET['q'])) { die(); }
|
||||
|
||||
// Is this the correct way to sanitise args to shell from PHP?
|
||||
$QUERY=urldecode(escapeshellarg(urlencode($_GET['q'])));
|
||||
|
||||
// Debug Logging
|
||||
//$fp = fopen('debug.log', 'a');
|
||||
//fwrite($fp, $_GET['q'] . " : " . $QUERY . "\n");
|
||||
//fclose($fp);
|
||||
|
||||
exec("grep -hi $QUERY tweets.txt", $array);
|
||||
$data = json_encode($array);
|
||||
echo $_GET['jsoncallback'] . '(' . $data . ');';
|
||||
?>
|
||||
Reference in New Issue
Block a user