The writings of Peter Stuifzand

Archive for March 2011

The new River UI looks like this:

Small interface

Clicking the What's happening field will open the whole form:

Whole river form

In Cross-Origin Resource Sharing:

Why can cookies and authentication information not be provided by the script author for the request?

This would allow dictionary based, distributed, cookies / user credentials search.

If you send a username and password when using withCredentials, then XMLHTTPRequest.send(...) will fail in Firefox 4, but not on Chrome 11.0.696.16 dev. Removing the username and password will make it work on both of them.

I haven't tested other versions.

Crippled example (won't work directly):

function send_message(form) {
    $.ajax({
        'type':'POST',
        'url':'http://example.com',
        /* 'username':'username',
        'password':'password',*/
        xhrFields: {
            withCredentials: true
        },
        'async': true,
        'crossDomain': "true",
        ...
    });
}

Sending the username and password will raise an exception in Firefox even before sending anything to the url.

Today I was working on river again and after I added enclosure support I wanted to add a way to play audio files. The first thing I thought was, we can I find an inline mp3 player. And while I went to Google another idea popped into my mind: HTML5 audio.

So I added the tag:

<audio src="url" />

And without much more effort I had working audio playback in my river. How easy is that?

My river includes a way to add new posts to my personal feed.

When I click on the textarea, it grows and shows two optional fields where I can add a Title and Link for this post. Clicking Publish will send the post to my posting interface on the server using AJAX.

A new post appears within a few seconds in the river below. Posts from other feeds also appear in the river within seconds of being posted.

I forgot to include the link to my rssCloud in the last post about how I wrote one in Plack.

In Tweeting about Twitter's Terms Dave Winer writes:

You can't be half in and half out. Either you connect to Twitter, and they own you and your users, or you don't connect to Twitter.

So we can't play with Twitter, but the other way around Twitter can't play with us. At some point in the future rssCloud based microblogging clients will take off and Twitter will have to change their terms of service to allow us to let them play with us. At that point we won't care anymore.

The use cases of Camlistore or all very interesting. I'm interested to see how this all pans out.

Camlistore seems like a really cool project when it gets farther along. Or actually it seems really cool already, but it's not useable at the moment. Something to take a look at sometime in the future.

Today I wrote an rssCloud in Perl. It uses Plack and AnyEvent. That it uses Plack doesn't at the moment mean that it works with any Plack compatible web server. It works with Twiggy, but doesn't with HTTP::Server and others. This relates to the AnyEvent code.

I followed Dave Winer's walkthrough for implementation information and looked at some of the frontend parts of his system.

At the moment it only supports the http-post protocol for subscription and ping. This shouldn't be too big of problem I hope. Everyone who is interested and able should send me a patch for the XML-RPC part. Patches are welcome!

At the moment I have one of these clouds running on my server. You can take a look at the log to see what's going on. If you break something, please send me a patch to fix it, or at least send me an email showing what steps you took to do so.

I am building my own microblogging tool. It uses RSS and RSScloud to get realtime updates from the web. Tonight I got it working and now I need some feeds to parse. Yesterday I already saw that Identi.ca provides RSScloud feeds, so I tried one of them out.

The first feed I added was my own. The test to see if it worked was posting a message to my account. And ... a post appeared in my microblogging client in realtime. It only took two seconds between a post on identi.ca and the receive on my end. Really nice.

This week I created a way for me to post small messages, as there is not yet a good decentralized way to make this happen. One part of this research is how can I create, host and share RSS feeds without using to much bandwidth and server time.

One way we can do this, is by using the features of the HTTP protocol. One of those features is the Last-Modified header. This header allows web servers and user agents to see when a resource was last modified. Together with a If-Modified-Since header we can let our software check if it needs to send the whole body or just the a simple 304 header.

However to make sure if this works as advertised, we need a way to simulate this situation. I use lwp-mirror to test this, which is included with the LWP package from Perl. It mirrors a remote resource to a local file.

Let's start the test. First download your resource to a file with the lwp-mirror command.

lwp-mirror <url> <local_file>

Now download the file again and check if it sends a 304 code now. Then do something that changes the resource on the server. In my case this is done by added a new post. Now download the resource again and see if it sends a new version of the file. Once downloaded, you check if you get another 304 code.

Just for reference, maybe somebody can find some use for this.

I installed Cacti, I added a few graphs, but I couldn't see the first page of graphs in the graph view. I could click on the graphs and I would see all graphs, just not the first page.

After searching for problems I found the following line in my /var/log/apache2/error.log log file.

ERROR: I don't understand ':15:00 To 2011/03/09 10:15:00\c' \
  in command: 'COMMENT:From 2011/03/09 09:15:00 To 2011/03/09 \
  10:15:00\c'.

This problem can be fixed by choosing the right version of RRDtool in your cacti Settings. So change Settings > RRDTool Utility Version to 'RRDTool 1.2.x'.

Now the graphs will be shown.

View archived entries