Archive for May, 2006


Does Web 2.0 Need a New Term?

Sun, 28 May 2006 16:24 UTC

The term “Web 2.0” is the marketing brainchild of O’Reilly Media. Yet, it has come to be associated with so many different facets of this “new” culture of the Internet we see emerging. I, like Ivo Jansch, believe that Web 2.0 is now more about a cultural shift than the technology used. It’s about the way we handle data and communicate with others. It’s about sharing ideas in an open forum. It’s about who holds the knowledge and, thus, the power—in a Web 2.0 world, everyone has free and open access to the knowledge; everyone has the power.

However, O’Reilly Media, while I have nothing against them, has made it clear that they wish to own the rights to the term “Web 2.0” (specifically with regard to its use in conference names). In this world of open data exchange and sharing, the term for this phenomenon is anything but. Tom Raftery reports that CMP Media (working with O’Reilly Media) has applied for registration of “Web 2.0” as a service mark “for arranging and conducting live events.”

Now, this doesn’t restrict me from creating a Web site and calling it a Web 2.0 site, nor does it keep me from blogging about Web 2.0. In the purest sense, this means that I cannot create a conference and use the term “Web 2.0” in the name or on any of the marketing materials for the conference. However, it does raise some concerns and begs the question: what is “Web 2.0” really about? Is it about technology, a cultural shift, or marketing hype?

If the term is merely marketing hype, then we need to abandon the term and seek a new one that is free and open for everyone to use. Yet, before we create a new term, we need to clearly define what the term means—is it about technology or a shift in our way of thinking?

Let me end by saying that I have not lost any respect for O’Reilly. I think it is absurd to expect a company not to protect a term they created and own. Furthermore, it is not ridiculous to think that someone would try to trademark the terms “Ajax” or “Ruby on Rails.” After all, these were terms created by companies—Adaptive Path and 37 Signals, repectively. They had the right to trademark these terms and have chosen not to do so. The confusion lies in the ownership of the term itself. Until now, the community has assumed that the term “Web 2.0” was sparked from a grassroots effort, that it belonged to the masses. Now, we know and understand that it was merely created to name a conference where next-generation Internet technologies would be discussed. Instead, it is the community’s own fault for grasping ahold of the term and running with it as if it were their own.

So, I’m posing this question: what are we trying to describe, and what should we call it? And, let’s not suggest things like “Web 2.1” as some have humorously done. Let’s create a real term, a descriptive one.

UPDATE: O’Reilly Media posted a response to the service mark issues a few days ago on O’Reilly Radar .

Comments 6 Comments »  Permalink Permalink  Tags Tags: , , ,


Support Net Neutrality

Fri, 26 May 2006 21:50 UTC

I am a strong supporter of small government. I believe in as little government regulation in our lives as possible, and these beliefs carry over into my feelings on software, patents, and copyrights. I also tend to believe that fewer laws are better, but there are circumstances in which more laws can help protect certain freedoms we take for granted. One of these freedoms is that of “Net Neutrality.”

In short, Net Neutrality is the principle that “the network’s only job is to move data—not choose which data to privilege with higher quality service.” This allows for a free and open Internet, a privilege we’ve experienced since the creation of TCP/IP. Read more about Net Neutrality at Save the Internet.

Now, Net Neutrality is under attack. The House Energy and Commerce Committee drafted and approved a reform bill to update the 1996 Telecommunications Act, but it contained no provision limiting what telecommunications company’s can charge Web site owners or companies utilizing their network (i.e. transporting data across their lines).

I am fortunate to have as my district representative one who supports an open Internet, but there are other representatives who are either not aware of this problem or don’t care. I urge you to contact your representative and senators and ask them to support an open and unregulated Internet.

My district representative, John Linder (R-GA), also always writes back with a response when I contact his office. Here is the letter in full he wrote concerning Net Neutrality:

May 23, 2006

Dear Mr. Ramsey:

Thank you for contacting me with your support for an open and unregulated Internet. I appreciate hearing from you.

The issue of “network neutrality” centers around the right of broadband providers to charge companies such as Yahoo, Google, and Amazon when they utilize phone and cable lines to communicate with consumers. In the House, the Energy and Commerce Committee has drafted a comprehensive telecommunications reform bill to update Public Law 104-104 (the 1996 Telecommunications Act). Ultimately, the Committee-approved version of H.R. 5252, the “Communications Opportunity, Promotion, and Enhancement (COPE) Act of 2006,” which was reported to the full House, had no provision limiting what telecommunications companies can charge website owners or companies when they utilize broadband-width Internet lines.

For your information, Representative Edward Markey (D-MA) introduced a bill, H.R. 5273, the “Network Neutrality Act of 2006,” on May 2, 2006, which mandates that Internet service providers cannot charge Internet sites or companies discriminatory rates to send information across broadband networks. This bill is currently pending before the House Energy and Commerce Committee, where it awaits further consideration.

As a strong supporter of the landmark telecommunications reform legislation in 1996, I believe the direction in which we are headed is a positive one—many customers are finding a much wider range of telecommunications service options than ever before. We want this trend to continue, not dissapate I believe, however, that Congress must be cautious in its actions. Legislation passed now will have consequences for the telecommunications industry for years to come. As the House continues to work toward floor debate of H.R. 5252, I will keep your concerns in mind and will support legislation that ensures open and unregulated Internet access.

Again, thank you for contacting me. If I can be of any assistance in the future, please feel free to call on me.

Sincerely,
John Linder
Member of Congress

Comments 11 Comments »  Permalink Permalink  Tags Tags: , , , ,


Create an Image from XML Data

Fri, 19 May 2006 1:52 UTC

I had some time to kill and a silly problem to solve, which means here’s some more SimpleXML fun for you:

The Problem: It’s not really a “problem,” but FeedBurner’s FeedCountTM image is a rigid 88 pixels wide, and I wanted to include it on my homepage under the “syndicate” heading, an area that I’ve defined in my template as having only 80 pixels in width. The 88 pixels were throwing things off, so I used the width attribute of the HTML img tag to solve the problem. Unfortunately, it just squeezes the image, making the text in it appear fuzzy.

The Solution: FeedBurner conveniently provides what they call their “Awareness API,” which is a RESTful interface to retrieve (as XML data) the same exact information displayed in the FeedCountTM image. Since I wanted to maintain the same kind of image (because it’s a recognized look-and-feel for FeedBurner feeds), I simply fired up an image editing program, shuffled things around a bit until the image was a nice, clean 80 pixels wide, and saved it as the base image (shown to the right) I would use for generating an image similar to the one FeedBurner provides.

Base FeedBurner imageThen, I wrote a script to grab the FeedBurner data (using SimpleXML) and used PHP’s image functions to open the base image, write the FeedBurner circulation data to it, and save it to use on my site. I simply have a cron job that runs this script once a day to keep my image updated.

Here’s the code. Enjoy!

<?php
// Get the XML data from Feedburner
$sxe = new SimpleXMLElement('http://api.feedburner.com/awareness/1.0/GetFeedData?uri=ramsey', NULL, TRUE);
$readers = (string) $sxe->feed->entry['circulation'];
 
// make sure it's a number
$readers = is_numeric($readers) ? $readers : '0';
 
// 39 is the base position; 6 the width of each char
$xpos = 39 - (strlen($readers) * 6);
 
// Create the image from the base image
$img = imagecreatefromgif('feedburner-base.gif');
$color = imagecolorallocate($img, 0x00, 0x66, 0xCC);
imagestring($img, 2, $xpos, 2, $readers, $color);
 
// Save the image
imagegif($img, 'feedburner-readers.gif');
?>

Note that I determined the numbers used in lining up the text in the image by trial-and-error. I played around with it a bit to get things right. The $xpos variable is my attempt to right-align the text because you can only specify the left edge of the text with the x coordinate.

Comments No Comments  Permalink Permalink  Tags Tags: , , , ,


Congratulations, Brain Bulb!

Tue, 16 May 2006 21:05 UTC

I just wanted to take a moment to congratulate Chris Shiflett and Brain Bulb on their recent acquisition by OmniTI.

With George, Wez, Laura, Amy, and, now, Chris, OmniTI are quickly becoming a company of PHP all-stars.

OmniTI: The Other PHP Company ;-) (apparently, I’m not original in saying this)

See also:

Comments 1 Comment »  Permalink Permalink  Tags Tags: , ,


Add Children with SimpleXML

Thu, 11 May 2006 3:05 UTC

I was very excited today while glancing through the code in ext/simplexml/simplexml.c to find some, as of yet, undocumented methods in PHP’s SimpleXMLElement class. This discovery came after I’ve spent several hours over the last couple of nights banging my head against the desk to figure out a way to create a class that extends SimpleXMLElement and adds a new method for adding a child, which would have to use DOM in order to work—or so I thought.

During this process, I’ve discovered two major limitations of SimpleXML:

  • You cannot override the SimpleXMLElement constructor; it is a “final” method in the internals
  • You can extend SimpleXMLElement and add new methods, but looping through child nodes creates new SimpleXMLElement objects that do not use your class and, thus, cannot use your methods

    Nevertheless, I can get over these limitations after discovering these new SimpleXMLElement methods in PHP 5.1.4. In particular, the last three are what interest me most (these are not yet documented in the PHP manual ):

    bool   SimpleXMLElement->registerXPathNamespace(string prefix, string uri)
    array  SimpleXMLElement->getNamespaces([bool recursive])
    array  SimpleXMLElement->getDocNamespaces([bool recursive])
    string SimpleXMLElement->getName()
    object SimpleXMLElement->addChild(string name [, string value [, string ns]])
    void   SimpleXMLElement->addAttribute(string name, string value [,string ns])

    Previously, one of the biggest limitations of SimpleXML was that you could not add new child nodes to an XML document. Adding attributes to an element was no problem, but in order to add a child element, you had to go a round-about way through importing the SimpleXML object to DOM with dom_import_simplexml(), adding the child element, and importing the DOM object back to SimpleXML with simplexml_import_dom(). This was messy and anything but simple.

    Now, it’s clean and simple, as SimpleXML should be:

    <?php
     
    $xml = <<<XML
    <books>
        <book title="Fahrenheit 451" author="Ray Bradbury"/>
        <book title="Stranger in a Strange Land" author="Robert Heinlein"/>
    </books>
    XML;
     
    $sxe = new SimpleXMLElement($xml);
     
    $new_book = $sxe->addChild('book');
    $new_book->addAttribute('title', '1984');
    $new_book->addAttribute('author', 'George Orwell');
     
    echo $sxe->asXML();
     
    ?>

    UPDATE: I’ve added all of these (except for registerXPathNamespace(), which I can’t seem to figure out) to the documentation for SimpleXML in the PHP Manual. The documentation for each new method will be available the next time the scripts run to update the manual.

    Comments 6 Comments »  Permalink Permalink  Tags Tags: , ,


Share Your OPML

Mon, 8 May 2006 14:35 UTC

It seems I’ve been focused on OPML for the past few posts, and why not? OPML appears to be gaining a lot of attention lately. There’s even an OPML Camp in Boston later this month.

So, what’s all the fuss about? Adam Green summarizes his vision for the future of OPML on the OPML Camp blog:

I see OPML as an extremely flexible container for many types of XML and HTML data. Its simplicity and extensibility means that it can be used to bring together many types of structured content that are currently being developed on the Web, such as microcontent, attention data, identity data, and data that will eventually comprise the Semantic Web. OPML won’t replace these many efforts, it will help integrate them, by providing a common packaging mechanism.
Adam Green, OPML Camp blog

As of right now, many sites are using RSS as a common content delivery format. While RSS works for syndication, though, I think that it lacks the extensibility and context to fill the role of this “flexible container.” OPML won’t replace RSS, but it will aid in its delivery. So, I’m a little more than casually interested in seeing the application and future direction of OPML.

Along these lines, Dave Winer, launched today his new Share Your OPML service, the purpose of which is to “gather a community of subscription lists, in OPML format, and aggregate them in interesting ways.” It’s unclear to me (right now) the practical value of this service, since I was unable to discover how to actually generate OPML from the site. If the site were to provide OPML feeds for each data display, then its value would be readily apparent. Right now, I can only find an OPML feed for the Top 100 shared feeds.

Nevertheless, in the spirit of signing up for every new service out there, you can view my shared feeds here.

Comments No Comments  Permalink Permalink  Tags Tags: , , , ,


Generating OPML From del.icio.us (And Getting All Your Links)

Sat, 6 May 2006 15:40 UTC

UPDATE: Please note that del.icio.us has updated their API in the time since I wrote this. I have updated the URLs in my examples accordingly. The authentication is much safer since they are now using SSL.

The other day, I mentioned that I generate my blogroll from an OPML file. Until recently, this OPML file was generated manually by me whenever I updated my blogroll in NewsFire.

Now, there are some problems with NewsFire, one of which is that you cannot generate OPML for a specific group or selection of blogs (NetNewsWire excels in this area, however). Instead, the OPML file generated is a dump of all your feeds. This was not ideal for me, since I then had to go through and clean up the OPML before uploading it to my site. Needless to say, I updated my OPML as little as possible.

After my last blog post, I posted a comment to Chris’s blog saying that he should do something similar. That is, I suggested he generate his blogroll from an OPML file instead of del.icio.us, which has the unfortunate limitation of only 30 items per RSS feed. He replied, saying that he would then have to update two places (his feed reader and del.icio.us) instead of only one. In short, it would create more work. After assessing my practices, I cannot agree more.

So, I investigated a way to get around the 30-feed limitation in del.icio.us, and I found that their API allows you to do just this, albeit with a few restrictions of its own, which I’ll explain in a few moments. Using the del.icio.us API, instead of their RSS feeds, I was able to use the following code to first check whether my del.icio.us account has been updated since I last cached their data, and, if so, to grab all of the links for a particular tag and cache the data to a file for later use:

<?php
$username   = 'your_username';
$password   = 'your_password';
$cache_file = '/tmp/blogroll.xml';
 
// check for updates to del.icio.us account
$update = simplexml_load_file("https://{$username}:{$password}@api.del.icio.us/v1/posts/update");
 
if (strtotime($update['time']) > filemtime($cache_file))
{
    // del.icio.us has been updated since last cache; recache
    $data = file_get_contents("https://{$username}:{$password}@api.del.icio.us/v1/posts/all?tag=blogroll");
    file_put_contents($cache_file, $data);
}
 
// read links from cached del.icio.us data
$blogroll = simplexml_load_file($cache_file);
 
foreach ($blogroll->post as $blog)
{
    echo '<a href="' . htmlentities($blog['href']) . '">';
    echo htmlentities($blog['description']);
    echo "</a><br />\n";
}
?>

This code sample uses SimpleXML to traverse the nodes of the XML documents retrieved from del.icio.us. It first polls del.icio.us with a request to see the update timestamp. Checking this before executing a query to see all posts saves bandwidth for del.icio.us and can help us determine whether our cached file needs updating. This is also the recommended practice (from del.icio.us).

This approach can help you grab all of your links (or all links for a specific tag) from del.icio.us. I’ve noted several issues, however:

  • You can specify a tag to the /posts/all command with ?tag=tagname, but you cannot specify a combination of tags to retrieve
  • You cannot specify a tag to the /posts/update command, so the update timestamp received is for your last overall update to del.icio.us—if specifying a tag to /posts/all, then it would be beneficial to specify a tag to this command, saving del.icio.us even more bandwidth
  • This method requires HTTP authentication; you’ll notice how I passed a username and password through the URL to retrieve the data—you can retrieve only your links; whereas, using RSS, you may retrieve anyone’s links, but you are limited to their 30 most recent links

    Finally, I have implemented this approach using my blogroll tag on del.icio.us. My OPML file is now generated nightly (if detecting updates to del.icio.us). This will end up saving me quite a bit of time, since I can use the del.icio.us plugin for Firefox to add any site I visit to my blogroll, and, then, I can import the generated OPML into my feed reader at my leisure, with little to no headache.

    You can see my script, which is executed by a nightly cron job, here. You may notice that it’s using a getRSSLocation() function to auto-discover the RSS feed from each site for inclusion in the OPML file. I grabbed this function from Keith Deven’s site, and you can see my implementation of it here.

    Comments 4 Comments »  Permalink Permalink  Tags Tags: , , , , ,


