-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaccount_auto_discovery
executable file
·55 lines (47 loc) · 1.24 KB
/
account_auto_discovery
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl
# Blosxom Plugin: account auto-discovery
# Author: Gosuke Miyashita <[email protected]>
# Version: 2005-08-11
# Blosxom Home/Docs/Licensing: http://www.blosxom.com/
package account_auto_discovery;
use strict;
use vars qw($rdf);
# --- Configurable variables -----------
my $is_xhtml = 1;
my @accounts = (
{
account_name => "gosukenator",
account_service_homepage => "http://www.hatena.ne.jp/",
},
#{
# account_name => "xxxxx",
# account_service_homepage => "http://www.xxx.ne.jp/",
#},
);
sub start {
return 1;
}
sub head {
my $permalink = "http://" . $ENV{'HTTP_HOST'} . $ENV{'REQUEST_URI'};
foreach (@accounts){
$rdf .= << "EOS";
@{[ $is_xhtml ? '' : '<!--' ]}
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<rdf:Description rdf:about="$permalink">
<foaf:maker rdf:parseType="Resource">
<foaf:holdsAccount>
<foaf:OnlineAccount foaf:accountName="$_->{account_name}">
<foaf:accountServiceHomepage rdf:resource="$_->{account_service_homepage}" />
</foaf:OnlineAccount>
</foaf:holdsAccount>
</foaf:maker>
</rdf:Description>
</rdf:RDF>
@{[ $is_xhtml ? '' : '-->' ]}
EOS
}
return 1;
}
1;