Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

October 16 2010

13:39

ScraperWiki: Hacks and Hackers day, Manchester.

If you’re not familiar with scraperwiki it’s ”all the tools you need for Screen Scraping, Data Mining & visualisation”.

These guys are working really hard at convincing Journos that data is their friend by staging a steady stream of events bringing together journos and programmers together to see what happens.

So I landed at NWVM’s offices to what seems like a mountain of laptops, fried food, coke and biscuits to be one of the judges of their latest hacks and hackers day in Manchester (#hhhmcr). I was expecting some interesting stuff. I wasn’t dissapointed.

The winners

We had to pick three prizes from the six of so projects started that day and here’s what we (Tom Dobson, Julian Tait and me)  ended up with.

The three winners, in reverse order:

Quarternote: A website that would ‘scrape’ myspace for band information. The idea was that you could put a location and style of music in to the system and it would compile a line-up of bands.

A great idea (although more hacker than hack) and if I was a dragon I would consider investing. These guys also won the Scraperwiki ‘cup’ award for actually being brave enough to have a go at scraping data from Myspace. Apparently myspace content has less structure than custard! The collective gasps from the geeks in the room when they said that was what they wanted to do underlined that.

Second was Preston’s summer of spend.  Local councils are supposed to make details of any invoice over 500 pounds available, and many have. But many don’t make the data very useable.  Preston City council is no exception. PDF’s!

With a little help from Scraperwiki the data was scraped, tidied and put in a spreadsheet and then organised. It through up some fun stuff – 1000 pounds to The Bikini Beach Band! And some really interesting areas for exploration – like a single payment of over 80,000 to one person (why?) – and I’m sure we’ll see more from this as the data gets a good running through.  A really good example of how a journo and a hacker can work together.

The winner was one of number of projects that took the tweets from the GMP 24hr tweet experiment; what one group titled ‘Genetically modified police’ tweeting :). Enrico Zini and Yuwei Lin built a searchable GMP24 tweet database (and a great write up of the process) of the tweets which allowed searching by location, keyword, all kinds of things. It was a great use of the data and the working prototype was impressive given the time they had.

Credit should go to Michael Brunton-Spall of the Guardian into a useable dataset which saved a lot of work for those groups using the tweets as the raw data for their projects.

Other projects included mapping deprivation in manchester and a legal website that if it comes off will really be one to watch. All brilliant stuff.

Hacks and hackers we need you

Give the increasing amount of raw data that organisations are pumping out journalists will find themselves vital in making sure that they stay accountable. But I said in an earlier post that good journalists don’t need to know how to do everything, they just need to know who to ask.

The day proved to me and, I think to lots of people there,  that asking a hacker to help sort data out is really worth it.

I’m sure there will be more blogs etc about the day appearing over the next few days.

Thanks to everyone concerned for asking me along.

September 21 2010

12:47

How to create a wordpress magazine theme using Twenty Ten – Part 1

This is part one of a short series outlining how to tweak a wordpress template to get some magazine style functionality.

I’m in the process of updating installations of wordpress for our students to use. In one sense it’s a stop gap measure as we are in the process of commissioning a more “industrial strength” system for them. But even with a new system in place I think we will still leave some courses the option of going the wordpress route. The magazine students for example, love the flexibility (and low level of tech) that design templates offer. It doesn’t seem to have done them any harm in terms of nominations.

When it comes to design, finding a wordpress template you like is half the battle, there are thousands out there. As more people use wordpress to get publications online, magazine style templates have become a popular search and a big growth area for premium template developers.

It’s tempting to pay for a template you like – nothing wrong with that. But it’s not as complicated as you think to get something up and running, out of the box, with very little tinkering. Especially if you build on existing templates. So I thought it would be useful to look at how easy it would be modify the standard Twentyten theme in to something with some magazine functionality.

Hacking around like this is how I learnt a lot of stuff about wordpress and it’s also a way to get your feet wet with a programming language. In this case PHP

To play along with this you’ll need:

  • Your own installation of the latest version of the wordpress.org software (as I write this it’s 3.0.1). Sorry wordpress.com won’t do.If you have webspace and your thinking of adding wordpress you could do worse than check out the wordpress codex entry on installing wordpress. Some hosts will offer automated installation of wordpress – very useful.
  • A text editor. Even word will do.

That’s it.

The design

The adapted Twenty Ten Theme

This is a screenshot of what we are going to end up with. It has a front page that has a featured post at the top and sections underneath for each category. You’ll also notice that I’ve tinkered around with the header to remove the big image. OK, it’s not going to win any design awards but this is more about exploring the concepts.

Normally you’d plan this kind of thing on paper first. You’d also work on the code in a development environment. An installation of WordPress that only runs on your machine, not the web.

If you’re feeling really brave you can set one up. Here are few resources

I’m going to assume that we dive straight in and edit the template live! I know, bad, bad, bad. All I’m going to say is do so at your own risk.

A word on programming and PHP

WordPress is written in a programming language called PHP.  This isn’t a programming tutorial (I’m not going to explain the basics of programming), but there are a couple of important things to know.

Spotting PHP

You may already be familiar with HTML. You can spot it in the raw code for a webpage because it is contained in pointy – brackets.

[html]

Anything here will appear as a heading two

[/html]

In a similar way, you can spot PHP in the raw code for a webpage because it is always between  <?php …. ?>. Here’s an example:

[php]

[/php]

But if you look at the source for this webpage in your browser you will only see HTML. Why don’t we see the PHP?

PHP is a server side language. That means the webserver looks at the page and processes any PHP it finds before it sends you the page. When we use PHP as part of wordpress themes we are using it to generate HTML.

Functions

When programmers write code they will always look for ways to avoid repetitive jobs. Rather than write the same code every time, they write a function. This is a set of instructions that can be called when needed.  The example of PHP above is a function:

[php]

[/php]

Whenever we want to show the title of post we call the function the_title() and the server runs the code needed to get all the right information. The semi-colon is also important. Here’s another example:

[php]

[/php]

This time it’s a function to show a thumbnail for a post. But there is also some content in the brackets. This is a parameter or extra information that the function might need. When the server runs the function to get the post thumbnail it tells the function it wants the thumbnail sized thumbnail. I know, sounds like repetition. We could also say:

[php]

[/php]

That says ‘get the thumbnail but make it medium sized’. In case you were interested, the thumbnail and medium sizes are defined in the media settings of your blog. But more on that later.

There are hundreds of these functions in wordpress. Some are specific to templates, like the examples above, but others do the heavy lifting of making the blog work. We’ll be scratching the surface of the template functions here but I thought it was worth a little intro.

So we are going to be looking at a little PHP to call some functions to help us modify the TwentyTen template. Hopefully, now, that might statement might make a bit more sense.

How wordpress themes work.

You can get a really good overview of the way themes work from the wordpress codex and plenty of other websites around. A google search for wordpress theme tutorials should give you plenty of options. But let’s break it down in to a few simple ideas.

A wordpress theme is split in to parts:

  • the content you want in a structured form
  • instructions on the way you want it to look.

This information is held in a number of different files.  These are stored in a folder, one for each theme, in the WP_content/themes folder of your wordpress installation. The more complex the theme, the more files there tend to be.

In a basic theme, for example, you will have a file called single.php. That’s the content and structure part. This is a mixture of HTML and PHP. But the way it looks, the colour and style of text, position on the page etc is controlled by a file called style.css. This is a cascading style sheet file.

The Twentyten theme we are going to edit, has 18 content and structure files and four style sheet files. We wont be using all of these for this tutorial. We are only interested in two.

  • Main Index Template (index.php)
  • Stylesheet (style.css)

Accessing template files

There are several ways we can get at these files:

Any of those will do. But I’m going to work through on the assumption you are using the built in editor.

First thing to do is check you have the TwentyTen theme activated by going to Appearance >Themes. It should show Twenty Ten as the current theme. Then click through to the editor panel (Appearance > Editor).

The Theme editor

You’ll see a list of the 18 template files down the right-hand side and an editor window. By default this displays the Visual Editor Stylesheet (editor-style.css). All  you need to do is find and click Main Index Template or Stylesheet on the right to load up the files we will be working with.

Permission to edit.

When you look at the bottom of the editor window you may see a warning: – You need to make this file writeable before you can save your changes

You need to set the permissions on the theme folder!

This could be the biggest stumbling block of the process. But if you are serious about having a go at theme development, even tweaking like this, it’s worth getting your head round.

To remove the error message you need to set the permissions for the Twenty Ten folder to be 666.

Does that make no sense? You could try:

If you set the permissions correctly, the message should be replaced by a big Update File button.

You're ready to start editing!

Some final preparation

From this point I’m going to assume that you have a working installation of wordpress up and running. But before we experiment with the theme we need to have some content to work with. So if your blog doesn’t have posts yet you need to add a few posts to work with. You could do this manually using the lipsum.com, a lorem-ipsum generator and some liberal cut and paste for content. There are also a number of random content generator plugins available. For this exercise I used demo data creator.

We will also need to create some categories and assign the posts across the categories. I’ve used the following for this demo:

  • News
  • Sport
  • Featured Story

Once you have done that we are ready for Part 2 tomorrow, where we will start to edit the front page to get that magazine look.

As always, feedback and suggestions always welcome

August 09 2010

14:30

How to be a Local Sports Reporter : How to Write Good Sports Journalism

Learn how to write good sports journalism as aprofessional sports broadcaster with expert broadcasting tips in this free online sports journalism video clip. Expert: Jamal Spencer Bio: Jamal Spencer has worked for ABC 53 in Lansing for 2 years. He started as an intern and now has a full-time position helping run the sports department at ABC 53. Filmmaker: Bartholomew DiVietri
Video Rating: 5 / 5

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl