Skip to content

Instantly share code, notes, and snippets.

@dukex
Created March 29, 2012 16:46
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 dukex/2239715 to your computer and use it in GitHub Desktop.
Save dukex/2239715 to your computer and use it in GitHub Desktop.
New API Proposal to Sally
Sally.start do
analise do
target "url.com"
data { uf: "SP" }
method "POST" # or GET
end
search_and_extract root: "ul#any_resource li" do # root default is html
data :name, "div a" # like -> ul li div a
data :desc, "#content p" do |p|
p.text # passed the element, in example p
end
end
save do
# url method
method "POST" # or GET
url "meuserve.com"
# db method
server "mydbserver.com"
database "mydatabase"
username "userX"
password "xxxxx"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment