Sha256: c83680f4b0b4d9678528bbf945d2ab8c869158be058a86c0867944151ba6619d

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

module Ubiquitously
  module MySpace
    class Account < Ubiquitously::Service::Account
      def login
        referer = "http://localhost:4567/"
        url = MyspaceToken.authorize_url(referer)
        page = agent.get(url, [], referer)
        form = page.forms.detect { |form| form.form_node["id"] == "login_form" }
        form["email"] = username
        form["pass"] = password
        page = form.submit
        
        # do something with the oauth token, save it in the cookie?
        
        authorized?(page.uri !~ /http:\/\/login\.facebook\.com\/login\.php/i)
      end
    end
    
    class Post < Ubiquitously::Service::Post
      def create
        page = agent.get("")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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