root/blosxom_plugins/trunk/account_auto_discovery

Revision 12, 1.2 kB (checked in by miya, 3 years ago)

import blosxom plugins

  • Property svn:executable set to
Line 
1 # Blosxom Plugin: account auto-discovery
2 # Author: Gosuke Miyashita <miya@mizzy.org>
3 # Version: 2005-08-11
4 # Blosxom Home/Docs/Licensing: http://www.blosxom.com/
5
6 package account_auto_discovery;
7
8 use strict;
9 use vars qw($rdf);
10
11 # --- Configurable variables -----------
12 my $is_xhtml = 1;
13 my @accounts = (
14                 {
15                     account_name => "gosukenator",
16                     account_service_homepage => "http://www.hatena.ne.jp/",
17                 },
18                 #{
19                 #    account_name => "xxxxx",
20                 #    account_service_homepage => "http://www.xxx.ne.jp/",
21                 #},
22                 );
23
24 sub start {
25     return 1;
26 }
27
28 sub head {
29     my $permalink = "http://" . $ENV{'HTTP_HOST'} . $ENV{'REQUEST_URI'};
30    
31     foreach (@accounts){
32         $rdf .= << "EOS";
33 @{[ $is_xhtml ? '' : '<!--' ]}
34 <rdf:RDF
35   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
36   xmlns:foaf="http://xmlns.com/foaf/0.1/">
37   <rdf:Description rdf:about="$permalink">
38     <foaf:maker rdf:parseType="Resource">
39       <foaf:holdsAccount>
40         <foaf:OnlineAccount foaf:accountName="$_->{account_name}">
41           <foaf:accountServiceHomepage rdf:resource="$_->{account_service_homepage}" />
42         </foaf:OnlineAccount>
43       </foaf:holdsAccount>
44     </foaf:maker>
45   </rdf:Description>
46 </rdf:RDF>
47 @{[ $is_xhtml ? '' : '-->' ]}
48 EOS
49 }
50
51     return 1;
52 }
53
54 1;
Note: See TracBrowser for help on using the browser.