Wednesday, July 20, 2005

del.icio.us automatic links

Update: Just call me Rube Goldberg. John points out that there's a much easier way to add links to del.icio.us than the over-engineered mess I describe below -- just use the blog macros to create the {del.icio.us link} + {permalink url} + {title} directly in your blog template. There's no need for Javascript code at all. Still, the Javascript can still be used to automatically generate links on non-blog web pages.

Yesterday, I linked to an article about using Greasemonkey, Firefox, and Blogger.com to help automate the process of adding Technorati Tags to your blog articles. Today, I explain how to easily create a link to post your article to del.icio.us, a relatively new "social bookmark" service. You don't need Greasemonkey or the Firefox browser or even blogger.com -- this code should work with any blogging software or service.

If you grok del.icio.us, skip to the code and examples.

What is del.icio.us?



del.icio.us provides a method for users to categorize their favorite websites into ad-hoc categories. These users assign "tags" or categories to the website and enter them into del.icio.us's database. Think back to the early days of the web when Yahoo first came out. Yahoo used human editors to categorize websites into categories. del.icio.us, on the other hand, is a social network that allows anybody to tag or categorize their favorite websites. Furthermore, there are no predefined tags; the tag keywords are chosen and created by the users themselves.

This practice of collaborative tagging is called "folksonomy," after "folk" (for normal, everyday people) and "taxonomy" (the practice of organizing things in to groups)

Why become del.icio.us?



Because of the voting/popularity aspect of del.icio.us, many users report search results that are more relevant than those from standard search engines. As tagging systems such as Technorati, Flickr, and del.icio.us become more popular, they will become increasingly important in driving traffic to your website.


How to be del.icio.us?



Delicious users typically add a bookmark to their browsers linking to Javascript at deli.cio.us. When the user visits a web page he likes, he clicks the delicious bookmark, he is redirected to a form at deli.cio.us, enters his tags and submits the website to deli.cio.us.

Web pages can also have a link on their pages to simplify the process for their visitors. I've written a small snippet of Javascript that creates this link for you on every page you include this Javascript. I also have a PHP version if you're concerned about users who disable the script.

Javascript del.icio.us



First of all, a disclaimer: This is the first time in my life I've written Javascript, so if I've made any horrible mistakes please let me know in the comments.

Here's the basic code that will create a link to deli.cio.us's site submittal form, using the current URL and page title.


<script type="text/javascript">
  var ref="http://del.icio.us/post?url=" + document.URL + "&title="
  var title = document.title
  newtitle = title.replace(/ /g,"+")
  fullref = encodeURI(ref + newtitle)
  document.write("<a href=\""+fullref+"\">")
  document.write("Make me deli.cio.us.")
  document.write("</a>")
</script>


This is a very basic Javascript program. It builds the hyperlink anchor to the del.cio.us form, with the current URL and document title added as the values for the url and title parameters. The string replace method replaces all spaces with the plus sign. encodeURI replaces illegal URL characters in the query string with valid characters.

You can add this Javascript code to any web page, whether it's a blog or not. If you want to do this on the server side, here's the PHP equivalent.


<?php
function delicious($pagetitle) {
// This function will "Make Me Delicious"
// by inserting URL-specific link to deli.cio.us's
// tag post URL.
// Input parameter $pagetitle is the title of the page.
$url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$newurl = 'http://'.urlencode($url);
$newtitle = urlencode($pagetitle); // make the title URL friendly
echo "<br /><a href=http://del.icio.us/post?url=$newurl&title=$newtitle>
Make me delicious</a>.<br />";
}
?>


Like the Javascript example, this code will create a link to deli.cio.us's posting form. Unlike Javascript, the server-side PHP cannot determine the title of the page (unless you want to read the page and parse the title yourself), so the title is passed as an argument to the function delicious(). This function is called at the place on your web page you want the del.icio.us link.

Blogger.com example



Whatever blogging software you use, you want to put the code in your template so that links to del.icious are automatic. Below is how I added the Javascript to my bicycling blog. I put the code right after the blog article text (identified by <$BlogItemBody$>) and right before the "posted-by" footer. You'll notice the Javascript code is slightly different from the general example above -- I make use of Blogger.com macros. BlogItemTitle expands to the title of my article because the HTML page title may be something a little different. Also I use BlogItemPermalink because this Javascript may be running from the index page of the blog or from the "Permalink" page -- I want to be sure the right page gets tagged.


<script type="text/javascript">
var ref="http://del.icio.us/post?url=" + "<$BlogItemPermalinkUrl$>" + "&title="
<BlogItemTitle>
var title = "<$BlogItemTitle$>"
</BlogItemTitle>
newtitle = title.replace(/ /g,"+")
fullref = encodeURI(ref + newtitle)
document.write("<a href=\""+fullref+"\">")
document.write("Make this deli.cio.us.")
document.write("</a>")
</script>


If you use the PHP version instead and your blog is hosted on a PHP-enabled host, calls to the delcious function are made like this to ensure you get the article title: delicious("<$BlogItemTitle$>). Note that the PHP version will only work on the Permalink page, so make sure the PHP code is wrapped within the tags <ItemPage> </ItemPage>

If you make use of this code, please drop me a line in the comments below.

Influence and blogging

I'm running up against a deadline at work and don't have time to comment on this topic, but I sure wish I did.

Winning over your friends is about influence. Matt at The Basement writes about the 10% of Americans who are the Influentials -- the kind of people who stand out because they set trends and influence everybody else around them. Writers in the past have proven that these trendsetters are "quantifiable and identifiable." Matt and others also write of current attempts to identify bloggers who are influentials.

I suspect one way to identify these Influential bloggers: The influentials write original, cogent content that cause second and third-tier bloggers (like me) to go "Hmmm" and link to them with posts like this one.

What do you think? Who are Influential bloggers? Link to them in the comments below.

Update: Rex tells us we're missing the point . "If mass-marketers try to 'figure out' the blogosphere with some sort of 'measurement tool' rather than by joining in the conversation and belonging to the blogosphere, they're missing the point and will remain clueless outsiders."

Tags: | |

Tuesday, July 19, 2005

Tags with blogspot

If you use Blogger.com and you're tired of writing out the HTML code for Technorati tags, check this out -- an easy way to add tags to your blog posts. This Greasemonkey extension is reason alone to convert to Firefox as your web browser!

Friday, July 15, 2005

Google PR Update

Google is updating their public PageRank and backlinks information today. My Longmont church website has bubbled up to PR3 from a PR2. More importantly, the church website ranks number one in search results for more keywords.

My old church in Urbana, Illinois has broken through the barrier from PR4 to PR5 today. It's a small website without much content, and amazingly almost every page has a PageRank of 5. What's especially interesting is that most of this site hasn't been updated in years. The photo on the homepage is one that I took four or five years ago. And unfortunately, this high PageRank does not translate into a good placement on the results page when searching for churches in Urbana or Champaign. I believe this easily rectified, however, and I hope to talk with the church webmistress to suggest some fixes. I'll let you know how that goes. The pages have good content and is easy for users to navigate.

I've also been following this church in Sacramento, California. Their church website lost PageRank today, dropping from 4 to 3. One of the people on their web team told me that this is "evidence that a static page that has not been updated will lose rank... and fast." This is contrary to the experience I cited about the Urbana church website. This team is aggressive on their web optimization, using numerous Technorati and Flickr tags, several gateway sites, and extensive crosslinking across sites in an attempt to boost the number of inbound links to their church website. Done clumsily, these techniques will result in Google detecting this as an attempt to spam or game their algorithms, and if it's bad enough Google will ban your site from their results completely.

What are the lessons to learn? Don't try to game the system -- make your site user-friendly and easily navigable, and include good content. For high placement, though, this might not be quite enough. For that, keywords in your pages and in anchor text linking to your site are the key. Read the other articles on this blog for more information.

Where does your church website place in Google? Search for "church city, state or province." Let me know how you're doing in the comment section.

Technorati tag: |

Tuesday, July 05, 2005

More on spam blogs

My last post discussed spam blogs -- blogs with automatically generated content and links that are set up solely for the purpose of generating links to another site.

Duncan Riley at the Blog Herald weighs in with his opinion that it's time for Google to act on Blogger.com. He writes: "As more and more spam blogs are created, search engine results become more and more polluted." In response, search engines "will start to offer blog free search, or at least blogspot.com free search. The first to suffer will be anyone legitimately using blogger for their blogs."

I think Technorati and similar blog search services can fix the problem without banning blog-hosting services wholesale. It's a hard problem to solve, no doubt: John August on his screenwriting blog wonders "if the spam-blog problem is readily fixable." But I think it's in the best interests of Technorati, Flickr, and the rest to detect, filter, and ban spam blogs and tag spam.

Technorati tags: | | | |

Prior

< 5

List

????

> 5

Next

Administrator

Home/Join

alt-webring.com