summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-06-16 22:30:23 +0100
committerNick White <git@njw.me.uk>2011-06-16 22:30:23 +0100
commit2b76a1dcb056720641b0a1b2002c7c63329dfa92 (patch)
treed03f0f3f2f8d2de5a7beb1ace75473933c265309 /web
parent04dabf5ef4c5ec9b09e78d4adf9a3ff8051be43d (diff)
Improve webpage, specify javascript (as that's the ecmascript variant we're using)
Diffstat (limited to 'web')
-rw-r--r--web/doap-src.ttl2
-rw-r--r--web/websummary.sh45
2 files changed, 46 insertions, 1 deletions
diff --git a/web/doap-src.ttl b/web/doap-src.ttl
index 770e4ed..a0ad5e6 100644
--- a/web/doap-src.ttl
+++ b/web/doap-src.ttl
@@ -9,7 +9,7 @@
doap:shortdesc "Stop browsing, start reading";
doap:homepage <WEBSITE/>;
doap:repository :repo;
- doap:programming-language "ECMAScript";
+ doap:programming-language "JavaScript";
doap:license <http://www.gnu.org/licenses/agpl.html>;
doap:release :v0dot1, :v0dot2, :v0dot3, :v0dot4, :v0dot5;
doap:maintainer <FOAF>.
diff --git a/web/websummary.sh b/web/websummary.sh
new file mode 100644
index 0000000..8da2790
--- /dev/null
+++ b/web/websummary.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+test $# -ne 1 && echo "usage: $0 doap" && exit 1
+
+rdf="$1"
+
+q="PREFIX doap: <http://usefulinc.com/ns/doap#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang ?repotype
+WHERE {
+?p a doap:Project;
+ doap:homepage ?home;
+ doap:repository ?r;
+ doap:license ?license;
+ doap:programming-language ?lang;
+ doap:maintainer ?m.
+?r a ?repotype;
+ doap:location ?repo.
+?m foaf:name ?maintainer;
+ foaf:homepage ?maintainerhome.
+}"
+
+roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \
+| while read r; do
+ home=`echo $r | awk -F , '{print $2}'| sed -e 's/uri\(//' -e 's/\)//'`
+ repo=`echo $r | awk -F , '{print $3}'| sed -e 's/uri\(//' -e 's/\)//'`
+ licenseuri=`echo $r | awk -F , '{print $4}'| sed -e 's/uri\(//' -e 's/\)//'`
+ maint=`echo $r | awk -F , '{print $5}'| sed -e 's/"//g'`
+ mainthome=`echo $r | awk -F , '{print $6}'| sed -e 's/uri\(//' -e 's/\)//'`
+ lang=`echo $r | awk -F , '{print $7}'| sed -e 's/"//g'`
+ test "$licenseuri" = "http://www.gnu.org/licenses/gpl.html" && license="GPL"
+ test "$licenseuri" = "http://www.gnu.org/licenses/agpl.html" && license="AGPL"
+ test "$licenseuri" = "http://creativecommons.org/licenses/MIT/" && license="MIT"
+ repotype=`echo $r | awk -F , '{print $8}'| sed -e 's/uri\(//' -e 's/\)//'`
+ test "$repotype" = "http://usefulinc.com/ns/doap#GitRepository" && repocmd="git clone"
+
+ cat <<- _EOF_
+- Project homepage: [$home]($home)
+- Code repository: $repocmd $repo
+- Maintainer: [$maint]($mainthome)
+- Language: $lang
+- License: [$license]($licenseuri)
+- DOAP: [${home}doap.ttl](${home}doap.ttl)
+_EOF_
+done