Malleable Musings

July 28, 2010

A digression

Filed under: PHP, RSS Feeds, simple hacks, Wordpress — Brendan @ 11:39 pm

I was invited in to a meeting at work a couple of weeks ago in which we were talking about blogging. After the meeting Stu threw a document up on Digress.It.

The document got a few mentions around the place and soon it started gathering a few comments (60 at the time of writing).

Digress.It is a really interesting platform however I think something went wrong with the comments.

I got a call of frustration from a member of the Marketing and Comms team earlier this week, who had been away on annual leave. She was amazed at how many really useful comments there had been. She’d seen some of them but wasn’t sure that she’d read them all of them and she certainly couldn’t do what she wanted which was to print off all of the comments alongside the original document.

I said I’d help and started by working out which RSS feeds were actually functioning (the comments by authors and the comments by numbered paragraph both seemed OK but the later certainly wasn’t displaying properly on Digress.It).

I realised early on that I was never going to manage to script a whole solution and it took a little while, until tonight, when I managed to clear enough time to complete this little digression. So I settled for a quick hack of an existing PHP script with some manual intervention.

What I did was to re-create the document in a Google Spreadsheet alongside the paragraph numbers (which are the keys for the RSS feeds of paragraph comments) and hacked the PHP script to include a request parameter. I also changed the end output slightly so it allowed me to pull down the comments and place them in to the cell next to the original text.

I know there must be a more elegant way of doing this but the document wasn’t that long whilst my time was short and my CSS and PHP skills and knowledge of ASCII/ANSI characters and regular expressions are all a little rusty.

From the spreadsheet it was a simple matter to copy and paste columns C&D in to a table in Word, run a couple of find and replaces, add some minor formatting and hey presto we have something more readable.

It was a nice little refresher for me as I’ve a feeling that I’m going to need to get reacquainted with regular expressions over the coming weeks.

Advertisements

1 Comment »

  1. That was a clever hack. Sorry about the comment error. I’ve not experienced that probem before with digress.it – usually find it pretty robust. I’m waiting for the developer to get back to me and when there’s a fix I’ll let you know

    Comment by Stuart Johnson — August 2, 2010 @ 10:50 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: