tinby 0.1.2 → 0.2.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -9
- data/README.md +81 -1
- data/lib/tinby/client.rb +3 -8
- data/lib/tinby/version.rb +1 -1
- data/tinby.gemspec +0 -1
- metadata +2 -17
- data/lib/tinby/facebook.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7461a91a464576f5d3cacc545bda805440a013a44260be1755887c9ac307a7
|
4
|
+
data.tar.gz: 37d5933fa6fb1b005c4b89f9428c3bd611ad677999615df11aefce01cce8061b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc1b576d7ac4165c2432fced6ce08b4ab332abfb909bff965e257b50313bf0d5f3b7d58b4610fbe0ca7d4285b6b226cf4053aac8a2212a0eb1ab5755628a7de
|
7
|
+
data.tar.gz: 1a140f082e66d41a6073e1099aa20445b1f3016300b5674c2115187824c4518b8040cb8eb06f01d49e7d047d44e878f3d7290151572f4d93ce273dc3fa9884a2
|
data/Gemfile.lock
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tinby (0.
|
4
|
+
tinby (0.2.0)
|
5
5
|
faraday (~> 0)
|
6
6
|
faraday_middleware (~> 0)
|
7
7
|
json (~> 2.1)
|
8
|
-
selenium-webdriver (~> 3.13)
|
9
8
|
tinder_auth_fetcher (~> 0)
|
10
9
|
|
11
10
|
GEM
|
12
11
|
remote: https://rubygems.org/
|
13
12
|
specs:
|
14
|
-
childprocess (0.9.0)
|
15
|
-
ffi (~> 1.0, >= 1.0.11)
|
16
13
|
connection_pool (2.2.2)
|
17
14
|
diff-lcs (1.3)
|
18
15
|
domain_name (0.5.20180417)
|
@@ -21,7 +18,6 @@ GEM
|
|
21
18
|
multipart-post (>= 1.2, < 3)
|
22
19
|
faraday_middleware (0.12.2)
|
23
20
|
faraday (>= 0.7.4, < 1.0)
|
24
|
-
ffi (1.9.25)
|
25
21
|
http-cookie (1.0.3)
|
26
22
|
domain_name (~> 0.5)
|
27
23
|
json (2.1.0)
|
@@ -59,10 +55,6 @@ GEM
|
|
59
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
56
|
rspec-support (~> 3.7.0)
|
61
57
|
rspec-support (3.7.1)
|
62
|
-
rubyzip (1.2.1)
|
63
|
-
selenium-webdriver (3.13.1)
|
64
|
-
childprocess (~> 0.5)
|
65
|
-
rubyzip (~> 1.2)
|
66
58
|
tinder_auth_fetcher (0.1.0)
|
67
59
|
mechanize (~> 2.0)
|
68
60
|
unf (0.1.4)
|
data/README.md
CHANGED
@@ -22,7 +22,87 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
First, initialize Tinby::Client with your registered facebook email, your registered facebook password, your facebook url:
|
26
|
+
|
27
|
+
```
|
28
|
+
client = Tinby::Client.new(REGISTERED_FACEBOOK_EMAIL, REGISTERED_FACEBOOK_PASSWORD, FACEBOOK_URL)
|
29
|
+
```
|
30
|
+
|
31
|
+
If you want to get your profile ? like this:
|
32
|
+
```
|
33
|
+
client.profile
|
34
|
+
```
|
35
|
+
|
36
|
+
If you want to get recommended users ? like this:
|
37
|
+
```
|
38
|
+
client.recommended_users
|
39
|
+
```
|
40
|
+
and they return JSON:
|
41
|
+
|
42
|
+
```
|
43
|
+
[{
|
44
|
+
"group_matched" => false,
|
45
|
+
"distance_mi" => 0,
|
46
|
+
"content_hash" => "xxxxxxxxxxxxxxxxx",
|
47
|
+
"common_friends" => [],
|
48
|
+
"common_likes" => [],
|
49
|
+
"common_friend_count" => 0,
|
50
|
+
"common_like_count" => 0,
|
51
|
+
"connection_count" => 0,
|
52
|
+
"_id" => "xxxxxxxxxxxxxxxxx",
|
53
|
+
"bio" => "xxxxxxxxxxxxxxxxx",
|
54
|
+
"birth_date" => "xxxxxxxxxxxxxxxxx",
|
55
|
+
"name" => "xxxxxxxxxxxxxxxxx",
|
56
|
+
"ping_time" => "2099-01-01T00:00:00.000Z",
|
57
|
+
"photos" => [
|
58
|
+
[0] {
|
59
|
+
"id" => "xxxxxxxxxxxxxxxxx",
|
60
|
+
"url" => "https://xxxxxxxxxxxxxxxxx.jpg",
|
61
|
+
"processedFiles" => [
|
62
|
+
[0] {
|
63
|
+
"url" => "https://xxxxxxxxxxxxxxxxx.jpg",
|
64
|
+
"height" => 640,
|
65
|
+
"width" => 640
|
66
|
+
},
|
67
|
+
],
|
68
|
+
"fileName" => "xxxxxxxxxxxxxxxxx.jpg",
|
69
|
+
"extension" => "jpg"
|
70
|
+
}
|
71
|
+
],
|
72
|
+
"jobs" => [],
|
73
|
+
"schools" => [],
|
74
|
+
"teaser" => {
|
75
|
+
"string" => ""
|
76
|
+
},
|
77
|
+
"teasers" => [],
|
78
|
+
"gender" => 1,
|
79
|
+
"birth_date_info" => "",
|
80
|
+
"s_number" => 99999999999999999999999999
|
81
|
+
}]
|
82
|
+
```
|
83
|
+
|
84
|
+
If you want to like someone ? like this:
|
85
|
+
```
|
86
|
+
client.like(user_id)
|
87
|
+
```
|
88
|
+
|
89
|
+
If you want to dislike someone ? like this:
|
90
|
+
```
|
91
|
+
client.dislike(user_id)
|
92
|
+
```
|
93
|
+
|
94
|
+
## references
|
95
|
+
|
96
|
+
find facebook id
|
97
|
+
```
|
98
|
+
https://findmyfbid.com
|
99
|
+
```
|
100
|
+
|
101
|
+
how to get tinder auth token
|
102
|
+
```
|
103
|
+
https://gist.github.com/taseppa/66fc7239c66ef285ecb28b400b556938
|
104
|
+
```
|
105
|
+
|
26
106
|
|
27
107
|
## Development
|
28
108
|
|
data/lib/tinby/client.rb
CHANGED
@@ -8,13 +8,12 @@ module Tinby
|
|
8
8
|
TINDER_API_URL = 'https://api.gotinder.com'.freeze
|
9
9
|
CONNECTION_USER_AGENT = 'Tinder/7.5.3 (iPhone; iOS 10.3.2; Scale/2.00)'.freeze
|
10
10
|
|
11
|
-
attr_reader :connection, :email, :password
|
11
|
+
attr_reader :connection, :email, :password
|
12
12
|
attr_accessor :logined
|
13
13
|
|
14
|
-
def initialize(email, password
|
14
|
+
def initialize(email, password)
|
15
15
|
@email = email
|
16
16
|
@password = password
|
17
|
-
@facebook = Tinby::Facebook.new(profile_url)
|
18
17
|
@logined = false
|
19
18
|
build_tinder_connection
|
20
19
|
end
|
@@ -73,7 +72,7 @@ module Tinby
|
|
73
72
|
end
|
74
73
|
|
75
74
|
def auth_request
|
76
|
-
connection.post('/auth', facebook_token: facebook_authentication_token
|
75
|
+
connection.post('/auth', facebook_token: facebook_authentication_token).body
|
77
76
|
end
|
78
77
|
|
79
78
|
def build_tinder_connection
|
@@ -87,9 +86,5 @@ module Tinby
|
|
87
86
|
def facebook_authentication_token
|
88
87
|
TinderAuthFetcher.fetch_token(email, password)
|
89
88
|
end
|
90
|
-
|
91
|
-
def facebook_user_id
|
92
|
-
facebook.fetch_facebook_id
|
93
|
-
end
|
94
89
|
end
|
95
90
|
end
|
data/lib/tinby/version.rb
CHANGED
data/tinby.gemspec
CHANGED
@@ -29,6 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency 'faraday', '~> 0'
|
30
30
|
spec.add_dependency 'faraday_middleware', '~> 0'
|
31
31
|
spec.add_dependency 'json', '~> 2.1'
|
32
|
-
spec.add_dependency 'selenium-webdriver', '~> 3.13'
|
33
32
|
spec.add_dependency 'tinder_auth_fetcher', '~> 0'
|
34
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.1'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: selenium-webdriver
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '3.13'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '3.13'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: tinder_auth_fetcher
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,7 +128,6 @@ files:
|
|
142
128
|
- bin/setup
|
143
129
|
- lib/tinby.rb
|
144
130
|
- lib/tinby/client.rb
|
145
|
-
- lib/tinby/facebook.rb
|
146
131
|
- lib/tinby/version.rb
|
147
132
|
- tinby.gemspec
|
148
133
|
homepage: https://github.com/Cam1no/tinby.git
|
data/lib/tinby/facebook.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'selenium-webdriver'
|
2
|
-
module Tinby
|
3
|
-
class Facebook
|
4
|
-
FIND_FACEBOOK_ID_URL = 'https://findmyfbid.com'.freeze
|
5
|
-
|
6
|
-
attr_reader :driver, :profile_url
|
7
|
-
|
8
|
-
def initialize(profile_url)
|
9
|
-
@profile_url = profile_url
|
10
|
-
@driver = initialize_selenium_driver
|
11
|
-
end
|
12
|
-
|
13
|
-
def fetch_facebook_id
|
14
|
-
open_findfbid
|
15
|
-
fill_in_user_profile_url
|
16
|
-
submit
|
17
|
-
find_facebook_id
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def initialize_selenium_driver
|
23
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
24
|
-
options.add_argument('--headless')
|
25
|
-
Selenium::WebDriver.for :chrome, options: options
|
26
|
-
end
|
27
|
-
|
28
|
-
def open_findfbid
|
29
|
-
driver.get(FIND_FACEBOOK_ID_URL)
|
30
|
-
end
|
31
|
-
|
32
|
-
def fill_in_user_profile_url
|
33
|
-
driver.find_element(:name, 'url').send_keys(profile_url)
|
34
|
-
end
|
35
|
-
|
36
|
-
def submit
|
37
|
-
driver.find_element(:class, 'btn').click
|
38
|
-
end
|
39
|
-
|
40
|
-
def find_facebook_id
|
41
|
-
driver.find_element(:tag_name, 'code').text
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|