Making a blog from your bookmarks

Justin Tadlock has a VERY interesting post about turning WordPress into a forum using custom post types.
No downloadable code, but what he’s talking about here isn’t too hard
to do. Another dead end… I’d been looking into some other stuff, and
I’m rejecting any solution that would have me write too much code… and
I looked into using php’s domdocument feature to parse the html file
that firefox exports and having that get made into posts. too tedious. I
want it to be more automatic.

and with tags. Hmmn, I’d signed up with years ago,
they do bookmark importing and automatic tagging. You can export your
bookmarks from them, too – but you can’t import that file back into
firefox WITH the tags. Well, not easily, but it’s doable.

I have 1,300 firefox bookmarks. I REALLY don’t want to have to make blog posts to organize them all. I want them into a a blog, where I can comment and sort them effectively. When I’m researching something, it’s common for me to have 30-50 tabs open in Firefox while I seek out the answer that works for me. I’m really quite good at scanning through things until I find the answer I’m looking for. Or something close to the answer. My own understanding of the problems and issues deepen; I can usually find a solution for the tricky problems.

This consumed a whole Saturday, I am close to the answer and some of the pages I found must be mentioned here.

I want to make a blog with each POST being based on each individual bookmark. I’m building this on my local machine using WAMP, so I’m not worried about anyone else seeing it.

It turns out, I found a firefox plugin to export in OPML format. Then, you can use this exported file to import it to your wordpress links/blogroll. Or better still, you can use the folders you’ve set your bookmarks up into and use the import blogroll with categories plugin to have your bookmarks assigned to link categories automatically.

But I didn’t want that. I want them as posts. Along the way I stumbled into Pressmark, which is a funky custom install of wordpress, designed to be like or something. Ug, I installed it to a test server and went through the code. Total mess and a waste of time.  (Though I’m sure it works for some, it doesn’t add any importing features!)

Here’s a great bookmark converter that I found here. Xbel format? That’s what this guy Devin says. In fact, he’s got it spot on. This link here is total gold, except I want my bookmarks automatically tagged (by before they get put into a blog. He’s also suggested using Yahoo pipes, and provides one that slurps up the converted to xbel bookmark file and give you an rss feed. Then you can use feedwordpress (and only this, to link the titles properly.) Also, Delicious doesn’t let you get _all_ your bookmarks as an rss feed (only 15 at a time) but it lets you export them to a firefoxish (netscape,-is, really) html file.

So yahoo pipes is part of the answer. Also, it turns out that when you reimport your bookmark file after exporting it from, it strips out the tags. Here is the solution to that. This lets you essentially autotag your bookmark file. And oh, look, here’s how to get all your bookmarks out of as an xml file – with tags! The final step is to make a yahoo pipe that turns this into an rss feed.


Query_posts and how to use it in your functions.php template file

Here’s a trick I learned tonight.

/* this code excludes all of the 'international (id = 20) posts AND CHILDREN */

function exclude_category($query) {
$child_cats = (array) get_term_children('20', 'category');
if ( $query->is_home ) {
$query->set('category__not_in',array_merge(array('20'), $child_cats));
return $query;
add_filter('pre_get_posts', 'exclude_category');

the $query->set is used just like query_posts
who knew?