<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.haraldkraft.de &#187; php</title>
	<atom:link href="http://blog.haraldkraft.de/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.haraldkraft.de</link>
	<description>Blog Project of Harald Kraft</description>
	<lastBuildDate>Tue, 17 Jan 2012 16:46:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Updated and unified version of standalone SMS extractor for iPhone</title>
		<link>http://blog.haraldkraft.de/2012/01/updated-and-unified-version-of-standalone-sms-extractor-for-iphone/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=updated-and-unified-version-of-standalone-sms-extractor-for-iphone</link>
		<comments>http://blog.haraldkraft.de/2012/01/updated-and-unified-version-of-standalone-sms-extractor-for-iphone/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 22:21:14 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Life and People]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[standalone]]></category>
		<category><![CDATA[text messages]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=453</guid>
		<description><![CDATA[Last year I released a script written in PHP which was able to extract text messages from the iPhone (more specifically: from the SQLite storage container) into a simple TXT file, which was documented in this blog post. The software required a PHP interpreter, which had to be cared for by the user (check the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Last year I released a script written in PHP which was able to extract text messages from the iPhone (more specifically: from the SQLite storage container) into a simple TXT file, which was documented in <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAv" title=\"SMS Extractor for iPhone (written in PHP)\">this blog post</a>. The software required a PHP interpreter, which had to be cared for by the user (check the blog post for details), but was published under <em>CC BY 3.0</em> so the user could make any alteration he desired or deemed necessary.<br />
Some time later I wrote an <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2hhcmFsZGtyYWZ0LmRlL3Ntcy1leHRyYWN0b3Iv" title=\"SMS / text message extraction from iPhone\">online version</a> of the extractor (<a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNi9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAtb25saW5lLXZlcnNpb24v" title=\"Free SMS Extractor for iPhone (written in PHP) – online version\">release blog post</a>), which offered extended functionality and above all no longer needed the user to run the interpreter him- or herself.<br />
However, due to the lack of time I couldn&#8217;t keep the standalone version up to date with the online version and so they diverged.</p>
<p><span id="more-453"></span></p>
<p style="text-align: justify;">As of now I am publishing the updated code of the standalone version, which has partially been re-written in two ways: for one it now comprises of the same functionality as the online version, and for another the coding structure has been reorganized so I can keep the two versions in unison easier. This means that any update or change made to the software will be applied to both versions: the online version will make use of the update whereas the standalone version will be published open source under the same license with the updated code.</p>
<p style="text-align: center;">You can download the updated code <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvP2F0dGFjaG1lbnRfaWQ9NDY0">here</a>.</p>
<p style="text-align: center;"><a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw=="><img style="border-width: 0;" src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="Creative Commons License" /></a><br />
This work is licensed under a <a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw==">Creative Commons Attribution 3.0 Unported License</a>.</p>
<p style="text-align: justify;">Let me quickly list the options which the new standalone version offers (i.e. the differences to the original publication), which are about user customizations:</p>
<ul>
<li><strong>$OUTFILE_TYPE = &#8220;TXT&#8221;</strong><br />
defines whether the type of the output should be in text (<em>TXT</em>) or comma-separated values (<em>CSV</em>). Please note that the file extension you define for <em>$OUTFILE</em> as part of the filename is not taken into consideration; so  e.g. if you want to output a CSV file, setting the outfile name to &#8220;outfile.csv&#8221; is not enough, you need to specifically set <em>$OUTFILE_TYPE</em> to CSV.</li>
<li><strong>$NEWLINE = &#8220;\n&#8221;</strong><br />
defines the format of the system dependent newline. Use <em>\r\n</em> on Windows and <em>\n</em> on Unix/Linux and Mac.</li>
<li>default file opening mode is now &#8220;overwrite&#8221; ( <strong>$f_handle = fopen( $OUTFILE, “w” );</strong> ). If you would like to append extracted text message to the output file rather than overwrite the file use &#8220;<em>a</em>&#8221; instead of &#8220;<em>w</em>&#8220;. Note that the line now moved towards the end of the file.</li>
<li>Change format of output of single text messages<br />
In case of <em>TXT</em> you need to change <strong>$OUTSTRING .= &#8220;$time$senderror$NEWLINE$address$NEWLINE$text$NEWLINE$NEWLINE$NEWLINE&#8221;;</strong> to your liking and in case of <em>CSV</em> change <strong>$OUTSTRING .= &#8220;$address,$time,\&#8221;" . str_replace( &#8220;\&#8221;", &#8220;\&#8221;\&#8221;", $text) . &#8220;\&#8221;$NEWLINE&#8221;;</strong>.<br />
Make sure you only change the format string and leave the <strong>.=</strong> intact <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</li>
</ul>
<p style="text-align: justify;">If you are a new user to this and don&#8217;t know what to do about the <em>user specific CONFIGURATION</em> section or how to run the script, please refer to the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAv" title=\"SMS Extractor for iPhone (written in PHP)\">original blog post</a>, which explains in detail how the standalone version works.</p>
<p style="text-align: justify;">As always you can <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=bWFpbHRvOiU2MiU2QyU2RiU2NyU0MCU2OCU2MSU3MiU2MSU2QyU2NCU2QiU3MiU2MSU2NiU3NCUyRSU2NCU2NQ==">contact me</a> with any remarks you would like to bring to my attention.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=453" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2012/01/updated-and-unified-version-of-standalone-sms-extractor-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free SMS Extractor for iPhone (written in PHP) &#8211; online version</title>
		<link>http://blog.haraldkraft.de/2011/06/sms-extractor-for-iphone-written-in-php-online-version/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sms-extractor-for-iphone-written-in-php-online-version</link>
		<comments>http://blog.haraldkraft.de/2011/06/sms-extractor-for-iphone-written-in-php-online-version/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 21:32:18 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Life and People]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[text messages]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=228</guid>
		<description><![CDATA[A few weeks ago I created a small PHP script that could extract text messages from an iPhone SQLite storage file. It required the user to have a PHP interpreter ready in order to run the script, which might be an obstacle keeping him or her from using the script. Because I&#8217;m currently having more [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAv">A few weeks ago I created a small PHP script</a> that could extract text messages from an iPhone SQLite storage file. It required the user to have a PHP interpreter ready in order to run the script, which might be an obstacle keeping him or her from using the script.</p>
<p style="text-align: justify;">Because I&#8217;m currently having more fun to do some programming in PHP than to rewrite the original script in Java (most people will have a JVM and/or JRE installed), I created a new webpage that uses the original script.</p>
<p><span id="more-228"></span></p>
<p style="text-align: center;">Click: <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2hhcmFsZGtyYWZ0LmRlL3Ntcy1leHRyYWN0b3Iv">SMS / text message extraction from iPhone</a></p>
<p style="text-align: justify;">The usage is simple: select the SQLite database file, make customizations if desired (otherwise default values will be used) and click &#8220;Extract&#8221;. You might have to wait a little while depending on the size of your storage file. After the file has been (automatically) uploaded and messages have been extracted, you will be offered a download prompt for the result file.<br />
See the above page for further details.</p>
<p style="text-align: justify;">Compared to other online solutions out there, this version (as well as the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAvZXh0cmFjdF9zbXMtcGhwLw==">original script</a>) has more ways of tailoring the output to your own needs and the usage is utterly free. However, so far you cannot yet change the arrangement of phone number, date and message in the new online version; if you want to do that, you will still have to use the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAv">original work</a> (which was released under <em>CC BY 3.0</em>).</p>
<p style="text-align: justify;">Please leave comments about the usage into this blog post, so I can improve the page and script if necessary.</p>
<p>Cheers</p>
<p style="text-align: justify;"><strong>UPDATE (21/11/2011):</strong> <em><a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8xMS9jb3JyZWN0LWNzdi1leHBvcnQtZm9yLWZyZWUtaXBob25lLXNtcy1leHRyYWN0b3Iv" title=\"Correct CSV export for free iPhone SMS extractor\">Correct CSV export</a> was added.</em></p>
<p style="text-align: justify;"><strong>UPDATE (05/01/2012):</strong> <em>Now supports iOS 5 container.</em></p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=228" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2011/06/sms-extractor-for-iphone-written-in-php-online-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMS Extractor for iPhone (written in PHP)</title>
		<link>http://blog.haraldkraft.de/2011/05/sms-extractor-for-iphone-written-in-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sms-extractor-for-iphone-written-in-php</link>
		<comments>http://blog.haraldkraft.de/2011/05/sms-extractor-for-iphone-written-in-php/#comments</comments>
		<pubDate>Wed, 11 May 2011 17:51:48 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Life and People]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[text messages]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=150</guid>
		<description><![CDATA[UPDATE (10/06/2011): I started an online version of the script, see new blog post. For a while I&#8217;ve been checking out various programs for extracting and converting text messages from the iPhone SMS storage SQLite database. For some reason they seem to be either for purchase or not doing their job well. When I found [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong>UPDATE (10/06/2011):</strong> <em>I started an online version of the script, see <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNi9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAtb25saW5lLXZlcnNpb24v">new blog post</a>.</em></p>
<p style="text-align: justify;">For a while I&#8217;ve been checking out various programs for extracting and converting text messages from the iPhone SMS storage SQLite database. For some reason they seem to be either for purchase or not doing their job well.<br />
When I found out that all they are doing is pretty much just some simple SQL query and putting the result into various output formats, I decided to quickly write this myself, while keeping it simple and open.</p>
<p><span id="more-150"></span></p>
<p style="text-align: center;"><a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAvZXh0cmFjdF9zbXMtcGhwLw==" rel='attachment wp-att-175'>Download</a></p>
<p style="text-align: justify;">The choice of a programming language wasn&#8217;t easy taking into account that most iPhone users will be on Windows and the extractor should not require major alterations to the system (and doing that without the solution itself being bloated).<br />
Even though the task can be easily done in various languages such as Perl, Python, PHP, C/C++ or Java, I decided to use PHP, because the program can stay very simple and can run with a minimal version of PHP. In addition many users with a Unix/Linux machine available will have PHP installed anyway and can also easily use the program.<br />
That being said we can move on to the program details. The PHP script needs the iPhone SMS storage SQLite database file as input and will then convert all text messages and append them to a file in a certain format.<br />
So far the script is configurable to a certain extent. Naturally the name of the input and output file can be modified. Furthermore you can decide whether you want to extract just incoming or outgoing texts or all of them. Last but not least a date range can be given, from which to extract the messages. See further down (or code) for details about customization.<br />
At this point in time, it is not (yet) possible to limit extraction to a single contact. Even though it might be a common use case for many users, however the format of recipient/sender may vary (at least in my storage file), so it might be hard to determine which number formats are from the same contact.</p>
<p>The usage of the extractor is as follows:</p>
<ol>
<li>First you will need the SMS storage container file (it is usually named <em>3d0d7e5fb2ce288813306e4d4636395e047a3d28</em> and can be found in the iTunes backup folder, which can be found e.g. on Windows7 in <em>C:\Users\[username]\AppData\Roaming\Apple Computer\MobileSync\Backup\[hexstring]</em> or get it directly from your iPhone: <em>/var/mobile/Library/SMS/sms.db</em> )</li>
<li>If you&#8217;re on Unix/Linux, make sure you have PHP5 (along with libs for sqlite) installed. If you&#8217;re on Windows, you can either use the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpbmRvd3MucGhwLm5ldC9kb3dubG9hZHMvcmVsZWFzZXMvcGhwLTUuMi4xNy1XaW4zMi1WQzYteDg2Lm1zaQ==">official PHP installer</a> [alternative: <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpbmRvd3MucGhwLm5ldC9kb3dubG9hZC8=">http://windows.php.net/download/</a>] (just run the installer) or use my <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAvcGhwNS0yLW1pbmltYWwv" rel='attachment wp-att-179'>minimized packaged version of PHP</a> (just unpack to a location of your desire)</li>
<li>Download the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvMjAxMS8wNS9zbXMtZXh0cmFjdG9yLWZvci1pcGhvbmUtd3JpdHRlbi1pbi1waHAvZXh0cmFjdF9zbXMtcGhwLw==" rel='attachment wp-att-175'>SMS Extractor for iPhone (extract_sms.php_.txt)</a>, rename it to <em>extract_sms.php</em> and use a text editor of your desire to make configuration changes (see below and/or follow the instructions and explanations in the code)</li>
<li>If you used the PHP installer, navigate to the folder containing extract_sms.php and double-click on it (make sure you placed the SMS storage container file in the same directory and modified the input configuration)</li>
<li>If you used my minimized version, place extract_sms.php in the same folder you unpacked the PHP archive; use Start, Run&#8230;, &#8220;cmd.exe&#8221; and navigate to the correct folder / if you&#8217;re on Unix/Linux, navigate to the folder you downloaded extract_sms.php)</li>
<li>(make sure you placed the SMS storage container file in the same directory and modified the input configuration) then run the script typing &#8220;php extract_sms.php&#8221;</li>
<li>Unless you changed the output file, you will find a file &#8220;sms.txt&#8221; in the same folder</li>
</ol>
<p style="text-align: justify;">Possible customization can be done in the following ways (look for &#8220;<em>user specific CONFIGURATION</em>&#8221; in extract_sms.php ):</p>
<ul>
<li><strong>$DATABASE = &#8220;sms.db&#8221;</strong><br />
change this to the appropriate filename if your SMS storage container file is named differently</li>
<li><strong>$TIME_FORMAT = &#8220;d.m.Y H:i:s&#8221;</strong><br />
the internal text message timestamp is the number of seconds since Unix Epoch, so in order to make this human readable, provide the time format of your desire (see http://www.php.net/manual/en/function.date.php for details)</li>
<li><strong>$FILTER = &#8220;ALL&#8221;</strong><br />
set here whether you would like to limit extraction to only incoming text messages (&#8220;<em>IN</em>&#8220;), or only outgoing messages (&#8220;<em>OUT</em>&#8220;) or no limit (&#8220;<em>ALL</em>&#8220;)</li>
<li><strong>$OUTFILE = &#8220;./sms.txt&#8221;</strong><br />
name for the output file, you can change this to any name with or without file extension</li>
<li><strong>date_default_timezone_set(&#8216;Europe/Berlin&#8217;)</strong><br />
if you want to use a time range (see next item), you need to specify your timezone (which supposedly equals the timezone your text messages got timestamped). See <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L21hbnVhbC9lbi90aW1lem9uZXMucGhw">http://www.php.net/manual/en/timezones.php</a> for available timezones</li>
<li><strong>$RANGE_BEGIN = mktime( 22, 45, 00, 11, 9, 2009 )</strong> and/or <strong>$RANGE_END = mktime( 22, 55, 00, 11, 9, 2009 )</strong><br />
if you want to use a time range, you can configure either a start or an end of range or even both. The order of comma separated digits in parentheses is: <em>hour, min, sec, mon, day, year</em>. Also, you need to uncomment (i.e. remove the leading <strong>//</strong>) the line of the variable(s) you want to use</li>
<li>Replace file instead of appending ( <strong>$f_handle = fopen( $OUTFILE, &#8220;a&#8221; );</strong> )<br />
the default behavior is to open the output file in append mode in order to avoid accidental overwrite. If you would like replace the output file instead of appending the extracted text messages, put &#8220;<em>w</em>&#8221; instead of &#8220;<em>a</em>&#8220;</li>
<li>Change output format ( <strong>fwrite( $f_handle, &#8220;$time$senderror\n$address\n$text\n\n\n&#8221; );</strong> )<br />
if you would like to change the format in which the script is putting your extracted text message information, you will need to change this line appropriately. However, I cannot provide a manual how to change it to your liking at this moment; you will either know what you&#8217;re doing or have to google and trial &#8216;n error <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ul>
<p style="text-align: justify;">Please feel free to comment about the usage or drop me an email at <span id="emob-oybt@unenyqxensg.qr-86">blog {at} haraldkraft(.)de</span><script type="text/javascript">
    var mailNode = document.getElementById('emob-oybt@unenyqxensg.qr-86');
    var linkNode = document.createElement('a');
    linkNode.setAttribute('href', "mailto:%62%6C%6F%67%40%68%61%72%61%6C%64%6B%72%61%66%74%2E%64%65");
    tNode = document.createTextNode("blog {at} haraldkraft(.)de");
    linkNode.appendChild(tNode);
    linkNode.setAttribute('id', "emob-oybt@unenyqxensg.qr-86");
    mailNode.parentNode.replaceChild(linkNode, mailNode);
</script>. It&#8217;s fine with me to continue development and add new (simple) features, and definitely fix bugs I might have there in PHP; just let me know <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p style="text-align: center;">Also, please do use my script for your adaptions; I am releasing this under CC.<br />
<a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw=="><img style="border-width: 0;" src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="Creative Commons License" /></a><br />
This work is licensed under a <a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw==">Creative Commons Attribution 3.0 Unported License</a>.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=150" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2011/05/sms-extractor-for-iphone-written-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebCalendar is not working with Lightning or Sunbird</title>
		<link>http://blog.haraldkraft.de/2009/09/webcalendar-is-not-working-with-lightning-or-sunbird/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=webcalendar-is-not-working-with-lightning-or-sunbird</link>
		<comments>http://blog.haraldkraft.de/2009/09/webcalendar-is-not-working-with-lightning-or-sunbird/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 20:19:38 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[lightning]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sunbird]]></category>
		<category><![CDATA[thunderbird]]></category>
		<category><![CDATA[webcalendar]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=71</guid>
		<description><![CDATA[After using WebCalendar for quite I while, I finally got to the bottom of the problem, why it wasn&#8217;t working as a remote calendar in Mozilla Sunbird or in the Thunderbird extension Lightning. Following the official description how to subscribe to a remote calendar did add the calendar successfully, but showed a yellow warning sign [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">After using <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5rNW4udXMvd2ViY2FsZW5kYXIucGhw">WebCalendar</a> for quite I while, I finally got to the bottom of the problem, why it wasn&#8217;t working as a remote calendar in Mozilla Sunbird or in the Thunderbird extension Lightning.</p>
<p style="text-align: justify;">Following the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5rNW4udXMvd2lraS9pbmRleC5waHA/dGl0bGU9UmVtb3RlX1B1Ymxpc2hpbmdfd2l0aF9TdW5iaXJk">official description</a> how to subscribe to a remote calendar did add the calendar successfully, but showed a yellow warning sign with the caption </p>
<blockquote><p>The calendar foobar is momentarily not available</p></blockquote>
<p><span id="more-71"></span>This message actually points to a connection problem, network wise or maybe concerning the webserver. Even though I had done everything according to the description, it didn&#8217;t help.<br />
For a long time, this was the status quo &#8211; surprisingly the calendar worked from time to time, without any explanation.</p>
<p style="text-align: justify;">However, trying to open an exported .ics file with Lightning/Sunbird pointed me into another direction, because it <em>still</em> claimed to be momentarily not available, even though no network or other connection was involved.<br />
Honestly, I should have tried it before, but this was the first time I opened Thunderbird&#8217;s <em>Error Console</em> to see a more descriptive warning message:</p>
<blockquote><p>Warning: There has been an error reading data for calendar: foobar. Error code: CAL_UTF8_DECODING_FAILED. Description: An error occurred while decoding an iCalendar (ics) file as UTF-8. Check that the file, including symbols and accented letters, is encoded using the UTF-8 character encoding.</p></blockquote>
<p>and if any Germans have this problem:</p>
<blockquote><p>Warnung: Fehler beim Lesen von Daten für Kalender: foobar. Fehlercode: CAL_UTF8_DECODING_FAILED. Beschreibung: Ein Fehler ist beim Dekodieren einer iCalendar(ics)-Datei als UTF-8 aufgetreten. Überprüfen Sie, dass die Datei, inklusive Symbolen und akzentierten Buchstaben, mit dem UTF-8-Zeichensatz kodiert ist.</p></blockquote>
<p style="text-align: justify;">So, obviously it was an encoding problem. I tried to save the exported ICS file in several encodings and could open it with Sunbird/Lightning if it was properly encoded in UTF-8.<br />
The message in Thunderbird&#8217;s error console finally made it easy to google the problem (as opposed to the warning caption telling me that the calendar was momentarily not available). People seemed to have this very problem when they used special characters in their WebCalendar. And in fact, as I removed the special characters I was using in some event descriptions, loading the calendar in Lightning worked just fine.</p>
<p style="text-align: justify;">One solution for the problem is not to use any special characters, the other one is just a workaround until they fix this issue (which is still commented as a <em>TODO</em> in the code btw <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ): <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NvdXJjZWZvcmdlLm5ldC90cmFja2VyL2luZGV4LnBocD9mdW5jPWRldGFpbCYjMDM4O2FpZD0yMTM2MjMyJiMwMzg7Z3JvdXBfaWQ9Mzg3MCYjMDM4O2F0aWQ9MTAzODcw">This WebCalendar SourceForge Bugtracker comment</a> tried to comment out a few lines in the WebCalendar source code. The final code of my <em>&#8220;webcalendar-dir&#8221;/includes/classes/WebCalendar.class</em> now looks like this (around line 870 in v1.2.0):<br />
<pre><code>// if (extension_loaded('mbstring')) {
//   $mb_lang = strtok($lang, '-');
//   if (mb_language($mb_lang) &amp;&amp; mb_internal_encoding(translate('charset'))) {
//      $enable_mbstring = true;
//   } else {
        $enable_mbstring = false;
//   }
// }</code></pre><br />
This workaround works fine for me at the moment. Hope it does as well for anybody having this problem <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Please do comment your experiences.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=71" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2009/09/webcalendar-is-not-working-with-lightning-or-sunbird/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Invalid command &#8216;Script&#8217; in Apache configuration</title>
		<link>http://blog.haraldkraft.de/2009/08/invalid-command-script-in-apache-configuration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=invalid-command-script-in-apache-configuration</link>
		<comments>http://blog.haraldkraft.de/2009/08/invalid-command-script-in-apache-configuration/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 11:14:00 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=45</guid>
		<description><![CDATA[While I was trying to allow some tool&#8217;s PHP file to perform the HTTP command PUT, the tool&#8217;s manual said to put the following code in the httpd.conf Apache configuration file: &#60;Directory /foo/bar&#62; Script PUT /some.php &#60;/Directory&#62; And so I did. But when I tried to reload Apache&#8217;s configuration (/etc/init.d/apache2 reload), Apache complained with the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">While I was trying to allow some tool&#8217;s PHP file to perform the HTTP command <em>PUT</em>, the tool&#8217;s manual said to put the following code in the <em>httpd.conf</em> Apache configuration file:</p>
<p><code>&lt;Directory /foo/bar&gt;<br />
Script PUT /some.php<br />
&lt;/Directory&gt;</code></p>
<p style="text-align: justify;">And so I did. But when I tried to reload Apache&#8217;s configuration (<em>/etc/init.d/apache2 reload</em>), Apache complained with the following message:</p>
<blockquote><p>Invalid command &#8216;Script&#8217;, perhaps misspelled or defined by a module not included in the server configuration<br />
<span style="color: #ff0000;">failed!</span></p></blockquote>
<p><span id="more-45"></span></p>
<p style="text-align: justify;">At this point in time, Google didn&#8217;t have any results for the error string, and this is why I am actually writing this blog entry.</p>
<p style="text-align: justify;">Searching for Apache2&#8242;s directive <strong>Script</strong> got me to <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2h0dHBkLmFwYWNoZS5vcmcvZG9jcy8yLjIvbW9kL21vZF9hY3Rpb25zLmh0bWwjc2NyaXB0">this Apache doc</a> where you can see that the directive <strong>Script</strong> is part of the module <strong>mod_actions</strong>.<br />
As already mentioned in the error message, a module was not included, now I knew that it would probably be the <em>mod_actions</em> module. Enabling the module by symlinking it from <em>mods-enabled</em> to <em>mods-available</em> made the error message disappear and everything working just fine:</p>
<blockquote><p>ln -s /etc/apache2/mods-available/actions.load /etc/apache2/mods-enabled/actions.load<br />
ln -s /etc/apache2/mods-available/actions.conf /etc/apache2/mods-enabled/actions.conf</p></blockquote>
<p style="text-align: justify;">Hope this helps to offer a quick solution for the error message.</p>
<p style="text-align: justify;">Btw, while looking for fixes, I stumpled across <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hcGFjaGV3ZWVrLmNvbS9mZWF0dXJlcy9wdXQ=">this page</a>, which offers further information about how to use Apache&#8217;s <strong>Script</strong> directive.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=45" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2009/08/invalid-command-script-in-apache-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter PHP script</title>
		<link>http://blog.haraldkraft.de/2009/06/twitter-php-script/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter-php-script</link>
		<comments>http://blog.haraldkraft.de/2009/06/twitter-php-script/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 00:19:25 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Life and People]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=19</guid>
		<description><![CDATA[I wrote this PHP script in order to include the latest tweets from my Twitter on my website. It retrieves the RSS feed, parses it and pastes a number of tweets (along with timestamp and link) to HTML. [[ OLD: Before I can / want to release it under some free software license, I would [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote this PHP script in order to include the latest tweets from my Twitter on my <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2hhcmFsZGtyYWZ0LmRl">website</a>. It retrieves the RSS feed, parses it and pastes a number of tweets (along with timestamp and link) to HTML.</p>
<p><em>[[ OLD:<br />
Before I can / want to release it under some free software license, I would appreciate it if some of you PHP nerds could review the code. I am mainly concerned about security issues rather than formatting and coding style. Since I am no pro in PHP coding, I will probably have done some things quite clumsily.</p>
<p>So please point out security problems as well as other major issues. (For example, if anybody knows how to stop parsing after max items were dealt which, please let me know <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).<br />
]]</em></p>
<p><em>[UPDATE 07/08/2009]</em><br />
(HTTP) Links are now made clickable.<br />
<em>[/UPDATE]</em></p>
<p><em>[UPDATE 15/12/2009]</em><br />
The script was <strong>released</strong> under the Creative Commons Attribution 3.0 Unported License today.<br />
Download the PHP code at <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvd3AtY29udGVudC91cGxvYWRzLzIwMDkvMTIvcGFyc2V0d2l0dGVyLnBocF8udHh0">http://blog.haraldkraft.de/wp-content/uploads/2009/12/parsetwitter.php_.txt</a> and feel free to reuse and tweak my script (along with mentioning my name as suggested in the license information in the code).<br />
<em>[/UPDATE]</em></p>
<p>Email me at <span id="emob-oybt@unenyqxensg.qr-17">blog {at} haraldkraft(.)de</span><script type="text/javascript">
    var mailNode = document.getElementById('emob-oybt@unenyqxensg.qr-17');
    var linkNode = document.createElement('a');
    linkNode.setAttribute('href', "mailto:%62%6C%6F%67%40%68%61%72%61%6C%64%6B%72%61%66%74%2E%64%65");
    tNode = document.createTextNode("blog {at} haraldkraft(.)de");
    linkNode.appendChild(tNode);
    linkNode.setAttribute('id', "emob-oybt@unenyqxensg.qr-17");
    mailNode.parentNode.replaceChild(linkNode, mailNode);
</script> (or comment)</p>
<p><a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw=="><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br />This work is licensed under a <a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw==">Creative Commons Attribution 3.0 Unported License</a>.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=19" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2009/06/twitter-php-script/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

