From 00d95cdc9e99fda9378642d09fd80cd8c5079ae5 Mon Sep 17 00:00:00 2001 From: Kai Hendry Date: Fri, 11 Jul 2014 14:44:35 +0800 Subject: [PATCH] General tidy up --- .gitignore | 4 +++ LICENSE | 4 +-- create.cgi | 90 ------------------------------------------------------ robots.txt | 3 +- 4 files changed, 8 insertions(+), 93 deletions(-) create mode 100644 .gitignore delete mode 100755 create.cgi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6aa30c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +u/* +active-users.txt +version.txt +secret.php diff --git a/LICENSE b/LICENSE index bc325ea..b4d4bdd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ MIT/X Consortium License -© 2011-2012 Kai Hendry -Contributors to https://github.com/kaihendry/Greptweet +© 2011-2014 Kai Hendry +Contributors https://github.com/kaihendry/greptweet/graphs/contributors Jamie Kitson Pádraig Brady diff --git a/create.cgi b/create.cgi deleted file mode 100755 index 192556d..0000000 --- a/create.cgi +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -e -# vim: set ts=4 sw=4 -# apache_setenv('no-gzip', '1'); -# TODO re-implement in PHP -exec 2>&1 -cat <Bad input, parameter id $@" - exit -} - -oldpwd=$PWD - -saveIFS=$IFS -IFS='=&' -parm=($QUERY_STRING) -IFS=$saveIFS - -if test ${parm[0]} == "id" -then - id=$(echo ${parm[1]} | tr -dc '[:alnum:]_' | tr '[:upper:]' '[:lower:]') - test ${#id} -gt 0 || badinput is empty - test ${#id} -lt 20 || badinput is too large -else - exit -fi - -if test "${parm[2]}" == "o" # unused -then - test "${parm[3]}" && old=1 -fi - -cat < - - - - Fetching tweets of $id - - - -
-
-END - -if test -d u/$id -then - echo "

Attempting to update $id

" -else - - # TODO: This API is deprecated! - 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 - fi - - mkdir -p u/$id - -fi - -cd u/$id - -ln -sf ../../index.html || true -ln -sf ../../grep.php || true - -if echo $id | grep -q -v '_' # Underscores in domain names is a no no -then -cat <

Goto http://$id.greptweet.com to grep!

-END -else -cat <

Goto http://$HTTP_HOST/u/$id to grep!

-END -fi - -ln -sf $id.txt tweets.txt -test -h greptweet.appcache && rm -f greptweet.appcache -sed -e "s,TIMESTAMP,$(date)," ../../greptweet.appcache > greptweet.appcache - -echo "
"
-
-../../fetch-tweets.sh $id & disown
diff --git a/robots.txt b/robots.txt
index e039732..b231264 100644
--- a/robots.txt
+++ b/robots.txt
@@ -1,3 +1,4 @@
 user-agent: *
-disallow: /create.cgi
+disallow: /create.php
 disallow: /u/*
+disallow: /f/*