tinderbot 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +20 -20
- data/lib/tinderbot/cli/application.rb +1 -1
- data/lib/tinderbot/client.rb +2 -1
- data/lib/tinderbot/version.rb +1 -1
- data/spec/fixtures/timeout_recommended_users.json +1 -0
- data/spec/tinder/client_spec.rb +13 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f15c6d4f351a3dcbdc6015ef8db68fb2e59cf04
|
4
|
+
data.tar.gz: e4f70c97e2eb3c4c2fcb85fbaf4a94d932922f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a76748c82c2d987b35014e3ce90b3be20b155555228d54d7d0ba5e972eac83ac65353644db3da761902d1a8467afc8a485e6a1b9328e2451e47bfa3bb885bff4
|
7
|
+
data.tar.gz: 4bc4e04e4db803aaaf2f85b7f40b40017526107f2a115d4e5ee0c35d0f3e79c23853ea11cf8484d4a0efe13e9ed3c8eb4c907cb92d698e1586bcf9fada3fa000
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -35,7 +35,7 @@ Tinderbot also provides a script to get your facebook credentials.
|
|
35
35
|
facebook_email = 'your facebook email'
|
36
36
|
facebook_password = 'your facebook password'
|
37
37
|
|
38
|
-
facebook_authentication_token, facebook_user_id = Tinderbot::Facebook.get_credentials
|
38
|
+
facebook_authentication_token, facebook_user_id = Tinderbot::Facebook.get_credentials facebook_email, facebook_password
|
39
39
|
```
|
40
40
|
|
41
41
|
## Usage
|
@@ -47,7 +47,7 @@ facebook_authentication_token = 'your facebook authentication token'
|
|
47
47
|
facebook_user_id = 'your facebook user id'
|
48
48
|
|
49
49
|
tinder_client = Tinderbot::Client.new
|
50
|
-
tinder_authentication_token = tinder_client.get_authentication_token
|
50
|
+
tinder_authentication_token = tinder_client.get_authentication_token facebook_authentication_token, facebook_user_id
|
51
51
|
tinder_client.sign_in tinder_authentication_token
|
52
52
|
```
|
53
53
|
|
@@ -62,27 +62,27 @@ user.birth_date #=> #<Date: 2014-05-01>
|
|
62
62
|
user.gender #=> :male (or :female)
|
63
63
|
user.photo_urls #=> ['http://photo_1_url.jpg', 'http://photo_2_url.jpg']
|
64
64
|
|
65
|
-
user = tinder_client.user
|
65
|
+
user = tinder_client.user user_id #=> returns an instance of Tinderbot::Model::User
|
66
66
|
|
67
67
|
users = tinder_client.recommended_users #=> returns an array of Tinderbot::Model::User instances
|
68
68
|
|
69
69
|
tinder_client.updates #=> {...} original json from tinder's API
|
70
70
|
|
71
|
-
tinder_client.send_message
|
71
|
+
tinder_client.send_message user_id, message
|
72
72
|
|
73
|
-
tinder_client.update_location
|
73
|
+
tinder_client.update_location '40.7313029,-73.9884189'
|
74
74
|
|
75
75
|
# you can provide a user instance or a user id to like or dislike users
|
76
|
-
tinder_client.like
|
77
|
-
tinder_client.like
|
78
|
-
tinder_client.dislike
|
79
|
-
tinder_client.dislike
|
76
|
+
tinder_client.like user
|
77
|
+
tinder_client.like user.id
|
78
|
+
tinder_client.dislike user
|
79
|
+
tinder_client.dislike user.id
|
80
80
|
```
|
81
81
|
|
82
82
|
### Using the bot
|
83
83
|
Tinderbot provides a simple bot which automatically likes all recommended people. It stops when there is no more recommended people.
|
84
84
|
```ruby
|
85
|
-
tinder_bot = Tinderbot::
|
85
|
+
tinder_bot = Tinderbot::Bot.new tinder_client
|
86
86
|
tinder_bot.like_recommended_users
|
87
87
|
```
|
88
88
|
|
@@ -91,16 +91,16 @@ You can interact with Tinderbot with command lines.
|
|
91
91
|
```
|
92
92
|
> tinderbot
|
93
93
|
Commands:
|
94
|
-
tinderbot autolike
|
95
|
-
tinderbot dislike USER_ID
|
96
|
-
tinderbot help [COMMAND]
|
97
|
-
tinderbot like USER_ID
|
98
|
-
tinderbot location
|
99
|
-
tinderbot profile
|
100
|
-
tinderbot recommended
|
101
|
-
tinderbot send USER_ID MESSAGE
|
102
|
-
tinderbot updates
|
103
|
-
tinderbot user USER_ID
|
94
|
+
tinderbot autolike # Automatically like recommended people (Stops when there is no more people to like)
|
95
|
+
tinderbot dislike USER_ID # Dislike user
|
96
|
+
tinderbot help [COMMAND] # Describe available commands or one specific command
|
97
|
+
tinderbot like USER_ID # Like user
|
98
|
+
tinderbot location ALTITUDE,LONGITUDE # Update location using latitude and longitude, e.g. tinderbot location 40.7313029,-73.9884189
|
99
|
+
tinderbot profile # Get your profile data
|
100
|
+
tinderbot recommended # Get recommended users
|
101
|
+
tinderbot send USER_ID MESSAGE # Send message to user
|
102
|
+
tinderbot updates # Get updates
|
103
|
+
tinderbot user USER_ID # Get user profile data
|
104
104
|
```
|
105
105
|
|
106
106
|
## Contributing
|
@@ -47,7 +47,7 @@ module Tinderbot
|
|
47
47
|
puts tinder_client.send_message user_id, message
|
48
48
|
end
|
49
49
|
|
50
|
-
desc 'location', 'Update location using latitude and longitude
|
50
|
+
desc 'location ALTITUDE,LONGITUDE', 'Update location using latitude and longitude, e.g. tinderbot location 40.7313029,-73.9884189'
|
51
51
|
def location(location)
|
52
52
|
tinder_client = sign_in
|
53
53
|
tinder_client.update_location(location)
|
data/lib/tinderbot/client.rb
CHANGED
@@ -32,7 +32,8 @@ module Tinderbot
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def recommended_users
|
35
|
-
JSON.parse(@connection.post('user/recs').body)['results']
|
35
|
+
json_results = JSON.parse(@connection.post('user/recs').body)['results']
|
36
|
+
json_results.map { |r| Tinderbot::Model::User.build_from_tinder_json r } if json_results
|
36
37
|
end
|
37
38
|
|
38
39
|
def like(user_or_user_id)
|
data/lib/tinderbot/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{ "message": "recs timeout" }
|
data/spec/tinder/client_spec.rb
CHANGED
@@ -46,13 +46,23 @@ describe Tinderbot::Client do
|
|
46
46
|
|
47
47
|
describe '.recommended_users' do
|
48
48
|
let(:recommended_users_tinder_raw_json) { open('spec/fixtures/recommended_users.json').read }
|
49
|
-
|
49
|
+
|
50
50
|
before { expect(connection).to receive(:post).with('user/recs').and_return(connection) }
|
51
51
|
before { expect(connection).to receive(:body).and_return(recommended_users_tinder_raw_json) }
|
52
|
-
|
52
|
+
|
53
53
|
subject { tinder_client.recommended_users }
|
54
|
+
|
55
|
+
context 'with recommended_users' do
|
56
|
+
let(:recommended_users_tinder_raw_json) { open('spec/fixtures/recommended_users.json').read }
|
57
|
+
|
58
|
+
it { should eq JSON.parse(recommended_users_tinder_raw_json)['results'].map { |r| Tinderbot::Model::User.build_from_tinder_json r } }
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'with timeout from tinder API' do
|
62
|
+
let(:recommended_users_tinder_raw_json) { open('spec/fixtures/timeout_recommended_users.json').read }
|
54
63
|
|
55
|
-
|
64
|
+
it { should be nil }
|
65
|
+
end
|
56
66
|
end
|
57
67
|
|
58
68
|
describe '.like' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinderbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Venezia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- lib/tinderbot/version.rb
|
162
162
|
- spec/fixtures/profile.json
|
163
163
|
- spec/fixtures/recommended_users.json
|
164
|
+
- spec/fixtures/timeout_recommended_users.json
|
164
165
|
- spec/fixtures/updates.json
|
165
166
|
- spec/fixtures/user.json
|
166
167
|
- spec/models/user_spec.rb
|
@@ -195,6 +196,7 @@ summary: Ruby wrapper for the Tinder API and automatic liker bot.
|
|
195
196
|
test_files:
|
196
197
|
- spec/fixtures/profile.json
|
197
198
|
- spec/fixtures/recommended_users.json
|
199
|
+
- spec/fixtures/timeout_recommended_users.json
|
198
200
|
- spec/fixtures/updates.json
|
199
201
|
- spec/fixtures/user.json
|
200
202
|
- spec/models/user_spec.rb
|