summaryrefslogtreecommitdiff
path: root/foaf/mkfoaf.sh
diff options
context:
space:
mode:
Diffstat (limited to 'foaf/mkfoaf.sh')
-rwxr-xr-xfoaf/mkfoaf.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/foaf/mkfoaf.sh b/foaf/mkfoaf.sh
index 7423e5b..33142da 100755
--- a/foaf/mkfoaf.sh
+++ b/foaf/mkfoaf.sh
@@ -38,15 +38,20 @@ linkedin2foaf() {
# TODO: support homepage as fallback for accountName
# id=$(perl -0 -ne '/foaf:accountServiceHomepage\s+<http:\/\/www.linkedin.com\/>\s+;\s+foaf:(?:homepage\s+<(?=http)|accountName\s+")([^<"\s]+)/ and print $1 and exit;' "$inpath") #'
- id=$(perl -0 -ne '/^:me.*?foaf:accountServiceHomepage\s+<http:\/\/www.linkedin.com\/>\s+;\s+foaf:accountName\s+"([^<"\s]+)/ms and print $1 and exit;' "$inpath") #'
+# id=$(perl -0 -ne '/^:me.*?foaf:accountServiceHomepage\s+<http:\/\/www.linkedin.com\/>\s+;\s+foaf:accountName\s+"([^<"\s]+)/ms and print $1 and exit;' "$inpath") #'
+# id=62345396
+ id=jonassm
[ -n "$id" ] || exit1 "Failed to resolve LinkedIn account name."
+ uri="http://www.linkedin.com/in/$id"
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]+=|\s)/&amp;$1/g' "$tmppath"
- xsltproc --html "$xsltdir/linkedin2foaf.xsl" "$tmppath" > "$outpath"
+# xsltproc --html "$bindir/linkedin2foaf.xsl" "$uri" > "$outpath"
+ wget -q -O "$tmppath" "$uri"
+# perl -i -pe 's/&([a-zA-Z0-9]+=|\s)/&amp;$1/g' "$tmppath"
+# xsltproc --html "$xsltdir/linkedin2foaf.xsl" "$tmppath" > "$outpath"
+# perl "$bindir/linkedin2rdf.pl" "$tmppath" "$uri" > "$outpath"
+ perl "$bindir/any2rdf.pl" "$tmppath" "$uri" > "$outpath"
rm -f "$tmppath"
foafsign "$outpath"
}