I'm having a big overhaul of my online presence, in an attempt to make an impression on my search engine rankings. This might be a pipe dream since I share my name with several pretty influential people, but it can't hurt to try.
I've read lots of advice about personal brand management, and one of the key themes that keeps cropping up is that it's no longer enough to run one website targeting a particular keyword, it's also necessary to be active on the various big social networking websites and to try to get content published in other places. The most obvious way to do this seemed to be to start blogging.
Initially, I thought about setting up a blog on my main website. I rejected the idea of moving the whole site to a content management system because it seemed like a lot of work for relatively little gain. I then considered setting up a Wordpress blog on a subdomain, but again I decided against this for two reasons. Firstly, I would never have been able to find or write a theme that matched the rest of the site, and secondly it wouldn't fulfil the criteria of getting content published in different places.
The solution I chose was to use Google Blogger. I had the foresight to register stephenmitchell.blogspot.com several years ago before the service became as popular as it is now, and it seemed a shame to waste such a good subdomain. Since it isn't part of my website, in my opinion the fact that the themes don't match is less of a problem. Anecdotally, lots of people seem to think that Blogger blogs get indexed faster than content on other websites - this didn't contribute to my decision, but if it's true it'll be a nice bonus.
Setting up a blog is all very well, but it's only useful if people visit it. Realistically my blog is unlikely to come anywhere near the top of the search engine rankings for queries containing my name in the foreseeable future, so I knew I needed some form of link from my main website. A straightforward HTML link might have done the job, but I started thinking how much more professional it would look to have a summary of the last few posts I'd written with links to them. There only seemed to be two ways of doing this: display the whole blog in an iframe, or parse the RSS feed. The second seemed like a much neater solution, and since my website already uses a PHP template this seemed like the obvious language to use.
A little research told me that the way to do this was to use PHP's built-in XML parser, SimpleXML, and a little more research brought me to this very comprehensive tutorial by Marko Randjelovic. Since I wasn't too concerned about styling at this point, I skipped straight to the code. This is fairly straightforward, even for someone like me with only a basic grounding in PHP. The URL of the RSS feed is passed into the simplexml_load_file() function, which returns an object of class SimpleXMLElement. The rest of the code is just a loop that parses the object and echos HTML code for each blog post.
Although simply copying the code into a PHP file and adding parser("http://feeds.feedburner.com/StephenMitchell?format=rss2"); to the appropriate page on my website was enough to get the parser working and generating output, I decided to make a few changes - mainly to the way the HTML output was formatted. Because of the way my website template works, I started by modifying the script to write to and return a string rather than echoing output. I also altered the class of the heading and paragraph tags the script generates to make writing my own CSS easier. I used the explode() function to parse the post date and time and print it in a slightly different format, and made a couple of other cosmetic changes. Some basic CSS styling to remove bullet points from the list that the script generates and set fonts and text sizes completed the project.
I'm now at the stage where the script appears to be stable. Over the next few weeks, I intend to create some content for my blog, and possibly make some more changes to my website which I'll document here. I also have a couple of other projects in the works which I'll start blogging about once I'm far enough through them that I've found something interesting to write about.