mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 04:01:06 -05:00
Mostly working :) ~900mb to ~90mb
This commit is contained in:
@@ -10,8 +10,8 @@ else
|
|||||||
mkdir lock
|
mkdir lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
temp=$(mktemp "$1.XXXX")
|
temp=$(mktemp)
|
||||||
temp2=$(mktemp "$1.XXXX")
|
temp2=$(mktemp)
|
||||||
|
|
||||||
trap 'rm -vrf "${temp}" "${temp2}" lock' EXIT
|
trap 'rm -vrf "${temp}" "${temp2}" lock' EXIT
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ then
|
|||||||
test "$2" && since='&max_id='$(tail -n1 "$1.txt" | cut -d'|' -f1) # use max_id to get older tweets
|
test "$2" && since='&max_id='$(tail -n1 "$1.txt" | cut -d'|' -f1) # use max_id to get older tweets
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while urlargs="screen_name=${1}&count=200&page=${page}${since}&include_rts=1&trim_user=0"; echo "$urlargs"; "$(dirname "$0")"/oauth.php "$urlargs" |
|
while urlargs="screen_name=${1}&count=200&page=${page}${since}&include_rts=1&trim_user=0"; echo "$urlargs"; /srv/http/oauth.php "$urlargs" |
|
||||||
"$(dirname "$0")"/json-to-text.php > "$temp2"; test "$(wc -l < "$temp2")" -gt 0;
|
/srv/http/json-to-text.php > "$temp2"; test "$(wc -l < "$temp2")" -gt 0;
|
||||||
do
|
do
|
||||||
|
|
||||||
#cat temp2
|
#cat temp2
|
||||||
@@ -66,5 +66,4 @@ echo "$1" saved "$saved" tweets
|
|||||||
|
|
||||||
test -L "$1.txt.gz" && rm "$1.txt.gz"
|
test -L "$1.txt.gz" && rm "$1.txt.gz"
|
||||||
gzip -v "$1.txt"
|
gzip -v "$1.txt"
|
||||||
ln -sfv "$1.txt.gz" tweets.txt.gz
|
ln -sfv "$1.txt.gz" tweets.txt
|
||||||
stat -L tweets.txt 2>/dev/null || rm -f tweets.txt
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ $QUERY=escapeshellarg($_GET['q']);
|
|||||||
//fwrite($fp, $_GET['q'] . " : " . $QUERY . "\n");
|
//fwrite($fp, $_GET['q'] . " : " . $QUERY . "\n");
|
||||||
//fclose($fp);
|
//fclose($fp);
|
||||||
|
|
||||||
exec("zgrep -Fhi $QUERY tweets.txt", $array);
|
exec("gunzip -c tweets.txt | grep -Fhi $QUERY", $array);
|
||||||
$data = json_encode($array);
|
$data = json_encode($array);
|
||||||
echo $_GET['jsoncallback'] . '(' . $data . ');';
|
echo $_GET['jsoncallback'] . '(' . $data . ');';
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user