JavaScript Recipe: Adding Paragraph-level Permalinks
February 12, 2010 at 5:24 p.m.
Paragraph-level permalinks are hot, right? Let's do this in JavaScript, just for fun.
Remember from my last post that all you need is a block of HTML and something to parse it with? This is pretty much what JavaScript was made to do.
var entry = document.getElementById('entry-text');
var paras = entry.getElementsByTagName('p')
Assuming you have a div with id="entry-text", we've just grabbed every paragraph below it and created an array called paras. Simple enough.
Now, like we did with Python and Beautiful Soup, we're just going to loop through that list of paragraph elements, add ...
Mapmaking Update: ZeeMaps allows Google CSVs
August 3, 2009 at 5:30 p.m.
My post last week on simple ways for journalists to make maps seems to have done some good.
Pankaj K Garg, of ZeeMaps left a comment noting that after reading my post, he decided to add a long-desired feature to the application: direct CSV import from Google Docs:
Now, you can select Additions -> Upload CSV file and just click on "Use Google Spreadsheet" to upload your data from a Google Spreadsheet.
The requirements are: (1) the spreadsheet must be named ZeeMap-map-number, where map-number is the number for your map, and (2) you must allow zeemaps at gmail dot com view ...
How to make a map
July 25, 2009 at 2:57 p.m.
Note: I wrote this up to help out a few colleagues a few months ago, and I thought it might be useful to more people. It's aimed at regular, non-programmer journalists who may at some point need to throw a quick map alongside a story (or by itself, that's cool, too). Obviously, this is in no way comprehensive.
Also, this is a snapshot version of a document being maintained in Google Docs. Check here for the latest.
In all cases, start with a spreadsheet (preferably using Google Docs ). This will ultimately make your life easier, even if you ...
