<?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>Christian Riesen &#187; MediaWiki</title>
	<atom:link href="http://christianriesen.com/tag/mediawiki/feed/" rel="self" type="application/rss+xml" />
	<link>http://christianriesen.com</link>
	<description>Life and work in the information and communication age</description>
	<lastBuildDate>Mon, 12 Jul 2010 10:39:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Programming helping the writer and getting more exposure</title>
		<link>http://christianriesen.com/2010/03/programming-helping-the-writer-and-getting-more-exposure/</link>
		<comments>http://christianriesen.com/2010/03/programming-helping-the-writer-and-getting-more-exposure/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 13:37:28 +0000</pubDate>
		<dc:creator>Christian Riesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Toreas]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XML-RPC]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Zend_Http_Client]]></category>

		<guid isPermaLink="false">http://christianriesen.com/?p=160</guid>
		<description><![CDATA[Writing is fun, but takes up a lot of time. Something t [...]]]></description>
			<content:encoded><![CDATA[<p>Writing is fun, but takes up a lot of time. Something that also takes up a lot of time is the things around writing. Those other things take time away from the more fun part of the general just writing the story. Now wouldn&#8217;t it be great if that was no longer the case?</p>
<p>Taking my little experiment Toreas, the <a href="http://toreas.com/" onclick="pageTracker._trackPageview('/outgoing/toreas.com/?referer=');">free fantasy book</a> or novel if you like, as a sample, I was in updating hell. The page itself where the book is readable from is an instance of <a href="http://www.mediawiki.org/" onclick="pageTracker._trackPageview('/outgoing/www.mediawiki.org/?referer=');">MediaWiki</a>. I chose it for the ease of adding new things, a good and stable code base, but also because I had a lot of experience in extending it. Then I wanted to add notes to each release and of course that looks like a blog. So my number one choice was simply <a href="http://wordpress.org/" onclick="pageTracker._trackPageview('/outgoing/wordpress.org/?referer=');">WordPress</a> (which also powers this site), for a lot of the same reasons that MediaWiki was the page software. Twitter is not a software for me, but a web service as such and I wanted to add tweets as soon as there is a new chapter out (even though there probably is nobody reading those). I also have plans to include more services, like Facebook, but I have not yet come around to those.</p>
<p>So, a new chapter is out. I have to edit 4 MediaWiki pages (3 of those templates), one of them I have to calculate newly with a script I have written. So for calculating the <a href="http://toreas.com/Statistics" onclick="pageTracker._trackPageview('/outgoing/toreas.com/Statistics?referer=');">statistics</a> I have to open the template (which requires editing the main article first to get the edit link) run from a website a script that calls up each and every page already created and creates the stats out of that in wikitext. Now I copy paste this over from my script to the template and save it. Next I have to login to twitter, post the comment in the right format. And last but not least post the blog post on the page, again logging in, selecting the right category and tags and so on and so forth. All of this made it a horror to update and I frankly found myself thinking a few times to delay an update just because of this horrible (admittedly self induced) process.</p>
<p>Then I stumbled across an artifact in my memory. <a href="http://www.mediawiki.org/wiki/API" onclick="pageTracker._trackPageview('/outgoing/www.mediawiki.org/wiki/API?referer=');">MediaWiki has an API</a>. Looking at it <a href="http://en.wikipedia.org/w/api.php" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/w/api.php?referer=');">closely</a> I found that you could login, open pages and edit them. You could do pretty much anything with it, but those were my only requirements. After looking around a bit, I found a class named Snoopy that is supposed to take care of it, but it was still too much &#8220;manual labor&#8221; on my side. So A quick check on ZendFramework and in the Http Client library I found all the parts that I needed to make this work. I could define one client and use it like a browser. It would even keep the cookies for me and do all that handling.</p>
<p>So I whipped up my own MediaWiki API class, based on Zend_Http_Client. It actually uses the autoloader as well, but that&#8217;s because I&#8217;m lazy. So now I instantiate it by handing it the api url, a user name and password, and the whole thing is ready for duty. A get function gives me the content (needed for the latest changes, where I kill the last line in the box and add a new one on top) and an edit function that allows me to simply overwrite the current version. All the magic is done behind the scenes and no worries for me. Twitter of course also has an API to which Zend already has Zend_Service_Twitter. Again, three lines and the new status is posted. And lastly, WordPress has an XMLPRC interface, which has had me quiet confused for a while. Now that I understand it (or at least I think I do) I am able to post news in there by just supplying a title and description, while the tags and categories are preset (for this particular thing).</p>
<p>My 20 minutes of monkeying around with everything, plus additional time for writing a blog post if I was so inclined to do, has been reduced to copy pasting the story (then write the blog post) and hit a button. So for the last eight chapters I have lost two and a half hours of time, which no longer happens. Not only do I gain time, but the step to actually publish the next chapter has become pretty much nothing, as opposed to the big process it has been before.</p>
<p>Once I clean up the API class a little, I might even release my code for the MediaWiki class.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank" onclick="pageTracker._trackPageview('/outgoing/flattr.com/?referer=');">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank" onclick="pageTracker._trackPageview('/outgoing/flattr.com/?referer=');"><img src="http://christianriesen.com/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://christianriesen.com/2010/03/programming-helping-the-writer-and-getting-more-exposure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
