auto_flick 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/capybara.rb +9 -14
- data/lib/auto_flick.rb +1 -1
- data/lib/auto_flick/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca240eb7230a10618b917e473fea55e0182de86b
|
4
|
+
data.tar.gz: c188ee46d072313ded6ffb994a9bfc1534fb3266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa9c6274bba04d91241829daac46a312539d30283801e72a8b1747c0deec0bcfca22f782879d80393918237159d74030bb5d6358bb74c1ee40f02d188964c355
|
7
|
+
data.tar.gz: 3b585c727844bb982fb55d5c0b0fea9334c76b81a556bb7b94d965ae433be80247fb1de968ab60e18038618cd8de8fa6e0c4592e4948d47739403202822b661f
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Inspired by kzeng10 and stegastore.
|
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
8
|
-
Note: This gem uses phantomjs.
|
8
|
+
Note: This gem uses phantomjs. `brew install phantomjs` or `npm install phantomjs`.
|
9
9
|
|
10
10
|
Add this line to your application's Gemfile:
|
11
11
|
|
@@ -29,10 +29,10 @@ Configure the gem:
|
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
AutoFlick.config({
|
32
|
-
username: "
|
33
|
-
password: "
|
34
|
-
api_key: "
|
35
|
-
shared_secret: "
|
32
|
+
username: "my_username_here",
|
33
|
+
password: "my_password_here",
|
34
|
+
api_key: "my_api_key_here",
|
35
|
+
shared_secret: "my_api_secret_here"
|
36
36
|
})
|
37
37
|
```
|
38
38
|
|
data/capybara.rb
CHANGED
@@ -22,28 +22,23 @@ end
|
|
22
22
|
|
23
23
|
def get_key(auth_url, username, password)
|
24
24
|
begin
|
25
|
+
|
25
26
|
visit auth_url
|
26
27
|
|
27
28
|
fill_in('username', :with => username)
|
28
29
|
fill_in('passwd', :with => password)
|
29
30
|
click_button "login-signin"
|
30
|
-
|
31
|
-
visit auth_url
|
32
|
-
|
33
|
-
fill_in('username', :with => username)
|
34
|
-
fill_in('passwd', :with => password)
|
35
|
-
click_button "login-signin"
|
36
|
-
|
37
|
-
click_button "OK, I'LL AUTHORIZE IT"
|
38
31
|
|
32
|
+
click_button "OK, I'LL AUTHORIZE IT"
|
33
|
+
|
39
34
|
key = find("#Main span").text
|
40
|
-
|
41
|
-
rescue Exception => e
|
42
|
-
puts e.message
|
43
|
-
end
|
44
35
|
|
45
|
-
|
46
|
-
|
36
|
+
rescue Capybara::ElementNotFound => e
|
37
|
+
retry
|
38
|
+
ensure
|
39
|
+
page.driver.quit
|
40
|
+
File.delete("cookies.text")
|
41
|
+
end
|
47
42
|
|
48
43
|
return key
|
49
44
|
end
|
data/lib/auto_flick.rb
CHANGED
@@ -24,7 +24,7 @@ module AutoFlick
|
|
24
24
|
token = flickr.get_request_token
|
25
25
|
auth_url = flickr.get_authorize_url(token['oauth_token'], :perms => 'write')
|
26
26
|
verify = Api.get_key(auth_url, @username, @password)
|
27
|
-
|
27
|
+
|
28
28
|
begin
|
29
29
|
flickr.get_access_token(token['oauth_token'], token['oauth_token_secret'], verify)
|
30
30
|
login = flickr.test.login
|
data/lib/auto_flick/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto_flick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilad
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|