From 8a6f120eeb9f2a540cfb07a8f984c22d29b33908 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 28 Oct 2010 19:47:48 +0200 Subject: Move projects/* → /. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/foaf/fbfixup.pl | 41 ------ projects/foaf/linkedin2foaf.xsl | 306 ---------------------------------------- projects/foaf/mkfoaf.sh | 78 ---------- projects/foaf/pingfoaf.sh | 5 - 4 files changed, 430 deletions(-) delete mode 100755 projects/foaf/fbfixup.pl delete mode 100644 projects/foaf/linkedin2foaf.xsl delete mode 100755 projects/foaf/mkfoaf.sh delete mode 100755 projects/foaf/pingfoaf.sh (limited to 'projects/foaf') diff --git a/projects/foaf/fbfixup.pl b/projects/foaf/fbfixup.pl deleted file mode 100755 index 5cc5f60..0000000 --- a/projects/foaf/fbfixup.pl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl - -# Sanitize RDF from Facebook Exporter - -undef $/; - -while (<>) { - - s{ - Mørkøv\n\s* - Vestsjalland\n\s* - Denmark\n\s* - - \n\s* - .*?\n\s* - \n\s* - \n\s* - - }{}gsx; - - s{ - \n\s* - - }{ - - - }gsx; - - s{ - \n\s* - \n\s* - \n\s* - \n\s* - .*?\n\s* - \n\s* - - }{}gsx; - - s,(( *)),$1\n$2$3\@chat.facebook.com,gs; - print; -} diff --git a/projects/foaf/linkedin2foaf.xsl b/projects/foaf/linkedin2foaf.xsl deleted file mode 100644 index 2d24452..0000000 --- a/projects/foaf/linkedin2foaf.xsl +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - -yes - -yes - - - - - - - - - - - - - - - - - - - - - - - - http://code.google.com/p/lindenb/source/browse/trunk/src/xsl/linkedin2foaf.xsl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Downloading ... - -Done (). - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - - diff --git a/projects/foaf/mkfoaf.sh b/projects/foaf/mkfoaf.sh deleted file mode 100755 index e8ee107..0000000 --- a/projects/foaf/mkfoaf.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# Origin: http://code.google.com/p/lindenb/source/browse/trunk/src/xsl/linkedin2foaf.xsl -# info: http://plindenbaum.blogspot.com/2010/02/linkedinxslt-foaf-people-from.html - -set -e - -exit1() { - echo "ERROR: $1" - exit 1 -} - -bindir=$(dirname "$0") -xsltdir="$bindir" - -turtle2foaf() { - inpath="$1" - outpath="$2" - [ -n "$outpath" ] || outpath=$(echo "$inpath" | perl -pe 's/\.ttl$/.rdf/ or exit 1') || exit1 "Failed resolving output RDF file from input Turtle file \"$inpath\"." - - [ -e "$inpath" ] || exit1 "Turtle file \"$inpath\" does not exist." -# [ ! -e "$outpath" ] || exit1 "RDF file \"$outpath\" already exists." - - base="$(perl -ne '/^\@base\s+<(http.+)>/ and print $1 and exit;' "$inpath")" || true - rapper ${base:+-I "$base"} -i turtle -o rdfxml-abbrev "$inpath" > "$outpath" - foafsign "$outpath" -} - -linkedin2foaf() { - inpath="$1" - outpath="$2" - [ -n "$outpath" ] || outfile=index.rdf && outpath="$(dirname "$inpath")/linkedin/$outfile" - outdir=$(dirname "$outpath") - tmppath="$outdir/index.html" - - [ -e "$inpath" ] || exit1 "Turtle file \"$inpath\" does not exist." - [ ! -e "$tmppath" ] || exit1 "Tempfile \"$tmppath\" already exists." - -# TODO: support homepage as fallback for accountName -# id=$(perl -0 -ne '/foaf:accountServiceHomepage\s+\s+;\s+foaf:(?:homepage\s+<(?=http)|accountName\s+")([^<"\s]+)/ and print $1 and exit;' "$inpath") #' - id=$(perl -0 -ne '/^:me.*?foaf:accountServiceHomepage\s+\s+;\s+foaf:accountName\s+"([^<"\s]+)/ms and print $1 and exit;' "$inpath") #' - [ -n "$id" ] || exit1 "Failed to resolve LinkedIn account name." - - mkdir -p "$outdir" -# work around unescaped &'s in linkedin pages -# xsltproc --html "$bindir/linkedin2foaf.xsl" "http://www.linkedin.com/in/$id" > "$outpath" - wget -q -O "$tmppath" "http://www.linkedin.com/in/$id" - perl -i -pe 's/&([a-zA-Z0-9]+=)/&$1/g' "$tmppath" - xsltproc --html "$xsltdir/linkedin2foaf.xsl" "$tmppath" > "$outpath" - rm -f "$tmppath" - foafsign "$outpath" -} - -tidyfacebookfoaf() { - inpath="$1" - outpath="$2" - - [ -e "$inpath" ] || exit1 "Facebook Exporter RDF file \"$inpath\" does not exist." - - perl "$bindir/fbfixup.pl" "$inpath" > "$outpath" - foafsign "$outpath" -} - -foafsign() { - inpath="$1" - outpath="$inpath.asc" - gpg -a -o- --detach-sign "$inpath" > "$outpath" -} - -paths="$@" -[ -n "$paths" ] || paths=index.ttl - -for path in $paths; do - basedir=$(dirname "$path") - turtle2foaf "$path" - linkedin2foaf "$path" || true - tidyfacebookfoaf "$basedir/facebook/foaf.xml" "$basedir/facebook/index.rdf" || true -done diff --git a/projects/foaf/pingfoaf.sh b/projects/foaf/pingfoaf.sh deleted file mode 100755 index 7f3e795..0000000 --- a/projects/foaf/pingfoaf.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -e - -curl -H "Accept: text/plain" --data-binary 'http://dr.jones.dk/me http://dr.jones.dk/me/facebook http://dr.jones.dk/me/linkedin' http://sindice.com/api/v2/ping -- cgit v1.2.3