<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Jeffs Blog</title>
	<atom:link href="http://www.ebesucher.in/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ebesucher.in</link>
	<description>persönliches, technisches, interessantes</description>
	<pubDate>Thu, 23 Jul 2009 19:53:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Zugriffszeit</title>
		<link>http://www.ebesucher.in/alles/zugriffszeit/</link>
		<comments>http://www.ebesucher.in/alles/zugriffszeit/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 19:53:26 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=67</guid>
		<description><![CDATA[Heute mal etwas Empirie&#8230;
Ich habe ein Benchmark der Zugriffszeit von einigen Webseiten durchgeführt, um die Werte mal vergleichen zu können. Zuallererst zum Aufbau: verwendet habe ich das Tool ApacheBench mit folgenden Parametern
$ ab -n 1000 -c 10 URL
Aufgeschlüsselt: 10 gleichzeitige Verbindungen und 1000 Anfragen wurden jeweils an jeden Server gestellt.
Das Ergebnis:

Unerwarteterweise schneidet forum.ebesucher.de super schlecht [...]]]></description>
			<content:encoded><![CDATA[<p>Heute mal etwas Empirie&#8230;</p>
<p>Ich habe ein Benchmark der Zugriffszeit von einigen Webseiten durchgeführt, um die Werte mal vergleichen zu können. Zuallererst zum Aufbau: verwendet habe ich das Tool ApacheBench mit folgenden Parametern</p>
<p><em>$ ab -n 1000 -c 10 URL</em></p>
<p>Aufgeschlüsselt: 10 gleichzeitige Verbindungen und 1000 Anfragen wurden jeweils an jeden Server gestellt.</p>
<p>Das Ergebnis:</p>
<p><a href="http://www.ebesucher.in/wp-content/uploads/2009/07/zugriffszeit2.png"><img class="alignnone size-full wp-image-64" title="zugriffszeit2" src="http://www.ebesucher.in/wp-content/uploads/2009/07/zugriffszeit2.png" alt="" width="509" height="331" /></a></p>
<p style="text-align: left;">Unerwarteterweise schneidet <a href="http://forum.ebesucher.de" target="_blank">forum.ebesucher.de</a> super schlecht ab. Warum? Das Forum liegt auf dem kleinsten Server von eBesucher und ist für so hohe Anzahl an aufeinanderfolgenden Zugriffen nicht optimiert. Auch muss die Indexseite des Forums viel mehr aus der Datenbank lesen, als die von eBesucher zum Beispiel.</p>
<p style="text-align: left;">
<p style="text-align: left;"><a href="http://www.klamm.de" target="_blank">Klamm</a> und <a href="http://www.ebesucher.de" target="_blank">eBesucher</a> Hauptseiten schneiden in etwa gleich gut ab. eBay und Paypal sind dagegen <strong>im Mittel</strong> bis zu drei mal langsamer.</p>
<p style="text-align: left;">
<p style="text-align: left;"><a href="http://www.google.de" target="_blank">Google</a> ist natürlich der Vorreiter der schnellen Webserver: mit 64ms durchschnittlicher Zugriffszeit ist die die Suchmaschine etwa so schnell wie ein lokaler Webserver.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/zugriffszeit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google geht auch mal kaputt</title>
		<link>http://www.ebesucher.in/alles/google-geht-auch-mal-kaputt/</link>
		<comments>http://www.ebesucher.in/alles/google-geht-auch-mal-kaputt/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 15:03:37 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<category><![CDATA[google fehler]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=58</guid>
		<description><![CDATA[Auch die tolle Engine von Google macht mal Fehler. Ich habe eben beim surfen ein sehr schönes Bild erwischt. Alle Seiten wurden von Google plötzlich als unsicher gekennzeichnet. Selbst die eigene Seite kennzeichnete Google stolz als gefährlich!

]]></description>
			<content:encoded><![CDATA[<p>Auch die tolle Engine von Google macht mal Fehler. Ich habe eben beim surfen ein sehr schönes Bild erwischt. Alle Seiten wurden von Google plötzlich als unsicher gekennzeichnet. Selbst die eigene Seite kennzeichnete Google stolz als gefährlich!</p>
<p><a href="http://www.ebesucher.in/wp-content/uploads/2009/01/2009-01-31_1552.png"><img class="alignright size-full wp-image-59" title="Googles Fehler" src="http://www.ebesucher.in/wp-content/uploads/2009/01/2009-01-31_1552.png" alt="" width="499" height="80" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/google-geht-auch-mal-kaputt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cisco VPN-Client auf dem Mac und der Fehler 51</title>
		<link>http://www.ebesucher.in/alles/cisco-vpn-client-auf-dem-mac-und-der-fehler-51/</link>
		<comments>http://www.ebesucher.in/alles/cisco-vpn-client-auf-dem-mac-und-der-fehler-51/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 17:51:24 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<category><![CDATA[Computertechnik]]></category>

		<category><![CDATA[cisco vpn fehler mac]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=56</guid>
		<description><![CDATA[Ich habe mich seit ein Paar Tagen gewundert, warum ich keine VPN-Verbindung mehr in der Uni mit meinem Mac aufbauen konnte. Beim Start des VPN-Clients kam immer der Fehler: Error 51
&#8220;Unable to communicate with the VPN subsystem&#8221; und bestand darauf, dass ich doch bitte mindestens ein Netzwerk verfügbar machen sollte.
simples
sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart
auf der Konsole
löste nach [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe mich seit ein Paar Tagen gewundert, warum ich keine VPN-Verbindung mehr in der Uni mit meinem Mac aufbauen konnte. Beim Start des VPN-Clients kam immer der Fehler: Error 51<br />
&#8220;Unable to communicate with the VPN subsystem&#8221; und bestand darauf, dass ich doch bitte mindestens ein Netzwerk verfügbar machen sollte.</p>
<p>simples<strong><br />
sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart<br />
</strong>auf der Konsole</p>
<p>löste nach einer Passwortabfrage das Problem. Der Cisco-Client scheint Probleme zu haben, wenn neue Netzwerkadapter erscheinen oder wieder verschwinden. Das ist bei mir durch meinen UMTS-Stick oft der Fall.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/cisco-vpn-client-auf-dem-mac-und-der-fehler-51/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mausbewegung unter MacOsX zu langsam</title>
		<link>http://www.ebesucher.in/alles/mausbewegung-unter-macosx-zu-langsam/</link>
		<comments>http://www.ebesucher.in/alles/mausbewegung-unter-macosx-zu-langsam/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 09:19:18 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<category><![CDATA[Computertechnik]]></category>

		<category><![CDATA[mac mightymouse]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=51</guid>
		<description><![CDATA[Ich denke, ich bin nicht der einzige, der sich über die Geschwindigkeit der migty mouse ärgert. Das Gerät ist zwar sehr stylisch, aber mörderisch langsam. Fühlt sich für mich an, wie eine alte Oma, die die Treppe nach oben läuft.
Ich bin heute beim Surfen auf eine geniale Erweiterung gestoßen: MouseZoom verändert den Skalierungswert der Maus [...]]]></description>
			<content:encoded><![CDATA[<p>Ich denke, ich bin nicht der einzige, der sich über die Geschwindigkeit der migty mouse ärgert. Das Gerät ist zwar sehr stylisch, aber mörderisch langsam. Fühlt sich für mich an, wie eine alte Oma, die die Treppe nach oben läuft.</p>
<p>Ich bin heute beim Surfen auf eine geniale Erweiterung gestoßen: MouseZoom verändert den Skalierungswert der Maus weit über dem von Apple vorgegebenen Standartwert. Ich habe gleich vom MacOsx-Standartmaximum 1,7 auf 4,0 gestellt, und kann jetzt endlich vom einen Ende des Bildschirms das andere Ende in einer einzigen Mausbewegung erreichen. Super!</p>
<p><a title="Download MausZoom" href="http://www.benh57.com//mousezoom.html" target="_blank">Download MouseZoom</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/mausbewegung-unter-macosx-zu-langsam/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Обезьяна чичичи</title>
		<link>http://www.ebesucher.in/alles/%d0%be%d0%b1%d0%b5%d0%b7%d1%8c%d1%8f%d0%bd%d0%b0-%d1%87%d0%b8%d1%87%d0%b8%d1%87%d0%b8/</link>
		<comments>http://www.ebesucher.in/alles/%d0%be%d0%b1%d0%b5%d0%b7%d1%8c%d1%8f%d0%bd%d0%b0-%d1%87%d0%b8%d1%87%d0%b8%d1%87%d0%b8/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 23:59:14 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=49</guid>
		<description><![CDATA[Вот он, давно забытый стишок моего детства!
Обезьяна чичичи
Продавала кирпичи
не успела всё продать
Улетела под кровать
Под кроватью пусто
Выросла капуста
Под капустой генерал
Свои трусики стирал
Где моя бумажка
вытереть какашку?
ИЛИ
Обезьяна чичичи
Продавала кирпичи
За веревку дернула
И нечайно пёрнула
]]></description>
			<content:encoded><![CDATA[<p>Вот он, давно забытый стишок моего детства!</p>
<p>Обезьяна чичичи<br />
Продавала кирпичи<br />
не успела всё продать<br />
Улетела под кровать<br />
Под кроватью пусто<br />
Выросла капуста<br />
Под капустой генерал<br />
Свои трусики стирал<br />
Где моя бумажка<br />
вытереть какашку?</p>
<p>ИЛИ</p>
<p>Обезьяна чичичи<br />
Продавала кирпичи<br />
За веревку дернула<br />
И нечайно пёрнула</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/%d0%be%d0%b1%d0%b5%d0%b7%d1%8c%d1%8f%d0%bd%d0%b0-%d1%87%d0%b8%d1%87%d0%b8%d1%87%d0%b8/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Such-Plugins für Firefox</title>
		<link>http://www.ebesucher.in/computertechnik/such-plugins-fur-firefox/</link>
		<comments>http://www.ebesucher.in/computertechnik/such-plugins-fur-firefox/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 21:59:14 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Computertechnik]]></category>

		<category><![CDATA[yahoo firefox suchmaschine suchen plugin]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=47</guid>
		<description><![CDATA[Ich habe eben bestimmt 2 Stunden danach gesucht, weil ich die Seite ja schon mal gesehen hatte und auch schon mal benutzt hatte. Die Suchleiste in Firefox kann noch einiges mehr an Suchmaschinen aufnehmen, man muss nur wissen, wo man die entsprechenden Verweise her holt. Und das bekommt man hier: http://mycroft.mozdev.org/yahoo-search-plugins.html
Man muss den alternativen Suchdiensten [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe eben bestimmt 2 Stunden danach gesucht, weil ich die Seite ja schon mal gesehen hatte und auch schon mal benutzt hatte. Die Suchleiste in Firefox kann noch einiges mehr an Suchmaschinen aufnehmen, man muss nur wissen, wo man die entsprechenden Verweise her holt. Und das bekommt man hier: <a title="http://mycroft.mozdev.org/yahoo-search-plugins.html" href="http://mycroft.mozdev.org/yahoo-search-plugins.html" target="_blank">http://mycroft.mozdev.org/yahoo-search-plugins.html</a></p>
<p>Man muss den alternativen Suchdiensten auch mal eine Chance geben! Und das habe ich hiermit getan! Yahoo bietet inzwischen meiner Meinung nach ein besseres Interface, daher werde ich mal ausprobieren, ob ich damit vielleicht besser zurechtkomme!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/computertechnik/such-plugins-fur-firefox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Email-Notifications for Watchlist in DekiWiki</title>
		<link>http://www.ebesucher.in/alles/email-notifications-for-watchlist-in-dekiwiki/</link>
		<comments>http://www.ebesucher.in/alles/email-notifications-for-watchlist-in-dekiwiki/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 14:56:06 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<category><![CDATA[Computertechnik]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=37</guid>
		<description><![CDATA[After i have installed DekiWiki for our internal purposes on eBesucher, i realized, that it do not support Email-Notification for the Watchlist. It has only the option to get the notifications as RSS-Feed. Well, ok, this might not be the problem. Why not? Thunderbird supports RSS-Feeds, so i set it up to get my Watchlist [...]]]></description>
			<content:encoded><![CDATA[<p>After i have installed <a href="http://wiki.developer.mindtouch.com/MindTouch_Deki/Release/Kilen_Woods_(8.08)">DekiWiki</a> for our internal purposes on eBesucher, i realized, that it do not support Email-Notification for the Watchlist. It has only the option to get the notifications as RSS-Feed. Well, ok, this might not be the problem. Why not? Thunderbird supports RSS-Feeds, so i set it up to get my Watchlist as RSS. But what i did not know: you have to be logged in, to view the watchlist. This means that only Firefox can read my RSS-Watchlist properly.</p>
<p>After that some using of google, i found an api-Link for the feed, that handles the authentication via standard-HTTPauth. This is something like this: http://yourwiki/@api/deki/site/feed?title=Special:Watchlist</p>
<p>So now i could add the Watchlist in my Thunderbird. But what&#8217;s this? The messages seemed broken: they only said that some page has been changed. But without the changes really to be included. At first, i thought, it was a Thunderbird-Problem. But after some testing, I found out, that the feed was only 6kb unstead of 13kb. Why that? I think there is a bug in the DekiWiki-Permissionsmangement, the API-HTTPauth does not give me the full view permissions. It is still necessary to pass the authorisation-cookie (authtoken) to get the full feed.</p>
<p>So to summ up, <strong>I can not use any RSS-Feed-Reader other than my browser. </strong>Firefox can view the feed properly, but there is no notification feeling. And rss2email doesn&#8217;t work with this too.</p>
<p>That&#8217;s why i&#8217;ve spent about a day on writing a php-script to forward the messages from this tricky feed to email properly. And i would like to share this. So let&#8217;s start!</p>
<p>Here is the Part that handles RSS and Email:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>    
<span style="color: #0000ff; font-style: italic;">/**
 * DekiReader
 * is a class for getting instant email notifications with DekiWiki, if someone
 * changes a site in your Watchlist
 *
 * This script is free to use for private and commercial purposes
 * Author: Evgeny Anisiforov
 * mailtO: jeff at ebesucher point de
 *
 * I spend a whole day on writing this, so 
 * Please just leave a comment in my blog, if you use this. ;)
 */</span> 
&nbsp;
<span style="color: #0000ff; font-style: italic;">/**
 * The most problem about getting notifications is that DekiWiki requires us
 * to be logged in (with a cookie) to be able to view the full rss feed
 * of changes (including changed things)
 * This is a big problem, as the most rss read does not have such function.
 * This script emulates a login for each user to get the auth cookie
 * and then sends the contents of the RSS-feed to the specified email-address
 * It also takes care of marking old messages as read, so your users won't
 * get notifications more than one time
 * 
 * The best practice would be to use a cronjob to start DekiReader every X minutes.
 * like this:
          * / 10 * * * * cd /www/Cron_Jobs/DekiReader; nice php notifyfromdb.php
&nbsp;
 * notice: this file has only the class definitions, of cource you need a script
 * to create an object of DekiReader and pass the userdata to it.
 * */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
* this script needs the PEAR-packages &quot;http_client&quot; and &quot;http_request&quot;
*/</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">&quot;HTTP/Request.php&quot;</span>;
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">&quot;HTTP/Client.php&quot;</span>;
&nbsp;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'ERROR_DEKIWIKI_WRONG_CREDENTIALS'</span><span style="color: #339933;">,</span> <span style="">'ERROR_DEKIWIKI_WRONG_CREDENTIALS'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'ERROR_WEB_SERVICE'</span><span style="color: #339933;">,</span> <span style="">'ERROR_WEB_SERVICE'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">/* ------- Cookie's creation for Deki Wiki ------- */</span>
<span style="color: #000000; font-weight: bold;">class</span> DekiCookie <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://wiki.ebesucher.in&quot;</span>;
&nbsp;
    <span style="color: #0000ff; font-style: italic;">/** thanks to kurdte from: http://wiki.developer.mindtouch.com/MindTouch_Deki/Specs/Authentication_Providers */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getAuthToken<span style="color: #009900;">&#40;</span><span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">/* Request a value for the user's cookie */</span>
        <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/@api/deki/users/authenticate/&quot;</span>;
        <span style="color: #000088;">$req</span> <span style="color: #339933;">=&amp;</span> <span style="color: #000000; font-weight: bold;">new</span> HTTP_Request<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBasicAuth</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sendRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>PEAR<span style="color: #339933;">::</span><span style="color: #004000;">isError</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$output</span><span style="color: #339933;">=</span><span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponseBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
        <span style="color: #666666; font-style: italic;">/* Authentication proccess : if the response contains 401 authentication failed, the user is not registered */</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;authentication&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color:#800080;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;401&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//$cookie_deki=$req-&gt;getResponseCookies();</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span>;
            <span style="color: #666666; font-style: italic;">//setcookie(&quot;authtoken&quot;,str_replace(&quot;\&quot;&quot;,&quot;&quot;,$cookie_deki[0]['value']),time()+3600, '/');</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> ERROR_DEKIWIKI_WRONG_CREDENTIALS;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> ERROR_WEB_SERVICE;
        <span style="color: #009900;">&#125;</span> 
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> DekiReader <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff; font-style: italic;">/**
        array with the date of users to check
        every item must contain: username, password
        every item may contain: authtoken
    */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$userdata</span>;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$url</span>;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$emaildomain</span>;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$domain</span>;
    <span style="color: #0000ff; font-style: italic;">/** Directory to store cache-Data (what feed-messages did we
      * allready read? */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$cachedir</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache/&quot;</span>;
&nbsp;
    <span style="color: #0000ff; font-style: italic;">/**
     *  creates a DekiReader
     *  $emaildomain = the domain for sender-address
     *  if not given, we'll take the domain
    */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> DekiReader<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$userdata</span><span style="color: #339933;">,</span> <span style="color: #000088;">$emaildomain</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">domain</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$domain</span>;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/index.php?title=Special:Watchlist&amp;feed=rss&quot;</span>;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">userdata</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$userdata</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$emaildomain</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//delete http:// or https:// at the beginning</span>
            <span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #990000;">eregi_replace</span><span style="color: #009900;">&#40;</span><span style="">'^http://'</span><span style="color: #339933;">,</span> <span style="">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #990000;">eregi_replace</span><span style="color: #009900;">&#40;</span><span style="">'^https://'</span><span style="color: #339933;">,</span> <span style="">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$d</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">emaildomain</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$d</span>;   
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">emaildomain</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$emaildomain</span>;
        <span style="color: #009900;">&#125;</span>    
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #0000ff; font-style: italic;">/**
    * Returns the proper RFC 822 formatted date. 
    * @return string
    */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> RFCDate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000088;">$tz</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Z&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span>;
       <span style="color: #000088;">$tzs</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tz</span> <span style="color: #339933;">&lt;</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">&quot;-&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;+&quot;</span>;
       <span style="color: #000088;">$tz</span> <span style="color: #339933;">=</span> <span style="color: #990000;">abs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tz</span><span style="color: #009900;">&#41;</span>;
       <span style="color: #000088;">$tz</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tz</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">100</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tz</span><span style="color: #339933;">%</span><span style="color:#800080;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span>;
       <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%s %s%04d&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;D, j M Y H:i:s&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tzs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tz</span><span style="color: #009900;">&#41;</span>;
&nbsp;
       <span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span>;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #0000ff; font-style: italic;">/** convert the Dateformat of the Feed to a Timestamp */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> strangeDate2Timestamp<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$regs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="">'~((\d+)-(\d+)-(\d+))T((\d+):(\d+):(\d+))Z~is'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#41;</span>;
&nbsp;
        <span style="color: #666666; font-style: italic;">//date and time</span>
        <span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color:#800080;">0</span><span style="color: #009900;">&#93;</span>;
        <span style="color: #000088;">$t</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>;
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #0000ff; font-style: italic;">/** read the message cache for a user */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//we use username and feed-url to cache read messages</span>
        <span style="color: #000088;">$cache</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCacheFilename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span>;
&nbsp;
        <span style="color: #666666; font-style: italic;">//read the cache</span>
        <span style="color: #000088;">$contents</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="">''</span>;
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$contents</span>;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//get the filename of the message cache for a username</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCacheFilename<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cachedir</span><span style="color: #339933;">.</span><span style="">'rss_'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;@&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="">'.txt'</span>;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//add something to messagecache</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addToCache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCacheFilename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="">'a'</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span>;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$deki</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DekiCookie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="">'Content-Type: text/plain'</span><span style="color: #009900;">&#41;</span>;
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">userdata</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;trying to get &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; for user &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
            <span style="color: #000088;">$req</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTP_Request<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">&#41;</span>;            
            <span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMethod</span><span style="color: #009900;">&#40;</span>HTTP_REQUEST_METHOD_GET<span style="color: #009900;">&#41;</span>;
            <span style="color: #666666; font-style: italic;">//do we have an authtoken?</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'authtoken'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'authtoken'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$deki</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAuthToken</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
                <span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;estimated authtoken for user &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'authtoken'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addCookie</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;authtoken&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'authtoken'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sendRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$req</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponseBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
            <span style="color: #000088;">$xml</span>    <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #000088;">$cache_contents</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCache</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
            <span style="color: #666666; font-style: italic;">//some output</span>
            <span style="color: #990000;">echo</span> <span style="">'Feed: '</span> <span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#91;</span><span style="">'href'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
            <span style="color: #666666; font-style: italic;">//iterate the items in the feed</span>
&nbsp;
            <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">entry</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#91;</span><span style="">'href'</span><span style="color: #009900;">&#93;</span>;
                <span style="color: #000088;">$id</span>          <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span>;
                <span style="color: #666666; font-style: italic;">//did we allready read this?</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache_contents</span><span style="color: #339933;">,</span> <span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;   read: $id<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;    
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;   unread: $id<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
                <span style="color: #009900;">&#125;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// The data from the feed</span>
                <span style="color: #000088;">$authorname</span>  <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">author</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span>;
                <span style="color: #666666; font-style: italic;">//delete scopes for better compartibility</span>
                <span style="color: #000088;">$authorname</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$authorname</span><span style="color: #009900;">&#41;</span>;
                <span style="color: #000088;">$authorname</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$authorname</span><span style="color: #009900;">&#41;</span>;
                <span style="color: #666666; font-style: italic;">//here we don't have a read possibility to get the email of</span>
                <span style="color: #666666; font-style: italic;">//the author, we just simulate it by adding our domain name</span>
                <span style="color: #666666; font-style: italic;">//to the username (or you could write a function that does that better..)</span>
                <span style="color: #000088;">$author</span>      <span style="color: #339933;">=</span> <span style="">'&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$authorname</span><span style="color: #339933;">.</span><span style="">'&quot;'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$authorname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;@&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">emaildomain</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&gt;&quot;</span>;
&nbsp;
                <span style="color: #000088;">$title</span>       <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span>;
                <span style="color: #000088;">$link</span>        <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#91;</span><span style="">'href'</span><span style="color: #009900;">&#93;</span>;
                <span style="color: #000088;">$pubDate</span>     <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">published</span>;
                <span style="color: #666666; font-style: italic;">//convert the date from the feed to a compartible date format</span>
                <span style="color: #666666; font-style: italic;">//for the emails, so that we can see the correct date of</span>
                <span style="color: #666666; font-style: italic;">//the posting in our email program</span>
                <span style="color: #000088;">$updatedtimestamp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">strangeDate2Timestamp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updated</span><span style="color: #009900;">&#41;</span>;
                <span style="color: #000088;">$updated</span>     <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RFCDate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$updatedtimestamp</span><span style="color: #009900;">&#41;</span>;
                <span style="color: #666666; font-style: italic;">//we want all tags between &lt;summary&gt; and &lt;/summary&gt;, so just</span>
                <span style="color: #666666; font-style: italic;">//iterate through the children</span>
                <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span>;
                <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">summary</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$child</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$description</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">asXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
                <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
                <span style="color: #000088;">$to</span>   <span style="color: #339933;">=</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'email'</span><span style="color: #009900;">&#93;</span>; 
                <span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
                &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
                Page: &lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>$url<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;$title&lt;/a&gt;
                $description
                &lt;/body&gt;&lt;/html&gt;&quot;</span>; 
&nbsp;
                <span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="">'[Wiki] '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;From: $author&quot;</span>
                     <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Content-Type: text/html; charset=utf-8&quot;</span>
                     <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Date: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$updated</span>
                     <span style="color: #009900;">&#41;</span>; 
&nbsp;
                <span style="color: #666666; font-style: italic;">// we have send a notification for this item, so send</span>
                <span style="color: #666666; font-style: italic;">// write this to the cache</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addToCache</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span>;
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>So now lets use this! I use remote authentication on my site, so i&#8217;ve written a small file to read user data from my auth db.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #666666; font-style: italic;">//include some internal db stuff</span>
 <span style="color: #666666; font-style: italic;">// ....</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//then</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dekireader.php&quot;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #000088;">$watch_accounts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jeff&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sebastian&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$watch_accounts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please define Accounts to watch!&quot;</span><span style="color: #009900;">&#41;</span>; 
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT Username as username, PW as password, Email as email FROM Admins WHERE Username IN ('&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;','&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$watch_accounts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;')&quot;</span>;
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">echo</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$userdata</span> <span style="color: #339933;">=</span> mysql_get_whole_result<span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #000088;">$dekireader</span> <span style="color: #339933;">=</span>  <span style="color: #000000; font-weight: bold;">new</span> DekiReader<span style="color: #009900;">&#40;</span><span style="">'http://mywiki'</span><span style="color: #339933;">,</span>
                              <span style="color: #000088;">$userdata</span><span style="color: #339933;">,</span> <span style="">'myemaildomain.no'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #000088;">$dekireader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;        
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>But you could also just select all all admins. Or hard-code userdata:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #000088;">$userdata</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="">'username'</span>  <span style="color: #339933;">=&gt;</span> <span style="">'jeff'</span><span style="color: #339933;">,</span>
            <span style="">'password'</span>  <span style="color: #339933;">=&gt;</span> <span style="">'secret'</span><span style="color: #339933;">,</span>
            <span style="color: #666666; font-style: italic;">//'authtoken' =&gt; 'something', //you could cache authtokens to make the script faster</span>
            <span style="">'email'</span>     <span style="color: #339933;">=&gt;</span> <span style="">'bla@bla.bla'</span>
            <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>; 
<span style="color: #000088;">$dekireader</span> <span style="color: #339933;">=</span>  <span style="color: #000000; font-weight: bold;">new</span> DekiReader<span style="color: #009900;">&#40;</span><span style="">'http://mywiki'</span><span style="color: #339933;">,</span>
                              <span style="color: #000088;">$userdata</span><span style="color: #339933;">,</span> <span style="">'myemaildomain.no'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #000088;">$dekireader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;        
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>I did not handle using internal dekiwiki database for authorizing local users. I also did not try this. But this should be no problem after you examine the db structure of dikiwiki. Let me know, if you try this!</p>
<p>So now just set up a cronjob to run this script regulary, and you have a good email notification for your wiki. Like this:<br />
* / 10 * * * * cd /www/Cron_Jobs/DekiReader; nice php notifyfromdb.php</p>
<p>I&#8217;m still looking forward and hope that Deki-team will soon implement Deki to support this out-of-the-box. </p>
<p>You can use this script for any purpose, just please leave a comment! My blog is hungry <img src='http://www.ebesucher.in/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Download the main script: <a href='http://www.ebesucher.in/wp-content/uploads/2008/11/dekireader.phps'>dekireader.phps</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/email-notifications-for-watchlist-in-dekiwiki/feed/</wfw:commentRss>
		</item>
		<item>
		<title>eLuna unter Ubuntu</title>
		<link>http://www.ebesucher.in/alles/eluna-unter-ubuntu/</link>
		<comments>http://www.ebesucher.in/alles/eluna-unter-ubuntu/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 19:59:56 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<category><![CDATA[computer]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=32</guid>
		<description><![CDATA[Wie installiert man eLuna (Monitoring-Tool) unter Ubuntu?
1) eLuna herunterladen:
wget http://steph.eluna.org/fileadmin/eluna_graph_system/latest/eluna_graph_system.tar.gz
2) eLuna entpacken:
ich mache das immer mit mc
3) eLuna in ein vom www-server erreichbares Verzeichnis legen und vhost einrichten
4) Dependencies erfüllen
sudo apt-get install rrdtool libhtml-template-expr-perl libdatetime-perl
5) Webserver restarten
6) Cronjob einrichten
crontab -e
*/5 * * * * /var/www/graphs/update.pl
So, das wars! Jetzt kann man noch das Verzeichnis mit einem [...]]]></description>
			<content:encoded><![CDATA[<p>Wie installiert man <a href="http://steph.eluna.org/eluna_graph_system.html" title="eLuna" target="_blank">eLuna</a> (Monitoring-Tool) unter Ubuntu?</p>
<p>1) eLuna herunterladen:<br />
wget http://steph.eluna.org/fileadmin/eluna_graph_system/latest/eluna_graph_system.tar.gz</p>
<p>2) eLuna entpacken:<br />
ich mache das immer mit mc</p>
<p>3) eLuna in ein vom www-server erreichbares Verzeichnis legen und vhost einrichten</p>
<p>4) Dependencies erfüllen<br />
sudo apt-get install rrdtool libhtml-template-expr-perl libdatetime-perl</p>
<p>5) Webserver restarten</p>
<p>6) Cronjob einrichten<br />
crontab -e<br />
*/5 * * * * /var/www/graphs/update.pl</p>
<p>So, das wars! Jetzt kann man noch das Verzeichnis mit einem .htpasswd absichern, damit nicht jeder darauf zugreifen kann, und sich über schöne Graphiken freuen!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/eluna-unter-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows crappy Codepage</title>
		<link>http://www.ebesucher.in/alles/windows-crappy-codepage-2/</link>
		<comments>http://www.ebesucher.in/alles/windows-crappy-codepage-2/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 09:55:39 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<category><![CDATA[php computer]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=30</guid>
		<description><![CDATA[Nachdem ich nun über 5 Stunden damit verbracht habe die Umwandlung der Zeichen auf meiner Webseite zu korrigieren, möchte ich das veröffntlichen, damit andere davon einen Nutzen haben.
Umwandlung: latin1 (ISO8859-1) =&#62; utf8
Nun gut, das kann ja php auch von sich aus, dafür gibt es die Funktion utf8_encode(). Aber&#8230; wenn man sie verwendet, stellt man ganz [...]]]></description>
			<content:encoded><![CDATA[<p style="clear: both">Nachdem ich nun über 5 Stunden damit verbracht habe die Umwandlung der Zeichen auf meiner Webseite zu korrigieren, möchte ich das veröffntlichen, damit andere davon einen Nutzen haben.<br />
Umwandlung: latin1 (ISO8859-1) =&gt; utf8</p>
<p style="clear: both">Nun gut, das kann ja php auch von sich aus, dafür gibt es die Funktion utf8_encode(). Aber&#8230; wenn man sie verwendet, stellt man ganz schnell fest, dass einige Zeichen falsch dargestellt werden, z.B. das Euro-Zeichen. Warum ist das so?</p>
<p style="clear: both">Auch wenn man eine Webseite als latin1 deklariert hat, und die Zeichen entsprechend abspeichern möchte, ist Windows da etwas freizügiger und mischt in diese Codierung eigene Zeichen zu, die in latin1 eigentlich gar nicht enthalten sind. Diese zusätzlichen Zeichen ersetzen einige in latin1 definierten Steuerzeichen, die sonst nicht verwendet werden. Diese Mischung nennt Windows CP1252 (CP = Codepage). Interessanterweise werden diese Zeichen aber auch unter MacOsx auf der Webseite richtig dargestellt. Scheinbar haben die Softwarehersteller das einfach so hingenommen. Nur PHP nicht&#8230;</p>
<p style="clear: both">Ich habe mir nun auf der Grundlage von <a href="http://intertwingly.net/stories/2004/04/14/i18n.html#CleaningWindows" target="_blank">dieser I18N Aufstellung</a> eine eigene Umwandlungsfunktion geschrieben, die genau diese Steuerzeichen ersetzt. Die Datei ist zwingenderweise utf8-codiert, das macht aber nichts. Man kann sie einfach in die bestehenden Dateien per include einbinden, die anderen Projektdateien können weiterhin latin1-codiert sein.</p>
<p><a href="http://www.ebesucher.in/wp-content/uploads/2008/10/cp1252_to_utf8.phps" title="Quelltext für die Umwandlungsfuntkion">Quelltext für die Umwandlungsfuntkion: cp1252_to_utf8.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/windows-crappy-codepage-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Private-Key unter MacOsX auf einen entfernten Server kopieren</title>
		<link>http://www.ebesucher.in/alles/private-key-unter-macosx-auf-einen-entfernten-server-kopieren/</link>
		<comments>http://www.ebesucher.in/alles/private-key-unter-macosx-auf-einen-entfernten-server-kopieren/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 23:10:18 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
		
		<category><![CDATA[Alle Posts]]></category>

		<guid isPermaLink="false">http://www.ebesucher.in/?p=23</guid>
		<description><![CDATA[Um einen zuvor erstellten SSH-Key auf einen entfernten Rechner zu kopieren, gibt man auf der Konsole ein:
cat ~/.ssh/id_dsa.pub &#124; ssh medium.ebesucher.de &#8216;cat - &#62;&#62; ~/.ssh/authorized_keys&#8217;
]]></description>
			<content:encoded><![CDATA[<p>Um einen zuvor erstellten SSH-Key auf einen entfernten Rechner zu kopieren, gibt man auf der Konsole ein:</p>
<p>cat ~/.ssh/id_dsa.pub | ssh medium.ebesucher.de &#8216;cat - &gt;&gt; ~/.ssh/authorized_keys&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ebesucher.in/alles/private-key-unter-macosx-auf-einen-entfernten-server-kopieren/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