OPML Reading List & PHP Upgrade Notice

Thu, 4 May 2006 14:53 UTC

The other day, I came across Scott Johnson’s PHP OPML Reading List. Offering an OPML reading list for others to download is a great idea, and, since I’ve not yet blogged about it, I wanted to point out that I’ve been doing this for a long while now. On my home page, under the “syndicate” heading, is a link to my OPML blogroll. Feel free to import my OPML into your feed reader; that’s what it’s there for. (Please also note that I use SimpleXML to generate the blogroll on my home page from this list.)

There’s a lot of overlap between Scott’s and my list; however, I think both lists provide a good overview of some of the great PHP bloggers out there—and I know there are many more than are on these lists, as pointed out by Chris.

In other news, the PHP development team released PHP 5.1.3 earlier this week, and, shortly thereafter, a user reported a critical bug with data in the $_POST array when submitting from a multi-part form. As of right now, there is no official release update posted on the PHP downloads page, but Chris provides a link to download the 5.1.4 source from a mirror.

I’ve already compiled and updated from the new source, and I encourage you to do the same.

UPDATE (5/5/06 4:30 UTC): The PHP team has made an official announcement concerning the 5.1.4 release on their Web site and have updated the downloads page.

Comments No Comments  Permalink Permalink  Tags Tags: , , , , ,


Comet Is the New Ajax

Tue, 2 May 2006 22:53 UTC


Renkoo Beta
Originally uploaded by Ben Ramsey.


This time last year, a single word began a revolution in Web design. Coined and published on February 18, 2005, by May, the word “AJAX” was on everyone’s lips. It soon became the talk of the entire industry, and has revolutionized Web design as we know it—or, at least, it’s given plenty of bloggers lots to talk about.

Ajax is old hat now. This year, the word is “Comet.”

Comet is a “new” style of low-latency data transfer between the Web browser and server. Alex Russell, who coined the term in his March 3rd blog post, calls “this style of event-driven, server-push data streaming ‘Comet,’” though the term doesn’t stand for anything, unlike its cousin AJAX. In short, Comet applications maintain an open HTTP connection, reducing the latency for data delivery. The user no longer needs to take any action for updates to appear; updates to a Web page can appear in real-time (sans any clicks or other form of user interaction).

It’s hard to sometimes grasp what a technology does without a good reference point. Alex lists several examples, among which are GMail’s GTalk integration, Meebo, and Renkoo.

Thus far, the most prominent implementation is chat through a Web browser, but I think that some other uses are obvious: data entry and reporting among teams of researchers, Web-based stock sites such as Scottrade, Web-based e-mail applications, groupware, etc. Anything that involves data that is ever-changing and evolving would do well to take note of Comet.

Comet evokes the obvious scalability questions that come with any new technology like this, and Alex addresses this briefly, mentioning some server software for event-driven IO. I noticed that Renkoo uses one of these tools: mod_pubsub. He also mentions that the Dojo toolkit already supports Comet via dojo.io.bind(). Again, I saw that Renkoo uses this toolkit.

I’ve also been able to take a look at Renkoo (still in beta), of which, I must admit, I was very skeptical about at first. However, after seeing how forward-thinking they have been with their technology and how they’ve managed to leverage as much of the “coolness factor” as possible into their service, I think they’ll pull it off quite nicely. Of course, when you’ve got $3M and your laptops are covered in cool stickers, you can do just about anything.

Comments 13 Comments »  Permalink Permalink  Tags Tags: