Social Graphs API: WordPress Plugin: Blogroll Links

If you already know what the Social Graph API and XFN are, you can skip the background information and go directly to the Blogroll Links plugin for WordPress that is designed to work with these.

Update: 2010-Feb-20: Version 2 of the Blogroll Links plugin for WordPress uses the Shortcode API and so introduces a new code-tag format. The new plugin still supports the old (now deprecated) code-tag format for backwards compatibility. See below for examples.

Social Graph API

Google recently announced the Social Graph API.1 From Google’s Code site:

With so many websites to join, users must decide where to invest significant time in adding their same connections over and over. For developers, this means it is difficult to build successful web applications that hinge upon a critical mass of users for content and interaction. With the Social Graph API, developers can now utilize public connections their users have already created in other web services. It makes information about public connections between people easily available and useful.

We (Google) currently index the public Web for XHTML Friends Network (XFN), Friend of a Friend (FOAF) markup and other publicly declared connections. By supporting open Web standards for describing connections between people, web sites can add to the social infrastructure of the web.

The Google Code site also has a video introduction to the open social graph:

The Google Code site has some interesting example applications. To see the power of the open social graph, follow these links:

All I did was enter my home page http://www.rajiv.com/ into these applications and got the results linked to above.

XHTML Friends Network, a component of open social networks

XFN (XHTML Friends Network) is a simple way to represent human relationships using hyperlinks. In recent years, blogs and blogrolls have become the fastest growing area of the Web. XFN enables web authors to indicate their relationship(s) to the people in their blogrolls simply by adding a ‘rel‘ attribute to their <a href> tags, e.g.:

<a href="http://www.rajiv.com/" rel="friend met">Home Page: Rajiv Pant</a>

The above link means that the page at http://www.rajiv.com/ belongs to a friend of the person who who owns the page this link is placed on. The met tag specifies that the two friends have met in real life. The link above would not be placed on a page owned by Rajiv Pant. It would be placed by a friend on their page, for example, on http://www.paradox1x.org/

Here is another example:

<a href="http://photos.rajiv.com/" rel="me">Photo Albums: Rajiv Pant</a>

This link states that the page at the URL http://photos.rajiv.com/ belongs to the same person who owns the page this link is placed on. For example, the above link would be placed on http://www.rajiv.com/ telling the Web that the URLs http://photos.rajiv.com/ and http://www.rajiv.com/belong to the same person.

To find out how to write and use XFN, or to write a program to generate or spider it, visit the XFN Web site.

Blogroll Links Plugin for WordPress

For people who maintain their Web site or blog using the WordPress blog content management system, I created an open source plugin called blogroll-links that uses WordPress’ built-in Blogroll feature2 and presents links to friends’ home pages and own pages on social networking sites using XFN in the links.

Features of this plugin

  • It can show the links by category in blog posts and WordPress Pages.
  • It uses WordPress’ standard built-in Blogroll links database. There is no hassle of another list of links to maintain.
  • It can be used to show only the links assigned to a particular category, by stating the category slug as defined in that category’s setting in WordPress.
  • It honors the Show/Hidden setting as defined for each link in WordPress.
  • It displays the link in the same window or new window, as specified for each link in WordPress.

See this plugin in action

  • http://www.rajiv.com/friends/
    • The two lists, first one of links to my own pages on various social networking sites and the second one of links to some of my friends’ pages are generated by this plugin. Yes, those social networks’ logo pictures are also taken by the plugin from the WordPress standard Blogroll links. Code:
    • <h3>My Pages on Social Networking Sites</h3>
      [blogroll-links categoryslug="rajiv-web" sortby="link_name" sortorder="desc"]
      <h3>Web Sites of Some People I Know</h3>
      [blogroll-links categoryslug="people" sortby="link_name" sortorder="desc"]
  • http://www.rajiv.com/charity/
    • This list of charitable organizations with brief descriptions is generated by the plugin. Code:
    • [blogroll-links categoryslug="charity"]
  • http://www.rajiv.com/blog/2004/08/02/search-engines/
    • This list of search engines is maintained as Blogroll links in WordPress. Code:
    • [blogroll-links categoryslug="search-engines"]
  • http://www.rajiv.com/
    • The featured links shown under the “What’s featured here?” section shows the links I’ve categorized as featured in WordPress’ Blogroll links. Code:
    • <a title="featured" name="featured"></a>
      <h2>What's featured here?</h2>
      [blogroll-links categoryslug="featured" sortby="link_name" sortorder="desc"]

Download & install plugin

  1. WikiPedia article explaining what an API, or application programming interface is. []
  2. It does not make you maintain yet another list of links []

I now use WordPress publishing software for this site (Product Review)

Managing blogs and news content with WordPress is a Zen-like experience. The inner-beauty of a product is felt when it becomes almost unnoticed, allowing the site authors and editors to focus on publishing content and providing useful interactive functionality to their readers and customers.

I say this as someone who has been immersed in web content management for major news media companies since 1995. I have spent over a decade leading teams evaluating, implementing, maintaining and developing content management and publishing systems, including some industry award winning ones. My teams (including me personally) have been working closely with writers, editors, designers, photo/multimedia staff, sales and marketing folks at companies whose livelihoods depend on publishing content. I’ve also maintained my personal web sites since 1994.

It is impressive how well WordPress has worked as a CMS for the blogs and pages on this site. It is simple to use and painless to configure, manage and upgrade. It minimizes overhead and maintenance work.

WordPress plays well with others. It doesn’t require you to convert all your static content and pages powered by other CMS systems and custom scripts into WordPress. This allows you to conveniently migrate content to WordPress over time, preserving the URLs and keeping your site functional.

No wonder so many non-technical people and technologists alike use it for their sites: I switched to WordPress inspired by reading the personal blog of a colleague and CTO at another major media company who had also switched to WordPress. It is one of the best solutions for personal web sites and small to medium size organizations.

WordPress also powers the blogs of several major media companies with millions of daily page views. It has an well-designed architecture that makes it an excellent choice for large-scale use. It is used by a large and growing number of sites, including CNN, Fox News, Wall Street Journal, Yahoo, General Motors, Southwest Airlines, People Magazine, Apple Computer, Sony PlayStation US, C|Net, NY Times, Ziff Davis, Xerox, Delta Airlines and many others.

WordPress is a great choice because

  • Simple to use for writers and editors
  • Quick and simple to install, maintain and upgrade for systems administrators
    • E.g. automated daily backups to remote systems using a plugin
  • Good architecture for programmers to extend functionality if needed
  • Search engine-friendly and people-friendly URL structure
  • Dynamic publishing model of content managed in and served from a relational database. Content management and delivery are seamlessly integrated.
    • Presentation, as in design, is well separated.
    • This is a superior approach compared to other blog / CMS systems that recommend publishing static files.
      • In the file publishing model, those files are then served directly by the web server or processed by a web application server / CMS. That architecture, used by other blog platforms does not scale well and has been found to be error-prone, especially under heavy publishing/editing/commenting use.
    • If needed, external caching1 can be used that provide all the benefits of static file publishing without the drawbacks.
  • Excellent content management in a relational database
  • Rich feature set for advanced web publishing needs
  • Large and growing user base, well-supported and actively developed by the community
  • A large and growing number of plugins that add functionality to WordPress
    • WordPress is used by so many people that it is often likely that someone has developed a good solution for what you require. The WordPress directory is teeming with plugins, themes and other extensions developed and given by the community.
    • For example, support for OpenID as a client and server, site usage tracking with web analytics.
  • Plethora of third-party commercial support options available if needed
  • Free of license costs. Simple to operate and operate. Low total cost of ownership. An economical solution.
  • Reliable. Good performance. Scalable. Secure.
  • Open source

What WordPress currently lacks

  • A simple, standard way to place a widget in the main content area of a blog post or WordPress page. Currently plugins that need to place a widget there require putting in some special markup whose syntax varies with each plugin. Many use an HTML <!–comment–> syntax in the Code editing mode. Some use a syntax of [commands in braces] in the Visual editing mode.
    • A good solution would be for wordpress to allow widget placement and manipulation completely within the Visual content editing mode. Behind the scenes, in the code view, all plugins would use consistent markup syntax and it would be editable using a menu option in the Visual editing mode.
  • A way for certain widgets to only appear in the sidebar(s) of particular WordPress Pages or particular blog posts.
    • A good solution would be to have the ability to place a widget only on certain URLs that match a regular expression. Also, the edit form should have an option to include a widget only on a particular post or Page.

Alternatives

Another excellent choice for a blogging CMS is MovableType. I’ve had extensive experience with it and like it a lot too. MovableType and WordPress are the two leading products in their category.

If you are looking for a full-fledged content management system, consider Drupal or Plone. After a successful run for many years, my own Java-based Cofax is heading towards retirement.

If you need to build your own custom CMS, build using frameworks like Python with Django, Ruby on Rails or Groovy with Grails.

[rating:5/5]

  1. E.g. content delivery network like Akamai, an accelerator/cache like Squid or Varnish []

List of Open Source or Free Software for Home and Business Use

Here is a list of some open source or free desktop software that you can use for personal use at home or at your business. Using open source software can save you thousands of dollars that you’d spend buying proprietary software. I’ve chosen software here that is comparable in ease of use, maintainability and upgrades to similar pay-for software. Keep in mind that the total cost of ownership includes more than just license fees. There will always be costs in time and/or money to install, maintain, reconfigure and upgrade the software over time.

Useful for most computer users:

  • OpenOffice.org – Productivity suite competing with Microsoft Office, includes word processor, spreadsheet, presentations, database and drawing software
  • Grisoft AVG Anti Virus (free for personal use only, not open source)
  • Mozilla Firefox – Web browser
  • Mozilla Thunderbird – Email client
  • GIMP – GNU Image Manipulation Program, an alternative to Adobe Photoshop. Also consider GimpShop and CinePaint.
  • 7-Zip – Decompresses and compresses files and folders. An alternative to WinZip.
  • JEdit – A powerful text editor

For relatively technical users:

The Free Software Foundation’s GNU Project has a large collection of open source software in a variety of categories. You will find things ranging from business productivity software to games there.

A web site called Open Source Alternatives helps you find open source software alternatives to well-known commercial software.

This list was inspired by my friend Karl Martino’s list of some software he uses.

Google Web Toolkit: Develop and Test in Java, Deploy as AJAX

I’m building a pull-down-menu navigation for the rajiv.com site using the Google Web Toolkit (GWT) and I’m impressed by this Google product.

It allows you to create user interface (UI) widgets and dynamic functionality for your web app using the Java programming language. You develop and debug your app in the Eclipse Integrated Development Environment, just like you do any other Java app. When you are done, GWT translates the Java app into AJAX technologies: JavaScript, HTML, CSS and XML. This gives you the advantages of both worlds: You program and test using the robust Java platform and the final output is in AJAX (no Java applets at all) which works consistently across most modern web browsers.

Developing a web page UI using GWT, Eclipse and Java saves a lot of time over the alternative of coding all the AJAX (JavaScript, HTML, CSS, XML). GWT also takes care of issues like cross-browser compatibility and the AJAX UI not conflicting with the browser’s back button, which would otherwise have to be extra coding and testing work if developed in AJAX.

What’s also great is that the generated HTML pages are clean and nicely documented using comments, all automatically done by GWT.

Java programmers should welcome GWT since it gives them the ability to create rich dynamic HTML functionality in the robust environment they are familiar with. You can view the Java source code here.

Java Progammer? Use BeanShell

BeanShell is a fully Java compatible scripting language, capable of interpreting ordinary Java source files. You can also use it for working with Java interactively like an interpreted Unix Shell or Perl. You can try out Java’s object features, APIs, GUI widgets and other libraries hands on.

BeanShell is free and also ships bundled with popular applications such as BEA Weblogic, Forte for Java and the NetBeans IDE.