hecpeare.net - Héctor Pérez
Emprender, democracia, Internet, software y conocimiento libre… y un poco de sentido común.
  • All
  • About
  • Contact
  • English
  • Español
  • fav2fav

Seekr Code

5 12 2007

I leave the main (and very simple) method below. Go to the subversion repository git repository to find the complete code of Seekr (license: GNU Affero GPL). You may want to go to the camping site sinatra site.


def get(key)
vars=key.split('/')
size=vars.size - 1
list=YAML.load(IO.read('list.yml'))
case size
when 0
url="http://www.google.com/search?q=" + key
when 1
#e.g. seekr.es/w/free_software -> http://en.wikipedia.org/wiki/Free_software
url=list[vars[0]]
url.gsub!("$1$",vars[1]) if url
else
#e.g. seekr.es/w/es/GNU -> http://es.wikipedia.org/wiki/GNU
url=list[vars[0] + size.to_s]
size.times{|n| url.gsub!("$#{n+1}$",vars[n+1])} if url
end
if url
redirect url
else
...
end
end

« Seekr.es - simple and useful SAGE - Aplicaciones matemáticas libres »

Actions

  • rss Comments rss
  • trackback Trackback

Informations

  • Date : 5 December 2007
  • Categories : English

2 responses to “Seekr Code”

5 12 2007
hecpeare.net » Seekr.es - simple y útil (19:30:12) :

[…] No se si existirá algo similar, pero como no cuesta casi nada programarlo (ya publicaré… ver el código), no me he detenido a […]

5 12 2007
hecpeare.net » Seekr.es - simple and useful (19:45:26) :

[…] Update: Seekr code […]

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


  • hector@arpamet.com
  • twitter, linkedin, xing

Recibir novedades (email):

feeds

  • RSS All
  • RSS English
  • RSS Español
  • RSS Comments

Categories

  • English
  • Español

Recent Posts

  • Libros en cadena en Iniciador
  • Tratar de convencer a un CEO, empresa o administración
  • Sleeping mode for FavPal
  • Reto maddog 2008 en Campus Party
  • FavPal, foros y @thankyou

Archives

  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007

Tags

aplicaciones web libres birmania blog blogosfera burma camping conferenciarails conferenciarails2007 conferencias economia social elpaisllamadoa Emprendedores Emprender FAQ fav fav2fav favonomía favpal free freedom free software GNU Affero GPL Google Iniciador intercambio de favores intercambio favores Internet libertad libre Libros Matemáticas MATLAB Octave OpenID rails ruby SAGE Seekr Silicon Valley simple social software libre teleco Valencia Wordpress

META

  • Admin

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox