Stereonaut!

Archive for the ‘github’ tag

Feedbag 0.6

without comments

I just uploaded Feedbag 0.6 to Gemcutter and GitHub.

Just a couple of small nice additions to this version:

  • The undocumented args[:narrow] option has been disabled until further notice.
  • A nice little commit from one of Feedbag's forks, by Patrick Reagan.
  • Added an executable to find feed URLs directly:

Sometimes you need to find the feed for a URL quickly, not from a script. What I do, and what someone else showed me too, is this:

~ $ irb
-- require "rubygems"
= true
-- require "feedbag"
= true
-- Feedbag.find "http://stereonaut.net"
= ["http://stereonaut.net/feed", "http://stereonaut.net/tag/feed/", "http://stereonaut.net/comments/feed/"]
--

But now you can simply do:

~ $ feedbag cnn.com http://twitter.com/compupaisa
== cnn.com:
 - http://rss.cnn.com/rss/cnn_topstories.rss
 - http://rss.cnn.com/rss/cnn_latest.rss
== http://twitter.com/compupaisa:
 - http://twitter.com/statuses/user_timeline/119479806.rss
 - http://twitter.com/favorites/119479806.rss
~ $

Enjoy the feedbag executable on your $PATH now!

Written by David Moreno

March 5th, 2010 at 8:36 pm

Categorized in: planeta linux,ruby

Tagged with , , , ,

Perl Seminar NY: 2009-10 Season Begins Tuesday Oct 20

without comments

59991546_b9fc0327b4This next Tuesday October 20th, the Perl Seminar returns to New York City! This is a great effort by Jim Keenan, always trying to push the meetings and encouraging people on attending and sharing. There's usually one meeting per month and it's very well located, in midtown Manhattan, on a suite in the Ramada New Yorker hotel building facilitated by the NYPC User Group.

The first meeting will be about Git, GitHub and how you can use it on your Perl code and projects. It'll be very interesting for newcomers! More details on the original post, and make sure to subscribe to the discussion group.

Written by David Moreno

October 5th, 2009 at 12:22 pm

Categorized in: git,github,nyc,perl,planeta linux

Tagged with , , ,

GitHub's Octocat stickers!

without comments

They arrived today!

Also, I must say, they flew away immediately with work buddies, so from the 8 stickers the guys kindly sent, I only kept two, but that's cool. I guess :-)

Thanks GitHub!

Written by David Moreno

May 6th, 2009 at 12:53 pm

Categorized in: github,mail,planeta linux

Tagged with , ,

Quick feed aggregation with Vitacilina

without comments

Vitacilina, ¡ah, qué buena medicina!

A few months ago. Maybe more than a year, I started hacking on Vitacilina, which was meant to be the replacement for Planet on all countries Planeta Linux supports. I was doing well, I even hosted the code back then in Google Code. Later, I forgot about it, but I'd always been wanting to replace Planet with some homebrew solution for the Planeta Linux community. Anyway, that hasn't happened yet. However, I did start using Vitacilina for my own needs on a local sandbox for my employer and it used to work pretty well. I've been hacking it to fit very specific requirements, though.

Anyway, I thought it was a good moment to release it publicly, just because it was all hidden there. So, I didn't implement the changes I did for my employer (because they were very specific for our products) but I did clean it up and wrote some documentation.

Now, what exactly is Vitacilina? Well, it's a feed aggregator. It's written in Perl (it's a Perl module) and it uses YAML to get its list of feeds and names and Template Toolkit to format and dump the output, it was efficient for me because it was very easy for me to create dumps:

use Vitacilina;

my $v = Vitacilina->new(
  config => "config.yml",
  template => "template.tt",
  output => "output.html",
);
$v->render;

And that's it. I used to create YAML files on the fly to create new Vitacilina objects and render them according to some data.

The  config file would look something like this:

http://myserver.com/myfeed:
  name: Some Cool Feed

http://feeds.feedburner.com/InfinitePigTheorem:

  name: David Moreno

And the template file:

 [% FOREACH p IN data %]
  <a href="[% p.permalink %]">[% p.title %]</a>
   by <a href="[% p.channelUrl %]">[% p.author %]</a>

 [% END %]

In that way, it's very simple, quick and easy to do aggregations. I just love TT, why wouldn't I? :-)

So go grab Vitacilina at CPAN. Also, the Git repo is at github.com/damog/vitacilina.

However… I started to hack on a similar more ambitious project called rFeed, that it's more of a framework than a simple library, which is why I stopped further Vitacilina development. I'll talk about rFeed later when the time comes.

Written by David Moreno

January 29th, 2009 at 9:36 pm

Ruby goodies: Modules and methods for my everyday Ruby

without comments

I make a lot of Web script processing, whether scraping, webservices, systems administration, etc. Because I sometimes happen to repeat small and useful chunks of code for different projects, I thought that, given making new modules and methods is usually hassleless in Ruby, I should make my own set of methods and goodies I constantly use. Example 1, I sometimes miss Perl's LWP::Simple simplicity where I just pass a URL to a subroutine and get the content on a variable, quick, one-liner. Example 2, extract all links on a given URL on an array that I can then iterate and maybe fetch given the first example. Getting all A links is very easy to do, say with regex or with Hpricot (which should the best way to parse HTML), but most of the time I (and people, I'd bet) need absolute URLs which is fairly more complex (relative, absolute URLs, BASE href declarations, etc, the same case as in Feedbag).

Well, for different cases like that one, I've started my own set of Ruby goodies. If you don't find them useful, I understand, they are mostly for my needs, I just want to make it public, because maybe, some other people might indeed find them useful.

Simple installation:

sudo gem install damog-goodies -s http://gems.github.com/

As time and needs pass, I will be adding stuff into it. For the time being, here's both above examples in action:


>> require "goodies"
requiring /var/lib/gems/1.8/gems/damog-goodies-0.1/lib/goodies/array.rb
requiring /var/lib/gems/1.8/gems/damog-goodies-0.1/lib/goodies/lwr.rb
requiring /var/lib/gems/1.8/gems/damog-goodies-0.1/lib/goodies/html.rb
=> true
>> pp HTML::Links.find "damog.net"
["mailto:david-YOUKNOWTHEDEAL-axiombox.com",
 "http://log.damog.net/",
 "http://historiasdenuevayork.com",
 "http://axiombox.com/",
 "http://flickr.com/photos/raquelydavid",
 "http://last.fm/user/damog",
 "http://maggit.com.mx",
 "http://twitter.com/damog",
 "http://www.facebook.com/profile.php?id=670490388",
 "http://www.chess.com?ref_id=1380378",
 "http://www.chess.com",
 "http://www.chess.com/members/view/damog?ref_id=1380378",
 "http://www.chess.com/echess/create_game.html?uid=1380378&ref_id=1380378",
 "http://www.chess.com/home/game_archive.html?member=damog&ref_id=1380378"]
=> nil
>> pp HTML::Links.find("http://google.com").first(10)
["http://images.google.com/imghp?hl=en&tab=wi",
 "http://maps.google.com/maps?hl=en&tab=wl",
 "http://news.google.com/nwshp?hl=en&tab=wn",
 "http://www.google.com/prdhp?hl=en&tab=wf",
 "http://mail.google.com/mail/?hl=en&tab=wm",
 "http://www.google.com/intl/en/options/",
 "http://video.google.com/?hl=en&tab=wv",
 "http://groups.google.com/grphp?hl=en&tab=wg",
 "http://books.google.com/bkshp?hl=en&tab=wp",
 "http://scholar.google.com/schhp?hl=en&tab=ws"]
=> nil
>> get "debian.org"
[snip]
>> get("planeta.debian.net")[0, 100]
=> "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
>>

Repository is, as usual, kindly hosted at GitHub on damog/goodies.

Written by admin

January 3rd, 2009 at 11:27 pm