/
index.html
357 lines (327 loc) · 13 KB
/
index.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:hv="http://astroblog.spaceboyz.net/harvester/xslt-functions"
xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="xsl hv date">
<xsl:output method="xml"
version="1.0"
encoding="utf-8"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="DTD/xhtml1-strict.dtd"
indent="yes"/>
<xsl:template match="/collections">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de">
<head>
<title>Blog Harvester</title>
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href="atom.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.rdf" />
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0 (all)" href="atom-all.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0 (all)" href="rss-all.rdf" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="harvester.css"/>
<link rel="shortcut icon" type="image/gif" href="harvester.gif"/>
<xsl:comment><![CDATA[[if IE 7]>
<link rel="stylesheet" type="text/css" href="harvester_ie7.css" />
<![endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="harvester_lte_ie6.css" />
<![endif]]]></xsl:comment>
</head>
<body>
<div class="head">
<h1>Blog Harvester</h1>
<img src="chart.jpg" class="chart"/>
</div>
<div class="tickers1">
<div class="ticker">
<h2>Harvesting</h2>
<ul class="tickerlinks">
<xsl:for-each select="collection[@name='blogs']/feed">
<xsl:sort select="translate(title, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
<li><a href="{link}" title="{description}"><xsl:value-of select="title"/></a></li>
</xsl:for-each>
</ul>
</div>
<div class="ticker">
<h2>Apropos</h2>
<p>
The Harvester is made of fresh flesh from the blogosphere,
clean design by Tigion
and hacked-together Ruby scripts by Astro,
improved by Neingeist and Josef.
</p>
</div>
<div class="ticker">
<h2>To be fed</h2>
<p>
Just blogs: <a href="atom.xml">ATOM 1.0</a> or <a href="rss.rdf">RSS 2.0</a>,
</p>
<p>
All collections: <a href="atom-all.xml">ATOM 1.0</a> or <a href="rss-all.rdf">RSS 2.0</a>
</p>
</div>
<div class="ticker">
<h2>Be notified</h2>
<p>Start Jabber and talk to <a href="xmpp:astrobot@spaceboyz.net">AstroBot</a> to receive the freshest of all!</p>
</div>
<div class="ticker">
<h2>Questions</h2>
<p>Missing something?<br/>Contact <a href="mailto:astro@spaceboyz.net">Astro</a> via Mail or Jabber: astro@spaceboyz.net</p>
</div>
<div class="ticker">
<h2>Hack it…</h2>
<p>
Old <a href="svn://svn.c3d2.de/harvester/trunk/harvester">SVN</a> but now <a href="http://github.com/astro/harvester/">on GitHub</a>.
</p>
</div>
<div class="ticker">
<h2>…or learn more</h2>
<p>
<a href="https://wiki.c3d2.de/Harvester">Project info</a>,
<a href="svn://svn.c3d2.de/harvester/trunk/harvester">Repository</a>,
<a href="http://trac.c3d2.de/harvester">Trac</a>,
<a href="http://trac.c3d2.de/harvester/browser/trunk/harvester/">Source browser</a>
</p>
</div>
<div class="ticker">
<h2>Other Harvesters</h2>
<ul class="tickerlinks">
<!--li><a href="http://chaosnase.de/planet">Chaosnase Planet</a></li-->
<li><a href="http://marvin.blog-harvester.de/">Marvin's Harvester</a></li>
<li><a href="http://planet.entropia.de/">Planet Entropia</a></li>
<li><a href="http://planet.hboeck.de/">Planet Hanno</a></li>
<li><a href="http://planet.schokokeks.org/">Planet Schokokeks</a></li>
<li><a href="http://harvester.toidinamai.de/">toidinamai's planet</a></li>
</ul>
</div>
<xsl:call-template name="ticker-boxen">
<xsl:with-param name="collection" select="'ticker'"/>
</xsl:call-template>
<xsl:call-template name="ticker-boxen">
<xsl:with-param name="collection" select="'projects'"/>
</xsl:call-template>
</div>
<div class="tickers2">
<div class="ticker">
<h2>Photos</h2>
<ul class="photos">
<xsl:for-each select="hv:collection-items('photos')/item">
<xsl:variable name="title" select="title"/>
<xsl:variable name="link" select="link"/>
<xsl:for-each select="hv:item-images(string(rss),
string(link))//img">
<li>
<a href="{$link}">
<img src="{@src}" title="{$title}"/>
</a>
</li>
</xsl:for-each>
</xsl:for-each>
</ul>
</div>
<xsl:call-template name="ticker-boxen">
<xsl:with-param name="collection" select="'links'"/>
</xsl:call-template>
</div>
<div class="tickers3">
<xsl:variable name="microblogs"
select="collection[@name='microblogs']"/>
<xsl:variable name="items"
select="hv:collection-items('microblogs', 100)"/>
<xsl:variable name="now"
select="string($items/item[1]/date)"/>
<div class="ticker">
<h2>Microblogging — today</h2>
<ul>
<xsl:for-each select="$items/item">
<!--xsl:sort select="date" order="descending"/-->
<xsl:variable name="diff"
select="date:difference(date, $now)"/>
<xsl:if test="$diff = 'P0D' or
starts-with($diff, 'PT')">
<xsl:variable name="rss" select="string(rss)"/>
<xsl:variable name="feed"
select="$microblogs/feed[rss=$rss]"/>
<xsl:call-template name="microblog-entry">
<xsl:with-param name="feed" select="$feed"/>
<xsl:with-param name="entry" select="."/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</ul>
</div>
<div class="ticker">
<h2>Microblogging — yesterday</h2>
<ul>
<xsl:for-each select="$items/item">
<!--xsl:sort select="date" order="descending"/-->
<xsl:if test="starts-with(date:difference(date, $now),
'P1DT')">
<xsl:variable name="rss" select="string(rss)"/>
<xsl:variable name="feed"
select="$microblogs/feed[rss=$rss]"/>
<xsl:call-template name="microblog-entry">
<xsl:with-param name="feed" select="$feed"/>
<xsl:with-param name="entry" select="."/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</ul>
</div>
<div class="ticker">
<h2>Microblogging — past</h2>
<ul>
<xsl:for-each select="hv:collection-items('microblogs')/item">
<!--xsl:sort select="date" order="descending"/-->
<xsl:variable name="diff"
select="date:difference(date, $now)"/>
<xsl:if test="not($diff = 'P0D') and
not(starts-with($diff, 'PT')) and
not(starts-with($diff, 'P1DT'))">
<xsl:variable name="rss" select="string(rss)"/>
<xsl:variable name="feed"
select="$microblogs/feed[rss=$rss]"/>
<xsl:call-template name="microblog-entry">
<xsl:with-param name="feed" select="$feed"/>
<xsl:with-param name="entry" select="."/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</ul>
</div>
</div>
<div class="hfeed">
<xsl:variable name="blogs" select="collection[@name='blogs']"/>
<xsl:for-each select="hv:collection-items('blogs')/item">
<xsl:variable name="rss" select="string(rss)"/>
<xsl:variable name="feed" select="$blogs/feed[rss=$rss]"/>
<div class="entry hentry">
<h2 class="blog-title">
<a href="{$feed/link}"><xsl:value-of select="$feed/title"/></a>
</h2>
<div class="entrydate published" title="{date}">
<xsl:value-of select="concat(date:day-in-month(date),'.',date:month-in-year(date),'. ',format-number(date:hour-in-day(date),'00'),':',format-number(date:minute-in-hour(date),'00'))"/>
</div>
<h3 class="entry-title"><a href="{link}" rel="bookmark"><xsl:value-of select="title"/></a></h3>
<div class="entrydesc entry-content">
<xsl:value-of select="hv:item-description($rss, string(link))" disable-output-escaping="yes"/>
</div>
<xsl:variable name="enclosures" select="hv:item-enclosures(string($rss), string(link))"/>
<xsl:if test="count($enclosures/enclosure) > 0">
<ul>
<xsl:for-each select="$enclosures/enclosure">
<xsl:variable name="filename">
<xsl:call-template name="basename">
<xsl:with-param name="path" select="href"/>
</xsl:call-template>
</xsl:variable>
<li>
<xsl:choose>
<xsl:when test="string-length(string(title)) > 0">
<xsl:value-of select="title"/>
(<a href="{href}" rel="enclosure"><xsl:value-of select="$filename"/></a>)
</xsl:when>
<xsl:otherwise>
<a href="{href}" rel="enclosure"><xsl:value-of select="$filename"/></a>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:call-template name="format-enclosure-length">
<xsl:with-param name="length" select="number(length)"/>
</xsl:call-template>
</li>
</xsl:for-each>
</ul>
</xsl:if>
<div class="entryfoot"><a href="{link}" title="{link}">mehr…</a></div>
</div>
</xsl:for-each>
</div>
<p style="display:none"><a href="http://cthulhu.c3d2.de/~astro/badpit.html">E-Mail Address Index</a></p>
</body>
</html>
</xsl:template>
<xsl:template name="ticker-boxen">
<xsl:param name="collection"/>
<xsl:for-each select="collection[@name=$collection]/feed">
<xsl:sort select="translate(title, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
<div class="ticker hfeed">
<h2><a href="{link}"><xsl:value-of select="title"/></a></h2>
<ul class="tickerlinks">
<xsl:for-each select="hv:feed-items(string(rss), 8)/item">
<li class="hentry">
<xsl:choose>
<xsl:when test="string-length(title) > 32">
<a href="{link}" title="{title}" rel="bookmark" class="entry-title"><xsl:value-of select="substring(title, 1, 30)"/>…</a>
</xsl:when>
<xsl:otherwise>
<a href="{link}" rel="bookmark" class="entry-title"><xsl:value-of select="title"/></a>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:for-each>
</xsl:template>
<xsl:template name="format-enclosure-length">
<xsl:param name="length"/>
<xsl:if test="$length">
<xsl:choose>
<xsl:when test="$length < 1024">
<xsl:value-of select="$length"/> Bytes
</xsl:when>
<xsl:when test="$length < 1048576">
<xsl:value-of select="format-number($length div 1024, '0.0#')"/> KB
</xsl:when>
<xsl:when test="$length < 1073741824">
<xsl:value-of select="format-number($length div 1048576, '0.0#')"/> MB
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number($length div 1073741824, '0.0#')"/> GB
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="basename">
<xsl:param name="path"/>
<xsl:choose>
<xsl:when test="contains($path, '/')">
<xsl:call-template name="basename">
<xsl:with-param name="path" select="substring-after($path, '/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="microblog-entry">
<xsl:param name="feed"/>
<xsl:param name="entry" select="."/>
<xsl:variable name="nick">
<xsl:choose>
<xsl:when test="contains($feed/title, ' timeline')">
<xsl:value-of select="substring-before(string($feed/title), ' timeline')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$feed/title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<li>
<xsl:if test="starts-with($entry/link,
'http://identi.ca/notice/')">
<a href="http://identi.ca/{$nick}">
<img class="avatar" src="http://identi.ca/index.php?action=avatarbynickname&nickname={$nick}&size=24"
alt="avatar"/>
</a>
</xsl:if>
<a class="nickname"
href="{$entry/link}"><xsl:value-of select="$nick"/></a>:
<xsl:value-of select="hv:item-description(string($entry/rss), string($entry/link))" disable-output-escaping="yes"/>
</li>
</xsl:template>
</xsl:stylesheet>