Sha256: 2264fbd9c02cee9b1d0a1ea4dd6dee0ce588494c696549d0f183dc21730c7d62

Contents?: true

Size: 989 Bytes

Versions: 1

Compression:

Stored size: 989 Bytes

Contents

module Ubiquitously
  module Webdev5
    class Account < Ubiquitously::Service::Account
      def login
        page = agent.get("http://webdev5.com/user/login")
        form = page.forms.detect {|form| form.form_node["id"] == "user-login"}
        form["name"] = username
        form["pass"] = password
        page = form.submit
        
        authorize!(page.title.strip !~ /^User account/i)
      end
    end
    
    class Post < Ubiquitously::Service::Post
      submit_to "http://webdev5.com/submit?url=:url&title=:title&body=:body"
      
      def create
        page = agent.get("http://webdev5.com/submit")
        form = page.forms.detect {|form| form.form_node["id"] == "node-form"}
        
        form["url"] = token[:url]
        form["title"] = token[:title]
        form["body"] = token[:body]
        form.field_with(:name => "taxonomy[1]").options.each do |option|
          
        end
        form["taxonomy[tags][2]"] = token[:tags]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ubiquitously-0.1.0 lib/ubiquitously/services/webdev5.rb