Since a friend of mine told me of using OpenOffice as a daemon to run tasks automatically, I thought that would be nice to try it as a part of a proof of concept to a slideshare mini clone. It would be a matter of uploading the original file, convert it using OO and displaying a page along with it. There`s an API and many clients. I choose not to develop a new client and used JodConverter. Of course I would have to develop a new converter if I wanted to inject or run customized procedures over a document.

Read the rest of this entry »

Ultra exciting mashups in python ! Check https://zenmachine.wordpress.com/rss-to-twitter-automagic-poster/

Hi. Long time no see eh ?

There is nothing wrong with Ruby. Fine language, great gems and so on. But its interpreter sucks. Since I had to cross compile it for arm, and later fooling around with it while a friend had to run some heavy weight gdb debugging on it, I noticed that most of it was sloppy. Worst than green threads and stuff which really matters when developing for a high load and concurrency environment, there are places that plainly sucks.

It’s a shame, because Ruby itself is great, and I really appreciate that you can do everything in a lot of ways. It makes porting libraries from other languages a breeze. I hope it gets better by 1.9 or 2.0.

Meanwhile, I started to do some stuff using python, specially for networked services. Check out my come back at  https://zenmachine.wordpress.com/web-services-and-twisted/

Cheers !

icalendar gem

November 19, 2007

ICalendar (iCal) is a standard for calendar data interchange. There’s a gem called icalendar, which helps to parse and generate such file, so you may use data from your google or exchange calendar to feed your app (or make it generate data to feed your calendar, e.g., a link to Digg or Facebook in each post of your blog to setup a TODO item).

To parse a .ics file (iCal invite or TODO item) it’s just a matter of looping thru the elements in a given calendar. A ics file may hold more than one calendar, end each calendar may contain events and TODO itens.

#!/usr/bin/env ruby
require 'rubygems'

require 'icalendar'


if (ARGV.size < 1) then
 puts "Usage: ical_parse.rb <calendar.ics>"
 exit
end


cal_file = File.open(ARGV[0])

cals = Icalendar.parse(cal_file)
if (cals.size==0) then
 puts "Empty calendar"
 exit
end


cals.each {|c|

 puts "\nEvents\n\n"


	if (c.events.size == 0) then

 	puts "Empty event list"

 else

 	c.events.each { |e|

 		puts "---------------------------------------"

 		puts "Seq:"+e.sequence.to_s
 		puts "UID:"+e.uid.to_s
 		puts "DTSTART: "+e.dtstart.to_s
 		puts "summary: " + e.summary
 		puts "location: " + e.location
 		puts "description: "+e.description

 		if (not e.attendees.nil?) then

 			puts "attendee: "
 			e.attendees.each{|a|
 				puts "\t"+a.to
 			}

 		end

 		puts "---------------------------------------"

 	}

 end


	puts "\nTODO\n\n"

	t=c.todos
 if (t.size == 0) then

 	puts "Empty TODO list"

 else

 	puts "---------------------------------------"

 	t.each {|oi|

 		puts "Seq:"+oi.sequence.to_s
 		puts "UID:"+oi.uid.to_s
 		puts oi.dtstart
 		puts "summary "+oi.summary

 	}

 	puts "---------------------------------------"

 end

}

 	

Ruby and document indexing

October 30, 2007

I did some Ferret testing and the results were pretty fine. Check it out.

oy for another post

October 29, 2007

This time, scraping the web with ruby and hpricot. Did I told you before that this is not a Ruby blog ?

https://zenmachine.wordpress.com/scraping-with-hpricot-and-ruby/

imap rss feed

October 25, 2007

Here is a RSS feed generator for IMAP accounts using ruby and the excellent RubyRSS library. It may be changed to read from multiple accounts. Source code.

Also check RubyRSS website at http://www.rubyrss.com/ .