diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-10-15 16:34:12 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-10-15 16:34:12 +0200 |
commit | 3cdba8ac30ad6b8c822e7259bfb74ad56a983471 (patch) | |
tree | baeda8302118266f06503079ad05cbd260d7d053 /projects/foaf/fbfixup.pl | |
parent | 9f4ccc261f0653ff52d467524720ba733f3dc988 (diff) |
Add foaf files and scripts.
Diffstat (limited to 'projects/foaf/fbfixup.pl')
-rwxr-xr-x | projects/foaf/fbfixup.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/projects/foaf/fbfixup.pl b/projects/foaf/fbfixup.pl new file mode 100755 index 0000000..5cc5f60 --- /dev/null +++ b/projects/foaf/fbfixup.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +# Sanitize RDF from Facebook Exporter <http://apps.facebook.com/foaf_exporter/> + +undef $/; + +while (<>) { + + s{ + <foaf:locality>Mørkøv</foaf:locality>\n\s* + <foaf:region>Vestsjalland</foaf:region>\n\s* + <foaf:country>Denmark</foaf:country>\n\s* + + <os:aboutMe></os:aboutMe>\n\s* + <os:relationshipStatus>.*?</os:relationshipStatus>\n\s* + <os:books></os:books>\n\s* + <os:music></os:music>\n\s* + <os:quotes></os:quotes> + }{}gsx; + + s{ + </foaf:Person>\n\s* + <foaf:Person> + }{</foaf:Person> + </foaf:knows> + <foaf:knows> + <foaf:Person>}gsx; + + s{ + <foaf:holdsAccount>\n\s* + <foaf:OnlineAccount>\n\s* + <foaf:accountServiceHomepage\srdf:resource="http://www.facebook.com/"/>\n\s* + <foaf:accountProfilePage\srdf:resource="(http://www.facebook.com/.*?)"/>\n\s* + <foaf:accountName>.*?</foaf:accountName>\n\s* + </foaf:OnlineAccount>\n\s* + </foaf:holdsAccount> + }{<foaf:homepage rdf:resource="$1"/>}gsx; + + s,(( *)<foaf:homepage rdf:resource="http://www.facebook.com/([a-z.]+)"/>),$1\n$2<foaf:jabberID>$3\@chat.facebook.com</foaf:jabberID>,gs; + print; +} |