mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 04:01:06 -05:00
cleanups
This commit is contained in:
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT/X Consortium License
|
||||
|
||||
© 2011 Kai Hendry <hendry@iki.fi>
|
||||
© 2011-2012 Kai Hendry <hendry@iki.fi>
|
||||
Contributors to https://github.com/kaihendry/Greptweet
|
||||
Jamie Kitson <jamie@kitten-x.com>
|
||||
Pádraig Brady <http://www.pixelbeat.org>
|
||||
|
||||
1
clean-up-locks.sh
Executable file
1
clean-up-locks.sh
Executable file
@@ -0,0 +1 @@
|
||||
find $(dirname $0) -name lock | xargs rm -f
|
||||
40
create.cgi
40
create.cgi
@@ -54,27 +54,11 @@ END
|
||||
|
||||
if test -d u/$id
|
||||
then
|
||||
|
||||
echo Directory $id already exists
|
||||
echo Attempting an update
|
||||
|
||||
cd u/$id
|
||||
|
||||
ln -sf ../../index.html || true
|
||||
ln -sf ../../grep.php || true
|
||||
|
||||
if ! test -f lock
|
||||
then
|
||||
touch lock # Bug here if tab is closed before it's finished
|
||||
../../fetch-tweets.sh $id $old
|
||||
rm lock # We need to also clear to lock if fetch-tweets was killed by Apache
|
||||
else
|
||||
echo Fetching already!
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
if curl -sI http://api.twitter.com/1/users/lookup.xml?screen_name=${id} | grep -q "Status: 404 Not Found"
|
||||
if curl -sI http://api.twitter.com/1/users/lookup.xml?screen_name=${id} |
|
||||
grep -q "Status: 404 Not Found"
|
||||
then
|
||||
echo "$id does not exist on twitter.com :("
|
||||
exit
|
||||
@@ -82,20 +66,22 @@ else
|
||||
|
||||
echo Need to create u/$id
|
||||
mkdir u/$id
|
||||
cd u/$id
|
||||
|
||||
ln -s ../../index.html
|
||||
ln -s ../../grep.php
|
||||
fi
|
||||
|
||||
if ! test -f lock
|
||||
then
|
||||
|
||||
cd u/$id
|
||||
|
||||
ln -sf ../../index.html || true
|
||||
ln -sf ../../grep.php || true
|
||||
|
||||
if ! test -f lock
|
||||
then
|
||||
touch lock
|
||||
../../fetch-tweets.sh $id
|
||||
rm lock
|
||||
else
|
||||
echo Fetching already!
|
||||
fi
|
||||
|
||||
else
|
||||
echo Fetching already! Locks are cleared daily
|
||||
fi
|
||||
|
||||
echo "</pre>"
|
||||
|
||||
4
main.js
4
main.js
@@ -34,7 +34,9 @@ $(document).ready(function() {
|
||||
|
||||
$("input[type=text]").focus();
|
||||
|
||||
$("#source").html('<a href="' + NAME + '.txt">' + NAME + ' simple text backup file</a>');
|
||||
footer = '<div class="row"><div class="span4"><a href="' + NAME + '.txt">' + NAME + ' text backup file</a></div>';
|
||||
footer += '<div class="span4"><a href="' + "http://greptweet/create.cgi?id=" + NAME +'">Fetch ' + NAME + ' tweets</a></div></div>';
|
||||
$("#source").html(footer);
|
||||
document.title = "Greptweet " + NAME;
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user