ubiquitously 0.0.1.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +224 -19
- data/Rakefile +12 -4
- data/bin/u.me +4 -0
- data/lib/ubiquitously.rb +56 -7
- data/lib/ubiquitously/commands/base.rb +118 -0
- data/lib/ubiquitously/commands/post.rb +108 -0
- data/lib/ubiquitously/commands/user.rb +111 -0
- data/lib/ubiquitously/extensions/callbacks.rb +62 -0
- data/lib/ubiquitously/extensions/core.rb +88 -0
- data/lib/ubiquitously/extensions/mechanize.rb +35 -0
- data/lib/ubiquitously/models/base.rb +18 -0
- data/lib/ubiquitously/models/page.rb +28 -0
- data/lib/ubiquitously/models/post.rb +66 -0
- data/lib/ubiquitously/models/service.rb +1 -0
- data/lib/ubiquitously/models/service/account.rb +57 -0
- data/lib/ubiquitously/models/service/account/authorizable.rb +58 -0
- data/lib/ubiquitously/models/service/account/loggable.rb +50 -0
- data/lib/ubiquitously/models/service/account/restful.rb +21 -0
- data/lib/ubiquitously/models/service/post.rb +59 -0
- data/lib/ubiquitously/models/service/post/loggable.rb +64 -0
- data/lib/ubiquitously/models/service/post/ownable.rb +31 -0
- data/lib/ubiquitously/models/service/post/postable.rb +73 -0
- data/lib/ubiquitously/models/service/post/restful.rb +52 -0
- data/lib/ubiquitously/models/user.rb +128 -0
- data/lib/ubiquitously/services/blogger_den.rb +68 -0
- data/lib/ubiquitously/services/chetzit.rb +37 -0
- data/lib/ubiquitously/services/code_project.rb +21 -0
- data/lib/ubiquitously/services/delicious.rb +54 -0
- data/lib/ubiquitously/services/design_bump.rb +41 -0
- data/lib/ubiquitously/services/designgizer.rb +21 -0
- data/lib/ubiquitously/services/designr_fix.rb +21 -0
- data/lib/ubiquitously/services/digg.rb +151 -0
- data/lib/ubiquitously/services/digzign.rb +25 -0
- data/lib/ubiquitously/services/diigo.rb +68 -0
- data/lib/ubiquitously/services/dzone.rb +132 -0
- data/lib/ubiquitously/services/dzone_snippets.rb +39 -0
- data/lib/ubiquitously/services/facebook.rb +42 -0
- data/lib/ubiquitously/services/faves.rb +81 -0
- data/lib/ubiquitously/services/favshare.rb +78 -0
- data/lib/ubiquitously/services/flikode.rb +38 -0
- data/lib/ubiquitously/services/friendfeed.rb +21 -0
- data/lib/ubiquitously/services/gist.rb +52 -0
- data/lib/ubiquitously/services/google_buzz.rb +15 -0
- data/lib/ubiquitously/services/identica.rb +15 -0
- data/lib/ubiquitously/services/jump_tags.rb +21 -0
- data/lib/ubiquitously/services/kailoon.rb +27 -0
- data/lib/ubiquitously/services/meta_filter.rb +26 -0
- data/lib/ubiquitously/services/mixx.rb +94 -0
- data/lib/ubiquitously/services/mmo.rb +22 -0
- data/lib/ubiquitously/services/mvc_forge.rb +37 -0
- data/lib/ubiquitously/services/my_space.rb +25 -0
- data/lib/ubiquitously/services/nestdev.rb +36 -0
- data/lib/ubiquitously/services/newsvine.rb +76 -0
- data/lib/ubiquitously/services/pixel_groovy.rb +22 -0
- data/lib/ubiquitously/services/posterous.rb +24 -0
- data/lib/ubiquitously/services/programmers_heaven.rb +21 -0
- data/lib/ubiquitously/{propeller.rb → services/propeller.rb} +17 -26
- data/lib/ubiquitously/services/queness.rb +38 -0
- data/lib/ubiquitously/services/reddit.rb +62 -0
- data/lib/ubiquitously/services/scribd.rb +21 -0
- data/lib/ubiquitously/services/script_and_style.rb +23 -0
- data/lib/ubiquitously/services/sharebrain.rb +19 -0
- data/lib/ubiquitously/services/shoutwire.rb +34 -0
- data/lib/ubiquitously/services/slideshare.rb +70 -0
- data/lib/ubiquitously/services/smipple.rb +21 -0
- data/lib/ubiquitously/services/snipplr.rb +67 -0
- data/lib/ubiquitously/services/snipt.rb +49 -0
- data/lib/ubiquitously/services/sphinn.rb +24 -0
- data/lib/ubiquitously/services/stumble_upon.rb +67 -0
- data/lib/ubiquitously/services/stumpedia.rb +13 -0
- data/lib/ubiquitously/services/tumblr.rb +28 -0
- data/lib/ubiquitously/services/tweako.rb +53 -0
- data/lib/ubiquitously/services/twitter.rb +60 -0
- data/lib/ubiquitously/services/web_blend.rb +25 -0
- data/lib/ubiquitously/services/webdev5.rb +32 -0
- data/lib/ubiquitously/services/who_freelance.rb +21 -0
- data/lib/ubiquitously/services/wordtaps.rb +36 -0
- data/lib/ubiquitously/services/yahoo_buzz.rb +64 -0
- data/lib/ubiquitously/services/youblr.rb +15 -0
- data/lib/ubiquitously/services/zabox.rb +22 -0
- data/lib/ubiquitously/support/active_record.rb +25 -0
- data/lib/ubiquitously/support/storage.rb +71 -0
- data/test/config/cookies.yml +111 -0
- data/test/config/credentials.yml +7 -0
- data/test/config/secrets.yml +33 -0
- data/test/config/tokens.yml +30 -0
- data/test/meta.html +19 -0
- data/test/test_delicious.rb +37 -0
- data/test/test_digg.rb +57 -0
- data/test/test_dzone.rb +23 -18
- data/test/test_facebook.rb +40 -0
- data/test/test_faves.rb +18 -20
- data/test/test_helper.rb +8 -1
- data/test/test_newsvine.rb +3 -3
- data/test/test_page.rb +21 -0
- data/test/test_post.rb +55 -0
- data/test/test_propeller.rb +2 -2
- data/test/test_reddit.rb +26 -4
- data/test/test_stumble_upon.rb +23 -3
- data/test/test_twitter.rb +33 -0
- data/test/test_user.rb +22 -0
- metadata +199 -24
- data/lib/ext.rb +0 -37
- data/lib/ubiquitously/base.rb +0 -56
- data/lib/ubiquitously/dzone.rb +0 -111
- data/lib/ubiquitously/faves.rb +0 -43
- data/lib/ubiquitously/mister_wong.rb +0 -11
- data/lib/ubiquitously/mixins/resourceful.rb +0 -50
- data/lib/ubiquitously/mixx.rb +0 -66
- data/lib/ubiquitously/newsvine.rb +0 -54
- data/lib/ubiquitously/reddit.rb +0 -46
- data/lib/ubiquitously/sphinn.rb +0 -11
- data/lib/ubiquitously/stumble_upon.rb +0 -61
- data/test/config.yml +0 -18
@@ -0,0 +1,53 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Tweako
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("http://www.tweako.com/?q=user/login")
|
6
|
+
form = page.forms.detect { |form| form.form_node["id"] == "user_login" }
|
7
|
+
form["edit[name]"] = username
|
8
|
+
form["edit[pass]"] = password
|
9
|
+
page = form.submit
|
10
|
+
|
11
|
+
authorize!(page.title !~ /^user account/i)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Post < Ubiquitously::Service::Post
|
16
|
+
# Either your first 400 characters will be used,
|
17
|
+
# or you can determine where the teaser ends
|
18
|
+
# by starting a new paragraph before the first 400 characters.
|
19
|
+
# Make sure there is no text formatting or images in the teasers!
|
20
|
+
#
|
21
|
+
# A comma-separated list of terms describing this content.
|
22
|
+
# Example: photoshop, free software.
|
23
|
+
# Limit the amount of terms to a maximum of 6. Please choose relevent and descriptive terms.
|
24
|
+
# Enter tags in ALL lower-case letters, and ensure spelling is correct.
|
25
|
+
def tokenize
|
26
|
+
super.merge(
|
27
|
+
:description => self.description[0..400],
|
28
|
+
:tags => self.tags[0..6].taggify(" ", ", ")
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def create
|
33
|
+
page = agent.get("http://www.tweako.com/node/add/storylink")
|
34
|
+
form = page.forms.detect { |form| form.form_node["id"] == "node-form" }
|
35
|
+
|
36
|
+
form["edit[title]"] = token[:title]
|
37
|
+
form["edit[vote_storylink_url]"] = token[:url]
|
38
|
+
form.field_with(:name => "edit[taxonomy][1]").options.each do |option|
|
39
|
+
option.select if option.value.to_s == "11"
|
40
|
+
end
|
41
|
+
form["edit[taxonomy][tags][2]"] = token[:tags]
|
42
|
+
form["edit[body]"] = token[:description]
|
43
|
+
form["op"] = "Submit"
|
44
|
+
|
45
|
+
unless debug?
|
46
|
+
page = form.submit
|
47
|
+
end
|
48
|
+
|
49
|
+
true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Twitter
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
uses :oauth
|
5
|
+
|
6
|
+
def login
|
7
|
+
# only login if we don't have cookies
|
8
|
+
url = "http://localhost:4567/"
|
9
|
+
hash = ::TwitterToken.authorize(url)
|
10
|
+
options = {:url => hash[:url]}
|
11
|
+
if cookies?
|
12
|
+
raise "COOKIES"
|
13
|
+
options.merge!(:headers => {"Cookie" => user.cookies_for(:twitter)})
|
14
|
+
page = agent.get(options, [], url)
|
15
|
+
else
|
16
|
+
page = agent.get(options, [], url)
|
17
|
+
form = page.forms.first
|
18
|
+
form["session[username_or_email]"] = username
|
19
|
+
form["session[password]"] = password
|
20
|
+
page = form.submit
|
21
|
+
end
|
22
|
+
|
23
|
+
if page.uri.to_s =~ /http:\/\/api\.twitter\.com\/oauth\/authenticate/i
|
24
|
+
if page.links.first.href !~ /http:\/\/localhost/
|
25
|
+
page = page.forms.last.submit
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
authorize!(page.title =~ /Redirecting you back to the application/i)
|
30
|
+
|
31
|
+
location = URI.parse(page.links.first.href)
|
32
|
+
verifier = Rack::Utils.parse_query(location.query)["oauth_verifier"]
|
33
|
+
|
34
|
+
# do something with the oauth token, save it in the cookie?
|
35
|
+
self.credentials = ::TwitterToken.access(
|
36
|
+
:token => hash[:token],
|
37
|
+
:secret => hash[:secret],
|
38
|
+
:oauth_verifier => verifier
|
39
|
+
)
|
40
|
+
|
41
|
+
logged_in?
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class Post < Ubiquitously::Service::Post
|
46
|
+
def create
|
47
|
+
response = access_token.post("/statuses/update.json", {
|
48
|
+
"status" => token[:description],
|
49
|
+
"include_entities" => true
|
50
|
+
})
|
51
|
+
|
52
|
+
result = JSON.parse(response.body)
|
53
|
+
|
54
|
+
if result.has_key?("error")
|
55
|
+
raise result["error"].to_s
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module WebBlend
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("http://digzign.com/login")
|
6
|
+
form = page.form_with(:name => "loginform")
|
7
|
+
form["username"] = username
|
8
|
+
form["password"] = password
|
9
|
+
page = form.submit
|
10
|
+
|
11
|
+
authorize!(page.title =~ /Like Digg/i)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Post < Ubiquitously::Service::Post
|
16
|
+
def save(options = {})
|
17
|
+
return false if !valid?
|
18
|
+
|
19
|
+
authorize
|
20
|
+
|
21
|
+
page = agent.get("")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Webdev5
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("http://webdev5.com/user/login")
|
6
|
+
form = page.forms.detect {|form| form.form_node["id"] == "user-login"}
|
7
|
+
form["name"] = username
|
8
|
+
form["pass"] = password
|
9
|
+
page = form.submit
|
10
|
+
|
11
|
+
authorize!(page.title.strip !~ /^User account/i)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Post < Ubiquitously::Service::Post
|
16
|
+
submit_to "http://webdev5.com/submit?url=:url&title=:title&body=:body"
|
17
|
+
|
18
|
+
def create
|
19
|
+
page = agent.get("http://webdev5.com/submit")
|
20
|
+
form = page.forms.detect {|form| form.form_node["id"] == "node-form"}
|
21
|
+
|
22
|
+
form["url"] = token[:url]
|
23
|
+
form["title"] = token[:title]
|
24
|
+
form["body"] = token[:body]
|
25
|
+
form.field_with(:name => "taxonomy[1]").options.each do |option|
|
26
|
+
|
27
|
+
end
|
28
|
+
form["taxonomy[tags][2]"] = token[:tags]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module WhoFreelance
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("http://service.com/login")
|
6
|
+
form = page.form_with(:name => "loginform")
|
7
|
+
form["username"] = username
|
8
|
+
form["password"] = password
|
9
|
+
page = form.submit
|
10
|
+
|
11
|
+
authorize!(page.title =~ /Some title/i)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Post < Ubiquitously::Service::Post
|
16
|
+
def create
|
17
|
+
page = agent.get("")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Wordtaps
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("http://wordtaps.com/wp-login.php")
|
6
|
+
form = page.form_with(:name => "loginform")
|
7
|
+
form["log"] = username
|
8
|
+
form["pwd"] = password
|
9
|
+
form.checkboxes.first.check
|
10
|
+
page = form.submit
|
11
|
+
|
12
|
+
authorize!(page.parser.css("#login_error").first.nil?)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Post < Ubiquitously::Service::Post
|
17
|
+
def create
|
18
|
+
page = agent.get("http://wordtaps.com/")
|
19
|
+
form = page.form_with(:name => "new_post")
|
20
|
+
|
21
|
+
form["posttitle"] = token[:title]
|
22
|
+
form["posturl"] = token[:url]
|
23
|
+
form.field_with(:name => "category").options.each do |option|
|
24
|
+
option.select if option.value.to_s == "5"
|
25
|
+
end
|
26
|
+
# max length == 800
|
27
|
+
form["tags"] = token[:tags]
|
28
|
+
form["posttext"] = token[:description]
|
29
|
+
|
30
|
+
page = form.submit
|
31
|
+
|
32
|
+
true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module YahooBuzz
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("https://login.yahoo.com/config/login_verify2")
|
6
|
+
form = page.form_with(:name => "login_form")
|
7
|
+
form["login"] = username
|
8
|
+
form["passwd"] = password
|
9
|
+
page = form.submit
|
10
|
+
|
11
|
+
authorize!(page.title.to_s !~ /^Sign in/i)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Post < Ubiquitously::Service::Post
|
16
|
+
|
17
|
+
# yahoo has 4 ajax forms on one page, but they make it look like it's 2 steps
|
18
|
+
def create
|
19
|
+
page = agent.get("http://buzz.yahoo.com/submit")
|
20
|
+
|
21
|
+
headers = {
|
22
|
+
"X-Requested-With" => "XMLHttpRequest",
|
23
|
+
"Content-Type" => "application/x-www-form-urlencoded; charset=UTF-8"
|
24
|
+
}
|
25
|
+
|
26
|
+
# url form
|
27
|
+
form = page.form_with(:name => "urlsubmissionform")
|
28
|
+
if page.body =~ /YAHOO\.Buzz\.Submit\.QueryDataUrl \= \"\\\/submit\\\/get\;_ylt=([^\"]+)\"/i
|
29
|
+
form.action = "http://buzz.yahoo.com/submit/get;_ylt=#{$1}"
|
30
|
+
end
|
31
|
+
|
32
|
+
form["url"] = token[:url]
|
33
|
+
result = form.submit(nil, headers)
|
34
|
+
|
35
|
+
# description form
|
36
|
+
if description
|
37
|
+
form = page.forms.detect do |form|
|
38
|
+
form.form_node["class"] == "inline-edit-form" &&
|
39
|
+
!form.form_node.css("input[value=submitSummary]").first.blank?
|
40
|
+
end
|
41
|
+
form["fieldvalue"] = description
|
42
|
+
form.submit(nil, headers)
|
43
|
+
end
|
44
|
+
|
45
|
+
# category form
|
46
|
+
form = page.forms.detect do |form|
|
47
|
+
form.form_node["class"] == "inline-edit-form" &&
|
48
|
+
!form.form_node.css("input[value=submitCategory]").first.blank?
|
49
|
+
end
|
50
|
+
# form.field_with(:name => "fieldvalue")
|
51
|
+
|
52
|
+
# captcha
|
53
|
+
form = page.form_with(:name => "submissiondataform")
|
54
|
+
captcha_image = form.form_node.css(".captcha-image img").first["src"]
|
55
|
+
|
56
|
+
system("open", captcha_image)
|
57
|
+
# enter captcha response in terminal
|
58
|
+
captcha_says = ask("Enter Captcha from Browser Image: ") { |q| q.echo = true }
|
59
|
+
form["submitCaptcha"] = captcha_says
|
60
|
+
result = form.submit(nil, headers)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Youblr
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
end
|
5
|
+
|
6
|
+
class Post < Ubiquitously::Service::Post
|
7
|
+
validates_presence_of :url, :title, :description, :tags
|
8
|
+
|
9
|
+
def save(options = {})
|
10
|
+
return false unless valid?
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Zabox
|
3
|
+
class Account < Ubiquitously::Service::Account
|
4
|
+
def login
|
5
|
+
page = agent.get("http://www.zabox.net/login.php")
|
6
|
+
form = page.forms.detect { |form| form.form_node["id"] == "thisform" }
|
7
|
+
form["username"] = username
|
8
|
+
form["password"] = password
|
9
|
+
form.checkboxes.first.check
|
10
|
+
page = form.submit
|
11
|
+
|
12
|
+
authorize!(page.parser.css("form .error").text !~ /ERROR/i)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Post < Ubiquitously::Service::Post
|
17
|
+
def create
|
18
|
+
page = agent.get("http://www.zabox.net/submit")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Support
|
3
|
+
module ActiveRecord
|
4
|
+
def self.included(base)
|
5
|
+
base.extend ClassMethods
|
6
|
+
end
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
attr_accessor :ubiquitously_accounts
|
10
|
+
|
11
|
+
def ubiquitous(*args)
|
12
|
+
self.ubiquitously_accounts = args.flatten.map(&:to_s).uniq.map do |service|
|
13
|
+
"Ubiquitously::#{service.camelize}::Account".constantize
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module InstanceMethods
|
19
|
+
def ubiquitously
|
20
|
+
@ubiquitously ||= Ubiquitously::User.new
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Ubiquitously
|
2
|
+
module Storage
|
3
|
+
class Base
|
4
|
+
def initialize(*)
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def save(cookies, credentials)
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
def load
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class FileSystem < Base
|
18
|
+
attr_accessor :path
|
19
|
+
|
20
|
+
def initialize(path)
|
21
|
+
self.path = path
|
22
|
+
end
|
23
|
+
|
24
|
+
def save(cookies, credentials)
|
25
|
+
write("#{path}/cookies.yml", cookies)
|
26
|
+
write("#{path}/credentials.yml", credentials)
|
27
|
+
end
|
28
|
+
|
29
|
+
def load
|
30
|
+
{
|
31
|
+
:cookies => read("#{path}/cookies.yml"),
|
32
|
+
:credentials => read("#{path}/credentials.yml")
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def read(path)
|
37
|
+
result = File.exists?(path) ? YAML.load_file(path) : {}
|
38
|
+
result = {} unless result.is_a?(Hash)
|
39
|
+
result
|
40
|
+
end
|
41
|
+
|
42
|
+
def write(path, content)
|
43
|
+
File.open(path, "w+") { |file| file.puts YAML.dump(content) }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class ActiveRecord < Base
|
48
|
+
attr_accessor :record, :cookies_attribute, :credentials_attribute
|
49
|
+
|
50
|
+
def initialize(record, cookies_attribute, credentials_attribute)
|
51
|
+
self.record = record
|
52
|
+
self.cookies_attribute = cookies_attribute
|
53
|
+
self.credentials_attribute = credentials_attribute
|
54
|
+
end
|
55
|
+
|
56
|
+
def save(cookies, credentials)
|
57
|
+
record.update_attributes(
|
58
|
+
cookies_attribute => cookies,
|
59
|
+
credentials_attribute => credentials
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
def load
|
64
|
+
{
|
65
|
+
:cookies => record.read_attribute(cookies_attribute),
|
66
|
+
:credentials => record.read_attribute(credentials_attribute)
|
67
|
+
}
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
---
|
2
|
+
api.twitter.com:
|
3
|
+
/:
|
4
|
+
original_referer: !ruby/object:Mechanize::Cookie
|
5
|
+
comment:
|
6
|
+
comment_url:
|
7
|
+
discard:
|
8
|
+
domain: api.twitter.com
|
9
|
+
expires:
|
10
|
+
max_age:
|
11
|
+
name: original_referer
|
12
|
+
path: /
|
13
|
+
port:
|
14
|
+
secure: false
|
15
|
+
value: JbKFAfGwv4RwApvTLqS%2BuUA9SZR5uydG0STMTRBXN6VwznNnN8%2Bh%2BY04%2FKTVMl2F3nmo8VGrXBNv17rc241SMIXssgyIxl3mMd9X34nDN9yZ0ygZ3I9CCO1a%2BydrZd4b
|
16
|
+
version: 0
|
17
|
+
guest_id: !ruby/object:Mechanize::Cookie
|
18
|
+
comment:
|
19
|
+
comment_url:
|
20
|
+
discard:
|
21
|
+
domain: api.twitter.com
|
22
|
+
expires: Wed, 15 Sep 2010 08:29:35 GMT
|
23
|
+
max_age:
|
24
|
+
name: guest_id
|
25
|
+
path: /
|
26
|
+
port:
|
27
|
+
secure: false
|
28
|
+
value: "128194737548762619"
|
29
|
+
version: 0
|
30
|
+
lang: !ruby/object:Mechanize::Cookie
|
31
|
+
comment:
|
32
|
+
comment_url:
|
33
|
+
discard:
|
34
|
+
domain: api.twitter.com
|
35
|
+
expires:
|
36
|
+
max_age:
|
37
|
+
name: lang
|
38
|
+
path: /
|
39
|
+
port:
|
40
|
+
secure: false
|
41
|
+
value: en
|
42
|
+
version: 0
|
43
|
+
faves.com:
|
44
|
+
/:
|
45
|
+
BlueDotCorp: !ruby/object:Mechanize::Cookie
|
46
|
+
comment:
|
47
|
+
comment_url:
|
48
|
+
discard:
|
49
|
+
domain: faves.com
|
50
|
+
expires:
|
51
|
+
max_age:
|
52
|
+
name: BlueDotCorp
|
53
|
+
path: /
|
54
|
+
port:
|
55
|
+
secure: false
|
56
|
+
value: F2DC2F95515534DBA004FB89BB4C27CA8E674DA134E8A7954F56D971A440E0096473422366292B53EC25F9E4594CDF580EEE2E230D1D294F277A42509EFC295B12369AFE4FFE7B3B07BC97B3647318BC
|
57
|
+
version: 0
|
58
|
+
FC: !ruby/object:Mechanize::Cookie
|
59
|
+
comment:
|
60
|
+
comment_url:
|
61
|
+
discard:
|
62
|
+
domain: faves.com
|
63
|
+
expires:
|
64
|
+
max_age:
|
65
|
+
name: FC
|
66
|
+
path: /
|
67
|
+
port:
|
68
|
+
secure: false
|
69
|
+
value: "1"
|
70
|
+
version: 0
|
71
|
+
user: !ruby/object:Mechanize::Cookie
|
72
|
+
comment:
|
73
|
+
comment_url:
|
74
|
+
discard:
|
75
|
+
domain: faves.com
|
76
|
+
expires:
|
77
|
+
max_age:
|
78
|
+
name: user
|
79
|
+
path: /
|
80
|
+
port:
|
81
|
+
secure: false
|
82
|
+
value: viatropos
|
83
|
+
version: 0
|
84
|
+
twitter.com:
|
85
|
+
/:
|
86
|
+
k: !ruby/object:Mechanize::Cookie
|
87
|
+
comment:
|
88
|
+
comment_url:
|
89
|
+
discard:
|
90
|
+
domain: twitter.com
|
91
|
+
expires: Mon, 23 Aug 2010 08:29:35 GMT
|
92
|
+
max_age:
|
93
|
+
name: k
|
94
|
+
path: /
|
95
|
+
port:
|
96
|
+
secure: false
|
97
|
+
value: 99.191.114.254.1281947375480906
|
98
|
+
version: 0
|
99
|
+
_twitter_sess: !ruby/object:Mechanize::Cookie
|
100
|
+
comment:
|
101
|
+
comment_url:
|
102
|
+
discard:
|
103
|
+
domain: twitter.com
|
104
|
+
expires:
|
105
|
+
max_age:
|
106
|
+
name: _twitter_sess
|
107
|
+
path: /
|
108
|
+
port:
|
109
|
+
secure: false
|
110
|
+
value: BAh7DDoOcmV0dXJuX3RvImRodHRwOi8vYXBpLnR3aXR0ZXIuY29tL29hdXRo%250AL2F1dGhlbnRpY2F0ZT9vYXV0aF90b2tlbj14S1RrWW8wbVcxNXlyOXZsVWZl%250AQTB4NlNqdUFjVWJRRWNOeU1lREJuRToTcGFzc3dvcmRfdG9rZW4iLWI3ZWQy%250ANzRmZWZjZmM2NzY5YWZhODdiNDhjNGVkZDgxZWFjN2JjODI6CXVzZXJpBKOG%250ADwE6DGNzcmZfaWQiJTI2OWUwYzYyMGI1YmNhNjhmOWYyNWVhY2RhODZhNWNi%250AOgdpZCIlMGFkMzU0NDRjOWI5M2Y2MzQ5NjBjNzJlZTYxMWIwZjciCmZsYXNo%250ASUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1%250Ac2VkewA6D2NyZWF0ZWRfYXRsKwiAlwR6KgE%253D--84da5fb62f46daaa5b777936d277afff6358f011
|
111
|
+
version: 0
|