Archive for September, 2007

Push your feeds into Funnel

I have continued my experiment with the RSS libs a bit, and have built a first prototype that I call Funnel.

Funnel takes the feeds declared in the feeds table.

In a separate thread, it runs a script that looks at the feed, and if there is a new item or an item that looks like it is updated, it runs a filter on it.

The filter is completely extensible, so that I can add antispam measures later like I did here.

Once the item is accepted, it is picked up by the feed when building it using Builder.

I fund this project with Micropledge. Micropledge is a really cool website to get your open source projects funded. Check it out!

At this point, I achieved my primary goal but have new issues I need to deal with.

  • I want to record the feed optionally. I want to make it possible for the user to record completely the items in the items table, so that he does not have to bother about them.
  • I use Rails. While this gives a nice frame to my application, it is clearly overkill for some uses of Funnel. I think I should make it available in different little gems, and the core gem would provide pretty much as simple as Svn2Rss is.
  • The feed is not cached. It is currently recreated every time someone asks for it. Like Svn2Rss, I need to create an asynchronous way to output it.

If I have those core components working, I can easily create an administration interface and a UI to show my feed.

If you are interested into this project, you can fund it and/or join the mailing list:

Google Groups

Subscribe to Funnel Atom and RSS merger
Email:
Visit this group

Scala syntax extension

Follow up with yesterday:
you can get my Scala syntax gem extension here, and read below for the instructions on how to install it.

First here is the result:


/**
 so much fun
*/
class Auction(seller: Actor, minBid: Int, closing: Date) extends Actor {
  val StringForFun = "hello"
  val timeToShutdown = 36000000 // msec
  val bidIncrement = 10
  def act() {
    var maxBid = minBid - bidIncrement
    var maxBidder: Actor = null
    var running = true
    while (running) {
      receiveWithin ((closing.getTime() - new Date().getTime())) {
        case Offer(bid, client) =>
          if (bid >= maxBid + bidIncrement) {
            if (maxBid >= minBid) maxBidder ! BeatenOffer(bid)
            maxBid = bid; maxBidder = client; client ! BestOffer
          } else {
            client ! BeatenOffer(maxBid)
          }
        case Inquire(client) =>
          client ! Status(maxBid, closing)
        case TIMEOUT =>
          if (maxBid >= minBid) {
            val reply = AuctionConcluded(seller, maxBidder)
            maxBidder ! reply; seller ! reply
          } else {
            seller ! AuctionFailed
          }
          receiveWithin(timeToShutdown) {
            case Offer(_, client) => client ! AuctionOver
            case TIMEOUT => running = false
          }
      }
    }
  }
}

You will need to add those CSS elements to display things correctly:

pre {
	background: #000000 repeat-x;
	color: #00FF00;
	font-family: arial, 'lucida console', sans-serif;
	line-height: 160%;
	font-size: 120%;
}

code {
	color: #00EE00;
	font-style: bold;
	font-family: arial, 'lucida console', sans-serif;
}	

