summaryrefslogtreecommitdiff
path: root/sitemap.buetow.org/content/home.xml
blob: 39e615f64c09fed918128ba2691b7aa18bdf30d7 (plain)
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
56
57
58
59
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<content>
  <pagetitle>Sitemap</pagetitle>
  <textheader>All sites hosted</textheader>
  <text>
    <noop>Here are all sites hosted within this instance of </noop>
    <namedlink href="http://xerl.buetow.org">Xerl</namedlink>
    <noop>.</noop>
  </text>
  <information>
    <text>
      <noop>All hosts ending with </noop>
      <strong>.foo</strong>
      <noop> are most likely dev, test or PoCs. Don't expect to find anything usefull there. Also, generally here is lots of crap listed.</noop>
    </text>
  </information>
  <text>
    <perl>
      # Ugly but works for now
      my $hostroot = $config-&gt;get_hostroot();

      sub getf ($) { 
      open my $f, $_[0] or die "$!: $_[0]\n";
      my @slurp = !!LT!!$f!!GT!!; 
      close $f; 
      @slurp;
      }

      sub nl () { "!!LT!!br /!!GT!!\n" }

      sub list (*) {
      my $tag = shift;
      my @found = sort `find $hostroot -name $tag`;
      my $ret = '';


      for my $found (@found) {
      $found =~ /.*hosts.(.*?).$tag/;   
      my $host = $1;

      my @content = getf $found;

      $ret .= "!!LT!!b!!GT!!!!LT!!a href=http://$host!!GT!!$host!!LT!!/a!!GT!!!!LT!!/b!!GT!!" . nl;;
      if (@content) {
      $ret .= join " ", @content;
      $ret .= nl;
      }
      $ret .= nl; 
      }

      $ret;
      }

      my $ret = list SITEMAP;

      $ret;
    </perl>
  </text>
</content>