Skip to content

Instantly share code, notes, and snippets.

@mateuspontes
Created November 7, 2012 03:19
Show Gist options
  • Save mateuspontes/4029396 to your computer and use it in GitHub Desktop.
Save mateuspontes/4029396 to your computer and use it in GitHub Desktop.
Bible mechanized
require 'rubygems'
require 'mechanize'
agent = Mechanize.new
# params
book = "sl"
chapter = "100"
verse = [1,2,3,4]
text = []
# search for verses
verse.each do |vers|
text << agent.get("http://www.bibliaonline.com.br/acf/" + book + "/" + chapter).search("//*[@id='content']/article/div/section/p[" + vers.to_s + "]")
end
# print each verse
text.each { |t| puts t.children }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment