jarvis-cli 0.0.6 → 0.0.7
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 +1 -1
- data/features/step_definitions/tweet_that_steps.rb +19 -0
- data/features/support/vcr_cassettes/Tweet_that/Post_the_last_message_to_twitter.yml +211 -0
- data/features/tweet_that_service.feature +14 -0
- data/jarvis-cli.gemspec +1 -0
- data/lib/jarvis/services.rb +1 -0
- data/lib/jarvis/services/tweet_that.rb +68 -0
- data/lib/jarvis/version.rb +1 -1
- data/spec/jarvis/server_spec.rb +1 -1
- data/spec/services/tweet_that_spec.rb +18 -0
- data/spec/support/fixtures/vcr_cassettes/tweet_that.yml +189 -0
- metadata +26 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d9b5f3ee81fd1bb667dd0f7a3fa5f3f19e591ff
|
4
|
+
data.tar.gz: 0b5163b44dc07dc62eed775950a2798639fb11dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dae7eb953996d2788e95dc3e7a6791fbcac8269c7d6002e194aa8da0cf00c5cae987dc160ba92a5fd6ff19246b53322abc9c5773907ce38739165fbc09f79954
|
7
|
+
data.tar.gz: 6afff6f34899940285e2920c1d3973f95ba45519ee3baf15694260db1ffcb8eae0b6809900e20f78e4f6cc9923c5c0ab2b05d48d0bdefb04f25a2a5921f444e7
|
data/README.md
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
Given(/^the Tweet That is configured$/) do
|
5
|
+
stub_env "SLACK_TOKEN" => "slack_token",
|
6
|
+
"TWITTER_ACCESS_TOKEN" => "twitter_access_token",
|
7
|
+
"TWITTER_CONSUMER_KEY" => "twitter_consumer_key",
|
8
|
+
"TWITTER_CONSUMER_SECRET" => "twitter_consumer_secret",
|
9
|
+
"TWITTER_HANDLE" => "twitter_handle",
|
10
|
+
"TWITTER_TOKEN_SECRET" => "twitter_token_secret"
|
11
|
+
end
|
12
|
+
|
13
|
+
When(/^the user (.+) post a message to the general channel saying "(.*?)"$/) do |user_name, message|
|
14
|
+
@response = post("/jarvis", slack_outgoing_message(text: message, channel_id: general_channel_id, user_name: user_name))
|
15
|
+
end
|
16
|
+
|
17
|
+
def general_channel_id
|
18
|
+
"C0000001"
|
19
|
+
end
|
@@ -0,0 +1,211 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://slack.com/api/channels.history?channel=C0000001&count=2&token=slack_token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Access-Control-Allow-Origin:
|
22
|
+
- "*"
|
23
|
+
Cache-Control:
|
24
|
+
- private, no-cache, no-store, must-revalidate
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Date:
|
28
|
+
- Sun, 22 Feb 2015 03:23:50 GMT
|
29
|
+
Expires:
|
30
|
+
- Mon, 26 Jul 1997 05:00:00 GMT
|
31
|
+
Pragma:
|
32
|
+
- no-cache
|
33
|
+
Server:
|
34
|
+
- Apache
|
35
|
+
Strict-Transport-Security:
|
36
|
+
- max-age=31536000; includeSubDomains; preload
|
37
|
+
Vary:
|
38
|
+
- Accept-Encoding
|
39
|
+
X-Accepted-Oauth-Scopes:
|
40
|
+
- read
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Oauth-Scopes:
|
44
|
+
- identify,read,post,client,admin
|
45
|
+
X-Xss-Protection:
|
46
|
+
- '0'
|
47
|
+
Content-Length:
|
48
|
+
- '310'
|
49
|
+
Connection:
|
50
|
+
- keep-alive
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"ok":true,"messages":[{"username":"","text":"Here you go, dvg\n\n<http:\/\/i.imgflip.com\/gmvgk.jpg>","bot_id":"B02TFUM6S","attachments":[{"from_url":"http:\/\/i.imgflip.com\/gmvgk.jpg","fallback":"500x500px
|
54
|
+
image","image_url":"http:\/\/i.imgflip.com\/gmvgk.jpg","image_width":500,"image_height":500,"image_bytes":17919,"id":1}],"type":"message","subtype":"bot_message","ts":"1421810229.000007"},{"type":"message","user":"U02TEDJGF","text":"Jarvis
|
55
|
+
success kid thing, thing","ts":"1421810228.000006"}],"has_more":true}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Sun, 22 Feb 2015 03:23:50 GMT
|
58
|
+
- request:
|
59
|
+
method: post
|
60
|
+
uri: https://api.twitter.com/1.1/statuses/update.json
|
61
|
+
body:
|
62
|
+
encoding: UTF-8
|
63
|
+
string: status=Jarvis+success+kid+thing%2C+thing
|
64
|
+
headers:
|
65
|
+
Accept:
|
66
|
+
- application/json
|
67
|
+
User-Agent:
|
68
|
+
- TwitterRubyGem/5.14.0
|
69
|
+
Authorization:
|
70
|
+
- OAuth oauth_consumer_key="twitter_consumer_key", oauth_nonce="110cbb77f4ca6d9971184708027e18c3",
|
71
|
+
oauth_signature="diw6%2Fpa01qZMzh8%2FLOXFqfNO6qg%3D", oauth_signature_method="HMAC-SHA1",
|
72
|
+
oauth_timestamp="1424575430", oauth_token="twitter_access_token",
|
73
|
+
oauth_version="1.0"
|
74
|
+
Content-Type:
|
75
|
+
- application/x-www-form-urlencoded
|
76
|
+
Accept-Encoding:
|
77
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
78
|
+
response:
|
79
|
+
status:
|
80
|
+
code: 403
|
81
|
+
message: Forbidden
|
82
|
+
headers:
|
83
|
+
Cache-Control:
|
84
|
+
- no-cache, no-store, must-revalidate, pre-check=0, post-check=0
|
85
|
+
Content-Disposition:
|
86
|
+
- attachment; filename=json.json
|
87
|
+
Content-Length:
|
88
|
+
- '85'
|
89
|
+
Content-Type:
|
90
|
+
- application/json;charset=utf-8
|
91
|
+
Date:
|
92
|
+
- Sun, 22 Feb 2015 03:23:51 UTC
|
93
|
+
Expires:
|
94
|
+
- Tue, 31 Mar 1981 05:00:00 GMT
|
95
|
+
Last-Modified:
|
96
|
+
- Sun, 22 Feb 2015 03:23:51 GMT
|
97
|
+
Pragma:
|
98
|
+
- no-cache
|
99
|
+
Server:
|
100
|
+
- tsa_a
|
101
|
+
Set-Cookie:
|
102
|
+
- guest_id=v1%3A142457543142106229; Domain=.twitter.com; Path=/; Expires=Tue,
|
103
|
+
21-Feb-2017 03:23:51 UTC
|
104
|
+
- lang=en
|
105
|
+
Status:
|
106
|
+
- 403 Forbidden
|
107
|
+
Strict-Transport-Security:
|
108
|
+
- max-age=631138519
|
109
|
+
X-Access-Level:
|
110
|
+
- read-write
|
111
|
+
X-Connection-Hash:
|
112
|
+
- 94193f251924b03d9f4a89a93584c761
|
113
|
+
X-Content-Type-Options:
|
114
|
+
- nosniff
|
115
|
+
X-Frame-Options:
|
116
|
+
- SAMEORIGIN
|
117
|
+
X-Response-Time:
|
118
|
+
- '42'
|
119
|
+
X-Transaction:
|
120
|
+
- 5723b35f8929db7c
|
121
|
+
X-Twitter-Response-Tags:
|
122
|
+
- BouncerCompliant
|
123
|
+
X-Xss-Protection:
|
124
|
+
- 1; mode=block
|
125
|
+
body:
|
126
|
+
encoding: UTF-8
|
127
|
+
string: '{"errors":[{"code":187,"message":"Status is a duplicate."}]}'
|
128
|
+
http_version:
|
129
|
+
recorded_at: Sun, 22 Feb 2015 03:23:51 GMT
|
130
|
+
- request:
|
131
|
+
method: get
|
132
|
+
uri: https://api.twitter.com/1.1/statuses/user_timeline.json?count=1
|
133
|
+
body:
|
134
|
+
encoding: US-ASCII
|
135
|
+
string: ''
|
136
|
+
headers:
|
137
|
+
Accept:
|
138
|
+
- application/json
|
139
|
+
User-Agent:
|
140
|
+
- TwitterRubyGem/5.14.0
|
141
|
+
Authorization:
|
142
|
+
- OAuth oauth_consumer_key="twitter_consumer_key", oauth_nonce="blah",
|
143
|
+
oauth_signature="blah", oauth_signature_method="HMAC-SHA1",
|
144
|
+
oauth_timestamp="1424575431", oauth_token="twitter_access_token",
|
145
|
+
oauth_version="1.0"
|
146
|
+
Accept-Encoding:
|
147
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
148
|
+
response:
|
149
|
+
status:
|
150
|
+
code: 200
|
151
|
+
message: OK
|
152
|
+
headers:
|
153
|
+
Cache-Control:
|
154
|
+
- no-cache, no-store, must-revalidate, pre-check=0, post-check=0
|
155
|
+
Content-Disposition:
|
156
|
+
- attachment; filename=json.json
|
157
|
+
Content-Length:
|
158
|
+
- '814'
|
159
|
+
Content-Type:
|
160
|
+
- application/json;charset=utf-8
|
161
|
+
Date:
|
162
|
+
- Sun, 22 Feb 2015 03:23:52 UTC
|
163
|
+
Expires:
|
164
|
+
- Tue, 31 Mar 1981 05:00:00 GMT
|
165
|
+
Last-Modified:
|
166
|
+
- Sun, 22 Feb 2015 03:23:52 GMT
|
167
|
+
Pragma:
|
168
|
+
- no-cache
|
169
|
+
Server:
|
170
|
+
- tsa_a
|
171
|
+
Set-Cookie:
|
172
|
+
- guest_id=v1%3A142457543216888662; Domain=.twitter.com; Path=/; Expires=Tue,
|
173
|
+
21-Feb-2017 03:23:52 UTC
|
174
|
+
- lang=en
|
175
|
+
Status:
|
176
|
+
- 200 OK
|
177
|
+
Strict-Transport-Security:
|
178
|
+
- max-age=631138519
|
179
|
+
X-Access-Level:
|
180
|
+
- read-write
|
181
|
+
X-Connection-Hash:
|
182
|
+
- 7ace1b83c8a9993a555c69240d8ec10b
|
183
|
+
X-Content-Type-Options:
|
184
|
+
- nosniff
|
185
|
+
X-Frame-Options:
|
186
|
+
- SAMEORIGIN
|
187
|
+
X-Rate-Limit-Limit:
|
188
|
+
- '180'
|
189
|
+
X-Rate-Limit-Remaining:
|
190
|
+
- '179'
|
191
|
+
X-Rate-Limit-Reset:
|
192
|
+
- '1424576332'
|
193
|
+
X-Response-Time:
|
194
|
+
- '35'
|
195
|
+
X-Transaction:
|
196
|
+
- 95cb4f1b180a641a
|
197
|
+
X-Twitter-Response-Tags:
|
198
|
+
- BouncerCompliant
|
199
|
+
X-Xss-Protection:
|
200
|
+
- 1; mode=block
|
201
|
+
body:
|
202
|
+
encoding: UTF-8
|
203
|
+
string: '[{"created_at":"Sun Feb 22 02:56:09 +0000 2015","id":569329768350380032,"id_str":"569329768350380032","text":"Jarvis
|
204
|
+
success kid thing, thing","source":"\u003ca href=\"http:\/\/placeholderjarviscat.net\"
|
205
|
+
rel=\"nofollow\"\u003eCatPenTwitter\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2859748697,"id_str":"2859748697","name":"The
|
206
|
+
Cat Pen","screen_name":"twitter_handle","location":"","profile_location":null,"description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":6,"friends_count":9,"listed_count":0,"created_at":"Tue
|
207
|
+
Nov 04 01:23:34 +0000 2014","favourites_count":1,"utc_offset":-18000,"time_zone":"Eastern
|
208
|
+
Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":29,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/529445226608218112\/yodLdvk3_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/529445226608218112\/yodLdvk3_normal.jpeg","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"}]'
|
209
|
+
http_version:
|
210
|
+
recorded_at: Sun, 22 Feb 2015 03:23:51 GMT
|
211
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@vcr
|
2
|
+
Feature: Tweet that
|
3
|
+
|
4
|
+
Because stuff with no context is funny
|
5
|
+
As a twitter user
|
6
|
+
I want Jarvis to post the last message to twitter
|
7
|
+
|
8
|
+
Background:
|
9
|
+
Given the Tweet That is configured
|
10
|
+
|
11
|
+
Scenario: Post the last message to twitter
|
12
|
+
Given a server is running with the tweet that service enabled
|
13
|
+
When the user DVG post a message to the general channel saying "Jarvis, tweet that"
|
14
|
+
Then Jarvis will respond with "Here you are, DVG, https://twitter.com/twitter_handle/status/569329768350380032"
|
data/jarvis-cli.gemspec
CHANGED
data/lib/jarvis/services.rb
CHANGED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Tweet
|
2
|
+
require 'twitter'
|
3
|
+
class TweetThat < Jarvis::Service
|
4
|
+
phrases "tweet that", "post that to twitter"
|
5
|
+
environment :slack_token,
|
6
|
+
:twitter_handle,
|
7
|
+
:twitter_consumer_key,
|
8
|
+
:twitter_consumer_secret,
|
9
|
+
:twitter_access_token,
|
10
|
+
:twitter_token_secret
|
11
|
+
|
12
|
+
before_invoke :get_last_message_from_slack
|
13
|
+
before_invoke :initialize_twitter
|
14
|
+
|
15
|
+
attr_accessor :last_message, :twitter_client, :tweet
|
16
|
+
|
17
|
+
def run
|
18
|
+
self.tweet = post_tweet
|
19
|
+
"Here you are, #{user_name}, #{link}"
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def link
|
25
|
+
"https://twitter.com/#{twitter_handle}/status/#{self.tweet.id}"
|
26
|
+
end
|
27
|
+
|
28
|
+
def post_tweet
|
29
|
+
self.twitter_client.update self.last_message
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_last_message_from_slack
|
33
|
+
self.last_message = Jarvis.get("#{host}#{endpoint}?#{request}").response["messages"][1]["text"]
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize_twitter
|
37
|
+
self.twitter_client = Twitter::REST::Client.new do |config|
|
38
|
+
config.consumer_key = twitter_consumer_key
|
39
|
+
config.consumer_secret = twitter_consumer_secret
|
40
|
+
config.access_token = twitter_access_token
|
41
|
+
config.access_token_secret = twitter_token_secret
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def request
|
46
|
+
[token, channel, count].join("&")
|
47
|
+
end
|
48
|
+
|
49
|
+
def host
|
50
|
+
"https://slack.com/api/"
|
51
|
+
end
|
52
|
+
|
53
|
+
def endpoint
|
54
|
+
"channels.history"
|
55
|
+
end
|
56
|
+
|
57
|
+
def token
|
58
|
+
"token=#{slack_token}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def channel
|
62
|
+
"channel=#{channel_id}"
|
63
|
+
end
|
64
|
+
|
65
|
+
def count
|
66
|
+
"count=2"
|
67
|
+
end
|
68
|
+
end
|
data/lib/jarvis/version.rb
CHANGED
data/spec/jarvis/server_spec.rb
CHANGED
@@ -15,6 +15,6 @@ RSpec.describe Jarvis::Server do
|
|
15
15
|
before { service.phrases "success kid" }
|
16
16
|
before { Jarvis.register_services :test_service }
|
17
17
|
before { post "/jarvis", slack_message }
|
18
|
-
it { expect(message).to eq "I'm really sorry, but that
|
18
|
+
it { expect(message).to eq "I'm really sorry, but that service needs to be configured" }
|
19
19
|
end
|
20
20
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe TweetThat, vcr: { cassette_name: 'tweet_that', :record => :new_episodes} do
|
4
|
+
describe "Tweet last message" do
|
5
|
+
before do
|
6
|
+
stub_env "SLACK_TOKEN" => "slack_token",
|
7
|
+
"TWITTER_ACCESS_TOKEN" => "twitter_access_token",
|
8
|
+
"TWITTER_CONSUMER_KEY" => "twitter_consumer_key",
|
9
|
+
"TWITTER_CONSUMER_SECRET" => "twitter_consumer_secret",
|
10
|
+
"TWITTER_HANDLE" => "twitter_handle",
|
11
|
+
"TWITTER_TOKEN_SECRET" => "twitter_token_secret"
|
12
|
+
|
13
|
+
end
|
14
|
+
let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, tweet that", channel_id: "C0000001", user_name: "DVG")) }
|
15
|
+
subject { described_class.new message }
|
16
|
+
it { expect(subject.invoke).to eq "Here you are, DVG, https://twitter.com/twitter_handle/status/569329768350380032" }
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,189 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://slack.com/api/channels.history?channel=C0000001&count=2&token=slack_token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Access-Control-Allow-Origin:
|
22
|
+
- "*"
|
23
|
+
Cache-Control:
|
24
|
+
- private, no-cache, no-store, must-revalidate
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Date:
|
28
|
+
- Sun, 22 Feb 2015 02:54:54 GMT
|
29
|
+
Expires:
|
30
|
+
- Mon, 26 Jul 1997 05:00:00 GMT
|
31
|
+
Pragma:
|
32
|
+
- no-cache
|
33
|
+
Server:
|
34
|
+
- Apache
|
35
|
+
Strict-Transport-Security:
|
36
|
+
- max-age=31536000; includeSubDomains; preload
|
37
|
+
Vary:
|
38
|
+
- Accept-Encoding
|
39
|
+
X-Accepted-Oauth-Scopes:
|
40
|
+
- read
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Oauth-Scopes:
|
44
|
+
- identify,read,post,client,admin
|
45
|
+
X-Xss-Protection:
|
46
|
+
- '0'
|
47
|
+
Content-Length:
|
48
|
+
- '164'
|
49
|
+
Connection:
|
50
|
+
- keep-alive
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"ok":true,"messages":[{"type":"message","user":"U02TK3RKG","text":"Took
|
54
|
+
over 5000 steps to shovel","ts":"1424559066.000043"},{"type":"message","user":"U02TERHJX","text":"Heh","ts":"1424543398.000042"}],"has_more":true}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Sun, 22 Feb 2015 02:54:54 GMT
|
57
|
+
- request:
|
58
|
+
method: get
|
59
|
+
uri: https://slack.com/api/channels.history?channel=C0000001&count=2&token=slack_token
|
60
|
+
body:
|
61
|
+
encoding: US-ASCII
|
62
|
+
string: ''
|
63
|
+
headers:
|
64
|
+
Accept-Encoding:
|
65
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
66
|
+
Accept:
|
67
|
+
- "*/*"
|
68
|
+
User-Agent:
|
69
|
+
- Ruby
|
70
|
+
response:
|
71
|
+
status:
|
72
|
+
code: 200
|
73
|
+
message: OK
|
74
|
+
headers:
|
75
|
+
Access-Control-Allow-Origin:
|
76
|
+
- "*"
|
77
|
+
Cache-Control:
|
78
|
+
- private, no-cache, no-store, must-revalidate
|
79
|
+
Content-Type:
|
80
|
+
- application/json; charset=utf-8
|
81
|
+
Date:
|
82
|
+
- Sun, 22 Feb 2015 02:56:08 GMT
|
83
|
+
Expires:
|
84
|
+
- Mon, 26 Jul 1997 05:00:00 GMT
|
85
|
+
Pragma:
|
86
|
+
- no-cache
|
87
|
+
Server:
|
88
|
+
- Apache
|
89
|
+
Strict-Transport-Security:
|
90
|
+
- max-age=31536000; includeSubDomains; preload
|
91
|
+
Vary:
|
92
|
+
- Accept-Encoding
|
93
|
+
X-Accepted-Oauth-Scopes:
|
94
|
+
- read
|
95
|
+
X-Content-Type-Options:
|
96
|
+
- nosniff
|
97
|
+
X-Oauth-Scopes:
|
98
|
+
- identify,read,post,client,admin
|
99
|
+
X-Xss-Protection:
|
100
|
+
- '0'
|
101
|
+
Content-Length:
|
102
|
+
- '310'
|
103
|
+
Connection:
|
104
|
+
- keep-alive
|
105
|
+
body:
|
106
|
+
encoding: UTF-8
|
107
|
+
string: '{"ok":true,"messages":[{"username":"","text":"Here you go, dvg\n\n<http:\/\/i.imgflip.com\/gmvgk.jpg>","bot_id":"B02TFUM6S","attachments":[{"from_url":"http:\/\/i.imgflip.com\/gmvgk.jpg","fallback":"500x500px
|
108
|
+
image","image_url":"http:\/\/i.imgflip.com\/gmvgk.jpg","image_width":500,"image_height":500,"image_bytes":17919,"id":1}],"type":"message","subtype":"bot_message","ts":"1421810229.000007"},{"type":"message","user":"U02TEDJGF","text":"Jarvis
|
109
|
+
success kid thing, thing","ts":"1421810228.000006"}],"has_more":true}'
|
110
|
+
http_version:
|
111
|
+
recorded_at: Sun, 22 Feb 2015 02:56:08 GMT
|
112
|
+
- request:
|
113
|
+
method: post
|
114
|
+
uri: https://api.twitter.com/1.1/statuses/update.json
|
115
|
+
body:
|
116
|
+
encoding: UTF-8
|
117
|
+
string: status=Jarvis+success+kid+thing%2C+thing
|
118
|
+
headers:
|
119
|
+
Accept:
|
120
|
+
- application/json
|
121
|
+
User-Agent:
|
122
|
+
- TwitterRubyGem/5.14.0
|
123
|
+
Authorization:
|
124
|
+
- OAuth oauth_consumer_key="twitter_consumer_key", oauth_nonce="blah",
|
125
|
+
oauth_signature="nkSyDGscZcmm3E6j1tJon0PigdU%3D", oauth_signature_method="HMAC-SHA1",
|
126
|
+
oauth_timestamp="1424573768", oauth_token="twitter_access_token",
|
127
|
+
oauth_version="1.0"
|
128
|
+
Content-Type:
|
129
|
+
- application/x-www-form-urlencoded
|
130
|
+
Accept-Encoding:
|
131
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
132
|
+
response:
|
133
|
+
status:
|
134
|
+
code: 200
|
135
|
+
message: OK
|
136
|
+
headers:
|
137
|
+
Cache-Control:
|
138
|
+
- no-cache, no-store, must-revalidate, pre-check=0, post-check=0
|
139
|
+
Content-Disposition:
|
140
|
+
- attachment; filename=json.json
|
141
|
+
Content-Length:
|
142
|
+
- '812'
|
143
|
+
Content-Type:
|
144
|
+
- application/json;charset=utf-8
|
145
|
+
Date:
|
146
|
+
- Sun, 22 Feb 2015 02:56:09 UTC
|
147
|
+
Expires:
|
148
|
+
- Tue, 31 Mar 1981 05:00:00 GMT
|
149
|
+
Last-Modified:
|
150
|
+
- Sun, 22 Feb 2015 02:56:09 GMT
|
151
|
+
Pragma:
|
152
|
+
- no-cache
|
153
|
+
Server:
|
154
|
+
- tsa_a
|
155
|
+
Set-Cookie:
|
156
|
+
- guest_id=v1%3A142457376905829401; Domain=.twitter.com; Path=/; Expires=Tue,
|
157
|
+
21-Feb-2017 02:56:09 UTC
|
158
|
+
- lang=en
|
159
|
+
Status:
|
160
|
+
- 200 OK
|
161
|
+
Strict-Transport-Security:
|
162
|
+
- max-age=631138519
|
163
|
+
X-Access-Level:
|
164
|
+
- read-write
|
165
|
+
X-Connection-Hash:
|
166
|
+
- d66980f0c1e6d9f2d64a5803c862d92c
|
167
|
+
X-Content-Type-Options:
|
168
|
+
- nosniff
|
169
|
+
X-Frame-Options:
|
170
|
+
- SAMEORIGIN
|
171
|
+
X-Response-Time:
|
172
|
+
- '126'
|
173
|
+
X-Transaction:
|
174
|
+
- 51f9a0fef4ef5cab
|
175
|
+
X-Twitter-Response-Tags:
|
176
|
+
- BouncerCompliant
|
177
|
+
X-Xss-Protection:
|
178
|
+
- 1; mode=block
|
179
|
+
body:
|
180
|
+
encoding: UTF-8
|
181
|
+
string: '{"created_at":"Sun Feb 22 02:56:09 +0000 2015","id":569329768350380032,"id_str":"569329768350380032","text":"Jarvis
|
182
|
+
success kid thing, thing","source":"\u003ca href=\"http:\/\/placeholderjarviscat.net\"
|
183
|
+
rel=\"nofollow\"\u003eCatPenTwitter\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2859748697,"id_str":"2859748697","name":"The
|
184
|
+
Cat Pen","screen_name":"twitter_handle","location":"","profile_location":null,"description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":6,"friends_count":9,"listed_count":0,"created_at":"Tue
|
185
|
+
Nov 04 01:23:34 +0000 2014","favourites_count":1,"utc_offset":-18000,"time_zone":"Eastern
|
186
|
+
Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":28,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/529445226608218112\/yodLdvk3_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/529445226608218112\/yodLdvk3_normal.jpeg","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"}'
|
187
|
+
http_version:
|
188
|
+
recorded_at: Sun, 22 Feb 2015 02:56:09 GMT
|
189
|
+
recorded_with: VCR 2.9.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jarvis-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DVG
|
@@ -262,6 +262,20 @@ dependencies:
|
|
262
262
|
- - ">="
|
263
263
|
- !ruby/object:Gem::Version
|
264
264
|
version: '0'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: twitter
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - ">="
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '0'
|
272
|
+
type: :runtime
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - ">="
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '0'
|
265
279
|
description:
|
266
280
|
email:
|
267
281
|
- bradley.temple@gmail.com
|
@@ -286,6 +300,7 @@ files:
|
|
286
300
|
- features/step_definitions/fact_service_steps.rb
|
287
301
|
- features/step_definitions/giphy_steps.rb
|
288
302
|
- features/step_definitions/server_steps.rb
|
303
|
+
- features/step_definitions/tweet_that_steps.rb
|
289
304
|
- features/step_definitions/weather_steps.rb
|
290
305
|
- features/support/env.rb
|
291
306
|
- features/support/hooks.rb
|
@@ -300,8 +315,10 @@ files:
|
|
300
315
|
- features/support/vcr_cassettes/I_Heart_Quotes/A_Random_Quote.yml
|
301
316
|
- features/support/vcr_cassettes/I_Heart_Quotes/A_Simpsons_Quote.yml
|
302
317
|
- features/support/vcr_cassettes/I_Heart_Quotes/A_Star_Wars_Quote.yml
|
318
|
+
- features/support/vcr_cassettes/Tweet_that/Post_the_last_message_to_twitter.yml
|
303
319
|
- features/support/vcr_cassettes/Weather_Service/Use_a_specified_location.yml
|
304
320
|
- features/support/vcr_cassettes/Weather_Service/Use_default_location.yml
|
321
|
+
- features/tweet_that_service.feature
|
305
322
|
- features/weather_service.feature
|
306
323
|
- jarvis-cli.gemspec
|
307
324
|
- lib/jarvis.rb
|
@@ -322,6 +339,7 @@ files:
|
|
322
339
|
- lib/jarvis/services/giphy.rb
|
323
340
|
- lib/jarvis/services/i_heart_quotes.rb
|
324
341
|
- lib/jarvis/services/null_service.rb
|
342
|
+
- lib/jarvis/services/tweet_that.rb
|
325
343
|
- lib/jarvis/services/weather.rb
|
326
344
|
- lib/jarvis/slack.rb
|
327
345
|
- lib/jarvis/slack/message.rb
|
@@ -338,11 +356,13 @@ files:
|
|
338
356
|
- spec/services/giphy_spec.rb
|
339
357
|
- spec/services/i_heart_quotes_spec.rb
|
340
358
|
- spec/services/null_service_spec.rb
|
359
|
+
- spec/services/tweet_that_spec.rb
|
341
360
|
- spec/services/weather_spec.rb
|
342
361
|
- spec/spec_helper.rb
|
343
362
|
- spec/support/fixtures/vcr_cassettes/fact.yml
|
344
363
|
- spec/support/fixtures/vcr_cassettes/giphy.yml
|
345
364
|
- spec/support/fixtures/vcr_cassettes/i_heart_quotes.yml
|
365
|
+
- spec/support/fixtures/vcr_cassettes/tweet_that.yml
|
346
366
|
- spec/support/fixtures/vcr_cassettes/weather.yml
|
347
367
|
- spec/support/shared_contexts/server.rb
|
348
368
|
- spec/support/shared_contexts/service.rb
|
@@ -382,6 +402,7 @@ test_files:
|
|
382
402
|
- features/step_definitions/fact_service_steps.rb
|
383
403
|
- features/step_definitions/giphy_steps.rb
|
384
404
|
- features/step_definitions/server_steps.rb
|
405
|
+
- features/step_definitions/tweet_that_steps.rb
|
385
406
|
- features/step_definitions/weather_steps.rb
|
386
407
|
- features/support/env.rb
|
387
408
|
- features/support/hooks.rb
|
@@ -396,8 +417,10 @@ test_files:
|
|
396
417
|
- features/support/vcr_cassettes/I_Heart_Quotes/A_Random_Quote.yml
|
397
418
|
- features/support/vcr_cassettes/I_Heart_Quotes/A_Simpsons_Quote.yml
|
398
419
|
- features/support/vcr_cassettes/I_Heart_Quotes/A_Star_Wars_Quote.yml
|
420
|
+
- features/support/vcr_cassettes/Tweet_that/Post_the_last_message_to_twitter.yml
|
399
421
|
- features/support/vcr_cassettes/Weather_Service/Use_a_specified_location.yml
|
400
422
|
- features/support/vcr_cassettes/Weather_Service/Use_default_location.yml
|
423
|
+
- features/tweet_that_service.feature
|
401
424
|
- features/weather_service.feature
|
402
425
|
- spec/jarvis/interpreter_spec.rb
|
403
426
|
- spec/jarvis/jarvis_spec.rb
|
@@ -409,11 +432,13 @@ test_files:
|
|
409
432
|
- spec/services/giphy_spec.rb
|
410
433
|
- spec/services/i_heart_quotes_spec.rb
|
411
434
|
- spec/services/null_service_spec.rb
|
435
|
+
- spec/services/tweet_that_spec.rb
|
412
436
|
- spec/services/weather_spec.rb
|
413
437
|
- spec/spec_helper.rb
|
414
438
|
- spec/support/fixtures/vcr_cassettes/fact.yml
|
415
439
|
- spec/support/fixtures/vcr_cassettes/giphy.yml
|
416
440
|
- spec/support/fixtures/vcr_cassettes/i_heart_quotes.yml
|
441
|
+
- spec/support/fixtures/vcr_cassettes/tweet_that.yml
|
417
442
|
- spec/support/fixtures/vcr_cassettes/weather.yml
|
418
443
|
- spec/support/shared_contexts/server.rb
|
419
444
|
- spec/support/shared_contexts/service.rb
|