mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-22 04:51:05 -05:00
first commit
This commit is contained in:
10
grep.php
Normal file
10
grep.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?
|
||||
if (empty($_GET['q'])) { die(); }
|
||||
$QUERY=urldecode(escapeshellarg(urlencode($_GET['q'])));
|
||||
//$fp = fopen('debug.log', 'a');
|
||||
//fwrite($fp, $_GET['q'] . " : " . $QUERY . "\n");
|
||||
//fclose($fp);
|
||||
exec("grep -hi $QUERY *.txt", $array);
|
||||
$data = json_encode($array);
|
||||
echo $_GET['jsoncallback'] . '(' . $data . ');';
|
||||
?>
|
||||
Reference in New Issue
Block a user