.comment { color: #333; font-style: italic; }
.keyword { color: #eff; font-weight: bold; }
.punct { color: #444; font-weight: bold; }
.symbol { color: #0bb; }
.string { color: #6b4; }
.ident { color: #00b; }
.constant { color: #66f; }
.regex { color: #a82; }
.number { color: #a33; }
.expr { color: #227; }

Then on your machine, you will need ruby and rubygems installed, and install redcloth and syntax:

gem install syntax
gem install redcloth

Put your sample into a text file in the same folder as run.rb, then run:

ruby run.rb myscala.txt > output.html

That’s about it. It’d be great to develop the same things for Java and CSS. In the mean time, enjoy!

Textile

When creating the documentation for svn2rss, I fell on the awesome “newgem” gem that Rubyforge provides to help outputting a website and releasing gems.

It was really very helpful, and I liked the way the syntax gem just transformed my ruby code into a nice color block. (I am still looking for the right shade of grey for the comments though)

I would like to provide an extension of the syntax gem to do the same thing for scala. (I still have to learn the language first, hopefully the pdfs on the website will be entertaining).

I haven’t been able to find a previous work in this area. Feel free to comment if you happen to have something already working.

5.0

I started working for Intalio more than a year ago.

At the time I was a young software engineer with some skills regarding the Eclipse platform.
I grabbed a seat, and stayed there learning how to code with a team, parsing XML, understanding BPEL, hacking WSDL and groking Ruby.

Working for Intalio is fun. I personally feel like I am constantly rewarding myself. Every feature we bring in is a new skill, a new technology we master.
There is no forbidden path to achievement, we always take the shortest one, and that means slashing into code, rewriting, beautifying, migrating fearlessly.

In a small structure like this one, one thing continues to astonish me: we don’t discuss objectives. We all know where we fit and bend together to make it work.

For the last year we have been running a marathon, rewriting most of the Designer. I am proud of announcing to you that it is available for everyone and for free out there.

Ismael thanks all the persons that made it possible, and I’d like to thank them too, not only the team today, but the team I did not have the chance to know two or three years ago.

After this release, nothing has changed. We are still focused on the product and delivering the best experience to our customers.
We already started digging and have some finds for 5.1.

More on all this very soon.

Testing svn2rss

So my latest cool app is asking Subversion the latest changes over the repository.

It pretty much does this:

svn log #{your_url} --limit #{when_you_d_like_to_stop}

Then, for every revision, it runs a diff:

svn diff #{rev1}:#{rev2}

After playing around for some time with all those commands, my advice is to run svn2rss with Subversion 1.4, as my tests were taking more than 2 minutes to complete.

Subversion commits

I did some hacking this week-end, and the result is called svn2rss.

It’s a simple lib to parse a subversion log and create a RSS 2.0 feed out of it.

Quick snippet to show you how it works:

# the module to include in your script.
self.include Svn2rss

# parse the svn log
entries = parseSvnLog("http://myfeed.com/rss")
# create your own feed
feed = createRSSFeed(entries,
        "http://myfeed.com/rss",
        "My very own title",
        "My description of the feed",
        "en",
        "managingEditor@myfeed.com",
        "webmaster@myfeed.com")
# Well, as you can see the API is clearly not optimized.
# Still working on that particular point, so expect your API to break often till 1.0.

The implementation is coming with some complete examples:
-create a WEBrick server that will serve your feed.
-create a file to hold your changes and send it through FTP to a server.

You can check out a live instance of svn2rss here, and below is a snippet generated with Feed2JS.

0.1 is out, so installing it is just a matter of muttering the magic works:

sudo gem install svn2rss

I hope you like it. It cuts the deal for me. It certainly isn’t a replacement for some great tools like Fisheye, but it helps showcasing my works. More on that very soon.

Meanwhile, at Intalio…

Photo excerpted from Techcrunch fr.

Where did my project go ?

There is a particular point in Eclipse I dislike.

Importing projects.

Well actually that is not true, importing a project directly from an archive or a directory is awesome.

The thing is, sometimes you found the archive, you double-click on it, and then:

nothing.

The wizard detected that another project in your workspace was bearing the same name. So it just didn’t show it.

The current workaround consists of opening the archive and look at the same of the folder. Then it’s time to come back in Eclipse and delete the project to replace it.

This is rather a problem for me as our QA team at Intalio has a huge panel of tests, and attaches its processes to the bugs.
So I am confronted to this problem, if no quite everyday, at least two or three times a week. And as QA tests always have the same name, I have taken the (bad) habit to delete projects as soon as I suspect that I am experiencing the bug - sometimes I get it right, and the “Test” project was guilty, sometimes I just lose time…

If you are in the same case and feel compelled to see this bug closed, feel free to comment the bug 173994.

Scala Eclipse plugin

Scala is a Java based language that combines the best of Ruby with strong types.

Sean McDirmid just released a new beta version of the plugin.

It is available through an update site: http://lamp.epfl.ch/~mcdirmid/scala.update

Congratulations to Sean for this achievement ! I look forward to dive into Scala and help on this front.

The complete announcement is available here.

Playing with the RSS and Atom Ruby libraries

    In order to create a feed for the Intalio community,

    I have been checking out the various libraries available out there in Ruby.

    My first goal is to be able to parse both RSS and Atom feeds.

    In chronogical order, here are my finds:

  • Feed Normalizer
  • Feed Normalizer does a pretty good job at parsing both RSS and Atom feeds.

    Feed Normalizer uses a list of parsers with priority to parse the feeds. It appears the best parser is simple-rss, none other supporting Atom.
    So basically using Feed Normalizer is facading simple-rss nicely.

  • simple-rss
  • Simple-rss is a GPL library that parses RSS and Atom feeds. That’s cool, but simple-rss missed the issued attribute on the Atom feeds, so there is no way to get the publication date.

    I opened a bug regarding this issue.

  • Atom
  • Atom sounded like a good library, but from what I saw there was no RSS support.

  • FeedTools
  • FeedTools is apparently the most accomplished library I have seen.

    Apparently its caching mechanism is good, but not perfect and generating a feed with it is taking more and more time.

  • Conclusion
    All the libraries I have been looking into don’t have much documentation, and are more or less maintained.

    I am still looking at the solutions available:

    • Create some new parsers on feed-normalizer to handle Atom nicely.
    • Create my very own parser to parse any feed out there. I prefer this function because I could handle the feeds as Atom by default, instead of losing their information with RSS.