Sha256: 57a94df27df6f49edbcca6e824b94cb327bc1d30a05ba5d8c952e77e2f0c57ff
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
module Ubiquitously module Faves class User < Ubiquitously::Base::User def login page = agent.get("https://secure.faves.com/signIn") form = page.forms.detect {|form| form.form_node["id"] == "signInBox"} form["rUsername"] = username form["rPassword"] = password page = form.submit @logged_in = (page.title =~ /Sign In/i).nil? unless @logged_in raise AuthenticationError.new("Invalid username or password for #{service_name.titleize}") end @logged_in end end class Post < Ubiquitously::Base::Post validates_presence_of :url, :title, :description, :tags def save return false unless valid? user.login page = agent.get("http://faves.com/createdot.aspx") form = page.form_with(:name => "createDotForm") form["noteText"] = description form["urlText"] = url form["subjectText"] = title form["tagsText"] = tags.join(", ") #form["rateSelect"] unless options[:debug] == true page = form.submit end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ubiquitously-0.0.1.6 | lib/ubiquitously/faves.rb |