Tag Archives: Javascript

Tool of the week for journalists – Codeacademy, for those who want to start to code

Tool of the week: Codeacademy

What is it? Free tutorials in basic JavaScript

How is it of use to journalists?  The rise in data journalism, an interest in Hacks/Hackers meetups and collaboration between journalists and developers has led to many journalists to express a wish to start coding. But where to start?

Codeacademy is a learning tool that offers tutorials to get you started. So far there are only a couple of courses on the site but they are free and superbly designed.

The homepage gets you to begin entering a bit of JavaScript and you soon find yourself progressing though the tutorial. There is a progress bar to show you how much of the course you have completed and reward badges to give you the equivalent of the teacher’s gold star.

You might well find you quickly learn simple JavaScript that has a useful application for you as a journalist. For example, within the first five minutes you learn that writing “.length” at the end of a word or phrase gives you the character count. You can then open an editor (using Chrome from a Mac the command is ALT+CMD+J), paste the headline of a news story, add “.length” and you will have the character count of the headline.

 

How much computer science does a journalist really need?

Earlier this month, Columbia University announced that the first ever journalism and computer science degree will launch in the autumn of 2011. Perhaps it’s a positive reaction to all the technological uncertainty that journalists face, but some perspective is also needed.

The digital trinity

Good digital publishing requires expertise in three completely separate disciplines, all of which are callings in their own right.

As journalists we’re all here because we want to tell a good story, so we apply our presentation skills, written, audio or visual, along with our ability to make an intelligent overview.

To ensure that our work then reaches the largest possible online audience we work with designers, who are highly artistic, and web developers who tend to be mathematically astute computer scientists. When it all works together the result can be great, interactive, accessible and attractive online content. Victory.

So much as any attempt to bring journalists closer to technology should be warmly embraced, there has to be an understanding that shoehorning a journalist into a programmer’s role, and vice-versa, probably isn’t going to produce the best results. These are much more likely to come from having a good team around you, by understanding each other’s limitations and, above all, by working well together.

Life. Time. Dedication

It is rather like being in a band, in the sense that you can’t play the drums and the guitar at the same time. Success comes from having talented people who understand each other and can communicate ideas between themselves fluently. And it follows that the more time you spend working in tandem, the more seamless the work becomes.

Our in-house web developer Xavi Esteve (who has been pursuing his passion since he was 10 years old) informs me that a good programmer needs about 200 hours to get to grips with the basics. You then need to dedicate yourself to trying, failing, debugging and doing it all over and over again. It is the only way to learn.

This is all he’s been doing for 40 – 50 hours a week for five years and he still only specialises in certain defined areas. If we wanted to develop and app in Flash, for example, we would probably have to get an Actionscript specialist in specifically for this purpose, even though Xavi has easily got more than 10,000 professional programming hours to his name.

So three semesters in Columbia’s engineering school and two in the journalism department will only be scratching the surface. They’re hoping to create “graduate students with both the editorial and technological skills to produce new applications and online tools that could help redefine journalism in a fast-changing digital media environment”. That will probably take a wee while longer.

Be informed, be practical

Knowing your PHP and Java Script from your Python and Visual-Basic is undoubtedly helpful but having an overview of these things is much more important than trying to become a coding ninja yourself. Xavi says:

The main problem with some journalists is that they don’t have an awareness of what is possible and what isn’t, and what is best practice. Having a basic understanding will make them more practical and allow us to work much faster together.

The good news here is that this is where a journalist’s natural talents can come into play. We can all get the requisite knowledge through research and selectively extracting the necessary information.

Those of you, like me, who barely have enough reading time in your lives already, should also make sure you add a talented front end web developer to your list of essential journalistic contacts.

We all have a directory of useful people we make sure we take out for a coffee every once in a while. Like PRs and industry insiders, web developers are another specialist you should have on speed dial. Tapping up the experts for information is what we journalists are supposed to be best at after all.

Here are some useful links for grabbing the basics:

A wide array of tutorials,  in HTML, CSS and JavaScript.

This is the website of the W3C (World Wide Web Consortium, the ones that work to standardise the Internet) and it is great. It has tutorials for HTML, CSS, XML, PHP, ASP, JavaScript and MySQL.

It includes tutorials for Photoshop, Dreamweaver, Illustrator, InDesign, Flash and ActionScript.

John Hillman is the editor of PC Site which reviews and compares laptops and software. Follow him on Twitter: @JohnjHillman

Hacks and Hackers play with data-driven news

Last Friday’s London-based Hacks and Hacker’s Day, run by ScraperWiki (a new data tool set to launch in beta soon), provided some excellent inspiration for journalists and developers alike.

In groups, the programmers and journalists paired up to combine journalistic and data knowledge, resulting in some innovative projects: a visualisation showing the average profile of Conservative candidates standing in safe seats for the General Election (the winning project); graphics showing the most common words used for each horoscope sign; and an attempt to tackle the various formats used by data.gov.uk.

One of the projects, ‘They Write For You’ was an attempt to illustrate the political mix of articles by MPs for British newspapers and broadcasters. Using byline data combined with MP name data, the journalists and developers created this pretty mashup, which can be viewed at this link.

The team took the 2008-2010 data from Journalisted and used ScraperWiki, Python, Ruby and JavaScript to create the visualisation: each newspaper shows a byline breakdown by party. By hovering over a coloured box, users can see which MPs wrote for which newspaper over the same two year period.

The exact statistics, however, should be treated with some caution, as the information has not yet been cross-checked with other data sets.  It would appear, for example, that the Guardian newspaper published more stories by MPs than any other title, but this could be that Journalisted holds more information about the Guardian than its counterparts.

While this analysis is not yet ready to be transformed into a news story, it shows the potential for employing data skills to identify media and political trends.

#DataJourn part 2: Q&A with ‘data juggler’ Tony Hirst

As explained in part one of today’s #datajourn conversation, Tony Hirst is the ‘data juggler’ (as titled by Guardian tech editor Charles Arthur) behind some of the most interesting uses of the Guardian’s Open Platform (unless swear words are your thing – in which case check out Tom Hume’s work)

Journalism.co.uk sent OU academic, mashup artist and Isle of Wight resident, Tony Hirst, some questions over. Here are his very comprehensive answers.

What’s your primary interest in – and motivation for – playing with the Guardian’s Open Platform?
TH: Open Platform is a combination of two things – the Guardian API, and the Guardian Data store. My interest in the API is twofold: first, at the technical level, does it play nicely with ‘mashup tools’ such as yahoo pipes, Google spreadsheet’s =importXML formula, and so on; secondly, what sort of content does it expose that might support a ‘news and learning’ mashup site where we can automatically pull in related open educational resources around a news story to help people learn more about the issues involved with that story?

One of the things I’ve been idling about lately is what a ‘university API’ might look at, so the architecture of the Guardian API, and in particular the way the URIs that call on the API, are structured is of interest in that regard (along with other APIs, such as the New York Times’ APIs, the BBC programmes’ API, and so on).

The data blog resources – which are currently being posted on Google spreadsheets – are a handy source of data in a convenient form that I can use to try out various ‘mashup recipes’. I’m not so interested in the data as is, more in the ways in which it can be combined with other data sets (for example, in Dabble DB) and or displayed using third party visualisation tools. What inspires me is trying to find ‘mashup patterns’ that other people can use with other data sets. I’ve written several blog posts showing how to pull data from Google spreadsheets in IBM’s Many Eyes Wikified visualisation tool: it’d be great if other people realised they could use a similar approach to visualise sets of data I haven’t looked at.

Playing with the actual data also turns up practical ‘issues’ about how easy it is to create mashups with public data. For example, one silly niggle I had with the MPs’ expenses data was that pound signs appeared in many of the data cells, which meant that Many Eyes Wikified, for example, couldn’t read the amounts as numbers, and so couldn’t chart them. (In fact, I don’t think it likes pound signs at all because of the character encoding!) Which meant I had to clean the data, which introduced another step in the chain where errors could be introduced, and which also raised the barrier to entry for people wanting to use the data directly from the data store spreadsheet. If I can help find some of the obstacles to effective data reuse, then maybe I can help people publish their data in way that makes it easier for other people to reuse (including myself!).

Do you feel content with the way journalists present data in news stories, or could we learn from developers and designers?
TH: There’s a problem here in that journalists have to present stories that are: a) subject to space and layout considerations beyond their control; and b) suited to their audience. Just publishing tabulated data is good in the sense that it provides the reader with evidence for claims made in a story (as well as potentially allowing other people to interrogate the data and maybe look for other interpretations of it), but I suspect is meaningless, or at least of no real interest, to most people. For large data sets, you wouldn’t want to publish them within a story anyway.

An important thing to remember about data is that it can be used to tell stories, and that it may hide a great many patterns. Some of these patterns are self-evident if the data is visualised appropriately. ‘Geo-data’ is a fine example of this. It’s natural home is on a map (as long as the geo-coding works properly, that is (i.e. the mapping from location names, for example, to latitude/longitude co-ordinates than can be plotted on a map).

Finding ways of visualising and interacting data is getting easier all the time. I try to find mashup patterns that don’t require much, if any, writing of computer programme code, and so in theory should be accessible to many non-developers. But it’s a confidence thing: and at the moment, I suspect that it is the developers who are more likely to feel confident taking data from one source, putting it into an application, and then providing the user with a simple user interface that they can ‘just use’.

You mentioned about ‘lowering barriers to entry’ – what do you mean by that, and how is it useful?

TH: Do you write SQL code to query databases? Do you write PHP code parse RSS feeds and filter out items of interest? Are you happy writing Javascript to parse a JSON feed, or would rather use XMLHTTPRequest and a server side proxy to pull in an XML feed into a web page and get around the domain security model?

Probably none of the above.

On the other hand, could you copy and paste a URL to a data set into a ‘fetch’ block in a Yahoo pipe, identify which data element related to a place name so that you could geocode the data, and then take the URL of the data coming out from the pipe and paste it into the Google maps search box to get a map based view of your data? Possibly…

Or how about taking a spreadsheet URL, pasting it into Many Eyes Wikified, choosing the chart type you wanted based on icons depicting those chart types, and then selecting the data elements you wanted to plot on each axis from a drop down menu? Probably…

What kind of recognition/reward would you like for helping a journalist produce a news story?
TH: A mention for my employer, The Open University, and a link to my personal blog, OUseful.info. If I’d written a ‘How To’ explanation describing how a mashup or visualisation was put together, a link to that would be nice too. And if I ever met the journalist concerned, a coffee would be appreciated! I also find it valuable knowing what sorts of things journalists would like to be able to do with the technology that they can’t work out how to do. This can feed into our course development process, identifying the skills requirements that are out there, and then potentially servicing those needs through our course provision. There’s also the potential for us to offer consultancy services to journalists too, producing tools and visualisations as part of a commercial agreement.

One of the things my department is looking at at the moment is a revamped website. it’s a possibility that I’ll start posting stories there about any news related mashups I put together, and if that is the case, then links to that content would be appropriate. This isn’t too unlike the relationship we have with the BBC, where we co-produce televlsion and radio programmes and get links back to supporting content on OU websites from BBC website, as well as programme credits. For example, I help pull together the website around the BBC World Service programme Digital Planet, which we co-produce every so often. which gets a link from the World Service website (as well as the programme’s Facebook group!), and the OU gets a mention in the closing credits. The rationale behind this approach is getting traffic to OU sites, of course, where we can then start to try to persuade people to sign up for related courses!

How to publish Twitter streams on news sites?

socialplumeAs covered earlier on this blog, there are various tools for tracking and engaging in conversations on Twitter, especially where hashtags are used. But how do you publish a themed Twitter stream on your news site or blog, and what other issues are there to consider?

We have experimented with various tools on this blog in order to stream hashtag-themed Tweets (a post on Twitter) into a blog post. The last attempt used a heavily modified WordPress plugin from Monittor. None have been completely satisfactory.

But why would journalists want to do this? Well, imagine if there is an event on your local beat like a football match or other sports game. People are already Twittering from these events. If they could be persuaded to use the same hashtag, then you have the potential of creating a live Twitter stream on your website – a live commentary but from the point of view of several fans, not just one reporter.

Similarly, it could be used to cover breaking news events, basing the Twitter stream on keywords, rather than a hashtag.

For this to work really well though, we decided several functions needed to be in place:

1. The ability to place a stream of Tweets, based on keyword(s) and/or hashtag(s), onto a web page and for that stream to dynamically update (ie not require a page refresh). Ideally the output to be called by <div> tags, rather than a Javascript insert, to cope with content management systems that reject JS in article bodies.

2. Access to legacy Tweets using pagination. The current tools we use only display the last 10 or so Tweets, with no access on our pages to what has been Tweeted before.

3. The ability for administrators to tag certain Tweets within a themed stream and create a new output on another page. The purpose of this is to allow an editor to easily create a summary of the best Tweets for archive purposes.

4. The ability for moderators to manually exclude certain Tweets from a Twitter stream (for moderation purposes).

5. The ability for users to login and post directly to a Twitter stream, from the page on which that Twitter stream is published.

6. Threading based on @replies (probably the most complex proposition in this list).

There did not seem to be any existing tools that covered even half these bases, so we put out a call on a local developer’s email list. Amazingly, it transpired that a local company in Brighton, Inuda, is currently working on a tool that will eventually tick almost all of the above boxes.

Called SocialPlume, the product aims eventually to become a modestly priced subscription service. Jonathan Markwell of Inuda was keen to stress that they are still some way off a public launch, but in the meantime they are keen to hear from publishers and journalists who might be keen to trial the service alongside ourselves. DM @journalismnews or @johncthompson if you are interested.

We would also love to hear other ideas and applications for this service that you might have (please leave a comment).

Experiences of using Publish2 to report the Washington flooding

As reported on the Journalism.co.uk main site, Washington newspaper rivals have joined forces to publish shared links relating to extreme flooding in the Western Washington region, in one of the first examples of ‘networked link journalism’ in action.

Journalism.co.uk contacted Paul Balcerak, assistant editor of dynamic media at Sound Publishing, publisher of the PNWLocalNews.com site.

Further to his comments in the main piece, Balcerak shares here his thoughts on using Publish2, the link journalism site and application:

What does it have over other link applications (e.g Ma.gnolia/Delicious)?
“The big selling point for me is the create-a-widget that lets you bundle links by tag and embed them (via Javascript) on your web page. Sure, if we wanted to build our own Delicious widget we could have done that, but this was already there for us and allowed us to work a lot faster.”

What benefit is it to you to work with your competitors?
“It made our jobs a lot easier, too. Pnwlocalnews is an aggregate site for all the sites under the Sound Publishing umbrella (about 35 of them, which all represent small, community newspapers).

“Our newsroom staffs aren’t huge – some consist of only a couple or few people – and to be frank, there’s just no way for us to have all the breaking news, all the time.”

At the moment a lot of US regional journalists seem to be using it (hasn’t really taken off in UK yet) – do you think it suits that environment particularly?
“I can’t really say, as I’m really not aware of how the environment outside the U.S. differs.

“I think part of it might be that it’s sort of this ‘Delicious for Journalists,’ which appeals to those who are hesitant to embrace ‘citizen journalism,’ or whatever we’re calling it. It’s more exclusive.

“For my part, it’s just another aggregate network that a ton of great journalists are on – why wouldn’t I be there?”

How could Publish2 improve its service for journalists?
“There are a few little things that could be improved (I can’t seem to find a search function to look up other people on the network) but I think the only real downside is that, well, it’s another aggregate network.

“It’s another username/password that you have to remember and log into everyday. If the Publish2 people ‘Who Make Things Happen’ could get it listed in Shareaholic or ShareThis, that might make it a little more convenient.”