From 85f97456ebff6eff61dddd0358cd6e243d88b1dc Mon Sep 17 00:00:00 2001 From: Jason Levine Date: Fri, 3 Oct 2014 21:12:34 -0400 Subject: [PATCH 1/2] add my recently-updated-pages shell scripts (both HTML and JSON versions) --- api/recently-updated/findmod-json.sh | 2 ++ api/recently-updated/findmod.sh | 5 +++++ api/recently-updated/footer.tpl | 4 ++++ api/recently-updated/header.tpl | 10 ++++++++++ 4 files changed, 21 insertions(+) create mode 100755 api/recently-updated/findmod-json.sh create mode 100755 api/recently-updated/findmod.sh create mode 100644 api/recently-updated/footer.tpl create mode 100644 api/recently-updated/header.tpl diff --git a/api/recently-updated/findmod-json.sh b/api/recently-updated/findmod-json.sh new file mode 100755 index 0000000..d047dc8 --- /dev/null +++ b/api/recently-updated/findmod-json.sh @@ -0,0 +1,2 @@ +#!/bin/bash +find /home/*/public_html -regex "/home/\_?[0-9a-zA-Z]*/public_html/index.html" -type f -name "index.html" -mtime 0 -printf '%T@ %p %TD %Tr %TY-%Tm-%TdT%TTZ\n' 2> /dev/null | sort -r | perl -CSD -pe 'BEGIN { print "{ \"pagelist\": [ \n"; }; END { print "] }\n"; }; if ($i > 0) { print ", "; }; s|([0-9\.]+) /home/([\p{L}\p{N}_]*?)/public_html/index.html (.*) (.*)|{ "username": "$2", "homepage": "http://tilde.club/~$2/", "modtime": "$4" }|; $i++' diff --git a/api/recently-updated/findmod.sh b/api/recently-updated/findmod.sh new file mode 100755 index 0000000..fa36756 --- /dev/null +++ b/api/recently-updated/findmod.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cat /home/delfuego/bin/header.tpl +find /home/*/public_html -regex "/home/\_?[0-9a-zA-Z]*/public_html/index.html" -type f -name "index.html" -mtime 0 -printf '%T@ %p %TD %Tr %TY-%Tm-%TdT%TTZ\n' 2> /dev/null | sort -r | perl -CSD -pe 's|([0-9\.]+) /home/([\p{L}\p{N}_]*?)/public_html/index.html (.*) (.*)|
  • $2
  • |' +cat /home/delfuego/bin/footer.tpl + diff --git a/api/recently-updated/footer.tpl b/api/recently-updated/footer.tpl new file mode 100644 index 0000000..8fdf4c6 --- /dev/null +++ b/api/recently-updated/footer.tpl @@ -0,0 +1,4 @@ + + + + diff --git a/api/recently-updated/header.tpl b/api/recently-updated/header.tpl new file mode 100644 index 0000000..7dfc9b8 --- /dev/null +++ b/api/recently-updated/header.tpl @@ -0,0 +1,10 @@ + + + +tilde.24h + + +

    tilde.club home pages updated in last 24 hours

    +
    There's also a JSON version of this data; it's all updated once a minute, so hold yer damn horses, people. Also, times are in the server's time zone (GMT, it appears).
    +