I've been looking into creating a link log for a while now, and just never got around to doing it. I didn't have the time, the energy or motivation. Yesterday, though, I finally broke down and registered with del.icio.us to keep track of all those urls I see during the day that I want to keep track of. Then, I realized that they provide an RSS feed of your links, and well, the rest is cake. If you check out the homepage, you should see my new linklog on the left side underneath the feeds. It was painfully easy to set up, thanks to the awesome MTGetXML plugin. Here's how I did it.
- First, you need to register with del.icio.us. Don't worry, it's free. Once you've registered, make sure you write down your user name, because you'll need it later.
- Once you've registered, add a couple links, just so you'll have something to show when we put the template in.
- Next, download the MTGetXML plugin. The install instruction spell out the steps you need to take (really, it's painfully easy).
- Now, you need to go to your Movable Type admin page for your blog, and to the Templates section. Click the Main Index template.
- (this is assuming you're using the default template. If you've changed it, you can probably modify these instructions to fit your site) Look for class="sidebar". This is the section of your template for all the stuff that shows up on the right side. I would suggest scrolling down until you see div class="link-note", and start put the cursor above that line.
- With the cursor on the line above, add the following (changing YOURUSERNAME to your del.icio.us username):
<h2>Link Log:</h2>
<dl>
<MTGetXML location="http://del.icio.us/rss/YOURUSERNAME" cache="60">
<MTGetXMLElement name="item" limit="10" noattr="1">
<dt><a href="<MTGetXMLValue name="link"/>"><MTGetXMLValue name="title"/></a></dt>
<dd><MTGetXMLValue name="description"/></dd>
</MTGetXMLElement>
</MTGetXML>
</dl>
- Save that template and rebuild it. When you visit your homepage now, you should see your link log right above "Syndicate this Site".
- This approach has one drawback... it will only update when you do a rebuild. I've seen a couple tutorials that do automatic rebuilds, but that seems like a lot of trouble to me. If you really want to have it do an automatic rebuild, you'll have to find those details somewhere else.
- The 'cache' attribute to MTGetXML will only hit del.icio.us at most once an hour. It's a fairly new site, and free, so I figured that's the least I could do to help them out with bandwidth. If you're a jerk, post a lot of links, or rarely make new posts, you might want to change that value.
- If you want to display more or fewer links from your list, change the "limit" attribute to MTGetXMLElement. If you want to get ALL of them, remove the limit attribute altogether.