Skip to content

Instantly share code, notes, and snippets.

@dcadenas
Created June 4, 2009 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcadenas/123457 to your computer and use it in GitHub Desktop.
Save dcadenas/123457 to your computer and use it in GitHub Desktop.
Script for searching spanish words on the RAE website
#!/usr/local/bin/ruby
require 'rubygems'
gem 'rest-client'
gem 'main'
gem 'highline'
require 'restclient'
require 'main'
require 'highline/import'
$terminal.wrap_at = 80
$terminal.page_at = 22
HighLine.track_eof = false
Main do
argument('word') do
description "Palabra a buscar"
end
def url
"http://buscon.rae.es/draeI/SrvltGUIBusUsual"
end
def elinks(word)
`curl -sd 'LEMA=#{word}' #{url}|elinks -dump -no-numbering -no-references`
end
def run
word = params['word'].value
say elinks(word)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment