ruboty-ss 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 20bd4ed8c580b3be440a53c3e85db904cdf73f10
4
+ data.tar.gz: 68073c3bae351b4980c60dd197ea1cffd87daf32
5
+ SHA512:
6
+ metadata.gz: 85763c61aa190646782e3e9fb5c0a4985351821339a5bdba25d897ee92342955c75f29e32a3af0be62e64cfccaa2e621fb68e1a484364b2880415b43fb18b51b
7
+ data.tar.gz: f1cad542afa3f87e4a4a6a1a6c77863b6961450b94b02a06e18aa13843b8f80f0203ac3465659bb30efc9a1943bb58b1fe491e9ba24dca780951c434edb64fa2
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ /vendor/bundle/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruboty-ss.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 block_given?
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Ruboty::Ss
2
+
3
+ ruboty plugin for take a screenshot of website.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ruboty-ss'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ruboty-ss
20
+
21
+ ## Usage
22
+
23
+ @ruboty ss http://example.com/
24
+
25
+ ## Where screenshots go?
26
+
27
+ [Gyazo](https://gyazo.com/ja).
28
+
29
+ ### How to save screenshots in Dropbox
30
+
31
+ You need to get Dropbox access token:
32
+
33
+ https://www.dropbox.com/developers/core/start/ruby
34
+
35
+ RUBOTY_SS_STORAGE=dropbox RUBOTY_SS_DROPBOX_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN> bundle exec ruboty
36
+
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it ( https://github.com/blockgiven/ruboty-ss/fork )
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Push to the branch (`git push origin my-new-feature`)
44
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,15 @@
1
+ module Ruboty
2
+ module Handlers
3
+ class Ss < Base
4
+ # FIME: move envs to ruboty/ss/storage/*.rb
5
+ env :RUBOTY_SS_STORAGE, 'storage provider for ruboty-ss. (default: gyazo)', optional: true
6
+ env :RUBOTY_SS_DROPBOX_ACCESS_TOKEN, 'dropbox access token.', optional: true
7
+
8
+ on %r{ss (?<url>http(?:s?)://.*)}, name: 'screenshot', description: 'take a screenshot'
9
+
10
+ def screenshot(message)
11
+ Ruboty::Ss::Actions::TakeScreenshot.new(message).call
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,52 @@
1
+ require 'mem'
2
+ require 'phantomjs'
3
+
4
+ module Ruboty
5
+ module Ss
6
+ module Actions
7
+ class TakeScreenshot < Ruboty::Actions::Base
8
+ include Mem
9
+
10
+ SCREENSHOT_SCRIPT = File.expand_path('../../../../scripts/screenshot.js', __dir__)
11
+
12
+ def call
13
+ unless image_file
14
+ message.reply("@#{message.from_name} スクショとれなかったっしょ")
15
+ return
16
+ end
17
+
18
+ if url = upload(image_file)
19
+ message.reply("@#{message.from_name} #{url}")
20
+ end
21
+ end
22
+
23
+ def image_file
24
+ Tempfile.open(%w(tempfile .png)) do |file|
25
+ output = Phantomjs.run(SCREENSHOT_SCRIPT, message[:url], file.path)
26
+ unless output.include?('FAIL')
27
+ file
28
+ end
29
+ end
30
+ end
31
+ memoize :image_file
32
+
33
+ def image_path
34
+ # TODO: extract to host/path/to/url/date.png
35
+ "#{Time.now.to_s}.png"
36
+ end
37
+
38
+ def upload(image_file)
39
+ storage_class.new.upload(image_file, path: image_path)
40
+ end
41
+
42
+ def storage
43
+ ENV['RUBOTY_SS_STORAGE'] || 'gyazo'
44
+ end
45
+
46
+ def storage_class
47
+ Ruboty::Ss::Storage.const_get(storage.dup.tap {|s| s[0] = s[0].upcase })
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,33 @@
1
+ require 'dropbox_sdk'
2
+ require 'mem'
3
+ require 'open-uri'
4
+
5
+ module Ruboty
6
+ module Ss
7
+ module Storage
8
+ class Dropbox
9
+ include Mem
10
+
11
+ def upload(image_file, options)
12
+ response = client.put_file(options[:path], image_file)
13
+ sleep 0.5 # FIXME
14
+ shares = client.shares(response['path'])
15
+ sleep 0.5 # FIXME
16
+ uri = OpenURI.open_uri(shares['url'])
17
+ URI.join(uri.base_uri.to_s, '?dl=1').to_s
18
+ rescue => e
19
+ e.message
20
+ end
21
+
22
+ def access_token
23
+ ENV['RUBOTY_SS_DROPBOX_ACCESS_TOKEN']
24
+ end
25
+
26
+ def client
27
+ DropboxClient.new(access_token)
28
+ end
29
+ memoize :client
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,51 @@
1
+ require 'mem'
2
+ require 'jsonism'
3
+ require 'yaml'
4
+
5
+ module Ruboty
6
+ module Ss
7
+ module Storage
8
+ class Gist
9
+ include Mem
10
+
11
+ def initialize
12
+ raise "Ruboty::Ss::Storage::Gist doesn't work"
13
+ end
14
+
15
+ def upload(image_file, path)
16
+ files =
17
+ {
18
+ path => {
19
+ content: Faraday::UploadIO.new(image_file.path, 'image/png')
20
+ }
21
+ }
22
+ gist_client.create_gist(files: files)
23
+ end
24
+
25
+ private
26
+
27
+ def gist_client
28
+ client = Jsonism::Client.new(schema: gist_schema)
29
+
30
+ def client.connection
31
+ Faraday.new(url: base_url) do |connection|
32
+ connection.request :multipart
33
+ connection.request :url_encoded
34
+ connection.response :json
35
+ connection.adapter :net_http
36
+ end
37
+ end
38
+
39
+ client
40
+ end
41
+ memoize :gist_client
42
+
43
+ def gist_schema
44
+ schema_path = File.expand_path('../../../../vendor/r7kamura/json-collection/github/schema.yml', __dir__)
45
+ YAML.load_file(schema_path)
46
+ end
47
+ memoize :gist_schema
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,24 @@
1
+ require 'gyazo'
2
+ require 'mem'
3
+
4
+ module Ruboty
5
+ module Ss
6
+ module Storage
7
+ class Gyazo
8
+ include Mem
9
+
10
+ def upload(image_file, options)
11
+ "#{client.upload(image_file.path)}.png"
12
+ rescue => e
13
+ e.message
14
+ end
15
+
16
+ private
17
+
18
+ def client
19
+ ::Gyazo::Client.new
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,5 @@
1
+ module Ruboty
2
+ module Ss
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
data/lib/ruboty/ss.rb ADDED
@@ -0,0 +1,12 @@
1
+ require "ruboty/ss/version"
2
+ require "ruboty/ss/storage/dropbox"
3
+ require "ruboty/ss/storage/gist"
4
+ require "ruboty/ss/storage/gyazo"
5
+ require "ruboty/ss/actions/take_screenshot"
6
+ require "ruboty/handlers/ss"
7
+
8
+ module Ruboty
9
+ module Ss
10
+ # Your code goes here...
11
+ end
12
+ end
data/ruboty-ss.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruboty/ss/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruboty-ss"
8
+ spec.version = Ruboty::Ss::VERSION
9
+ spec.authors = ["block_given?"]
10
+ spec.email = ["block_given@outlook.com"]
11
+ spec.summary = %q{ruboty plugin for take a screenshot of website.}
12
+ spec.homepage = "https://github.com/blockgiven/ruboty-ss/"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency "dropbox-sdk"
21
+ spec.add_runtime_dependency "gyazo"
22
+ spec.add_runtime_dependency "jsonism"
23
+ spec.add_runtime_dependency "mem"
24
+ spec.add_runtime_dependency "ruboty"
25
+ spec.add_runtime_dependency "phantomjs"
26
+ spec.add_development_dependency "bundler", "~> 1.7"
27
+ spec.add_development_dependency "jdoc"
28
+ spec.add_development_dependency "pry"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ end
@@ -0,0 +1,18 @@
1
+ var system = require('system');
2
+ var url = system.args[1];
3
+ var image_path = system.args[2];
4
+
5
+ var page = require('webpage').create();
6
+ page.open(url, function(status) {
7
+ page.render(image_path);
8
+ if (status !== 'success') {
9
+ return console.log('FAIL');
10
+ }
11
+ page.render(image_path);
12
+ phantom.exit();
13
+ });
14
+
15
+ setTimeout(function () {
16
+ console.log('FAIL');
17
+ phantom.exit();
18
+ }, 10 * 1000);
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "jdoc"
4
+ gem "plz"
@@ -0,0 +1,45 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ activesupport (4.1.1)
5
+ i18n (~> 0.6, >= 0.6.9)
6
+ json (~> 1.7, >= 1.7.7)
7
+ minitest (~> 5.1)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 1.1)
10
+ erubis (2.7.0)
11
+ faraday (0.9.0)
12
+ multipart-post (>= 1.2, < 3)
13
+ faraday_middleware (0.9.1)
14
+ faraday (>= 0.7.4, < 0.10)
15
+ i18n (0.6.9)
16
+ jdoc (0.0.8)
17
+ erubis
18
+ json_schema
19
+ json (1.8.1)
20
+ json_schema (0.1.4)
21
+ minitest (5.3.4)
22
+ multipart-post (2.0.0)
23
+ plz (0.1.1)
24
+ activesupport
25
+ faraday
26
+ faraday_middleware
27
+ json_schema
28
+ rack
29
+ rainbow
30
+ rouge
31
+ slop
32
+ rack (1.5.2)
33
+ rainbow (2.0.0)
34
+ rouge (1.4.0)
35
+ slop (3.5.0)
36
+ thread_safe (0.3.4)
37
+ tzinfo (1.2.1)
38
+ thread_safe (~> 0.1)
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ jdoc
45
+ plz
@@ -0,0 +1,58 @@
1
+ # JSON Collection
2
+ A collection of JSON Schema for various APIs.
3
+
4
+ ## Try API
5
+ The handy CLI HTTP Client [plz](https://github.com/r7kamura/plz) help you try the API.
6
+
7
+ ```sh
8
+ $ gem install plz
9
+ $ cd github
10
+ $ plz --help
11
+ Usage: plz <action> <target> [headers|params] [options]
12
+ -h, --help Display help message
13
+ --no-color Disable coloring output
14
+ --no-response-body Hide response body
15
+ --no-response-header Hide response header
16
+ Examples:
17
+ plz show gist id=1
18
+ plz list gist
19
+ plz list_starred gist
20
+ plz list_users gist name=r7kamura
21
+ plz list_public gist
22
+ plz create gist
23
+ plz update gist id=1
24
+ plz delete gist id=1
25
+ plz list_commits gist id=1
26
+ plz star gist id=1
27
+ plz unstar gist id=1
28
+ plz starred gist id=1
29
+ plz fork gist id=1
30
+
31
+ $ plz list_users gist name=r7kamura
32
+ $ plz list_public
33
+ $ echo '
34
+ {
35
+ "description": "Test",
36
+ "public": true,
37
+ "files": {
38
+ "hello.txt": {
39
+ "content": "world"
40
+ }
41
+ }
42
+ }' > 3
43
+ $ plz create gist <3
44
+ ```
45
+
46
+ ## API Docs
47
+ API documentations are auto-generated from JSON Schema by [jdoc](https://github.com/r7kamura/jdoc).
48
+
49
+ * [github/docs.md](github/docs.md)
50
+
51
+ ```sh
52
+ $ jdoc github/schema.yml > github/docs.md
53
+ ```
54
+
55
+ ## Supported APIs
56
+ Currently we only support GitHub APIv3 because we are severely understaffed.
57
+
58
+ * [GitHub API v3](https://developer.github.com/v3/)
@@ -0,0 +1,369 @@
1
+ # GitHub API v3
2
+ * [Gist](#gist)
3
+ * [GET /gists](#get-gists)
4
+ * [POST /gists](#post-gists)
5
+ * [GET /gists/:id](#get-gistsid)
6
+ * [PATCH /gists/:id](#patch-gistsid)
7
+ * [DELETE /gists/:id](#delete-gistsid)
8
+ * [POST /gists/:id/forks](#post-gistsidforks)
9
+ * [GET /gists/:id/star](#get-gistsidstar)
10
+ * [PUT /gists/:id/star](#put-gistsidstar)
11
+ * [DELETE /gists/:id/star](#delete-gistsidstar)
12
+ * [GET /gists/public](#get-gistspublic)
13
+ * [GET /gists/starred](#get-gistsstarred)
14
+ * [GET /users/:name/gists](#get-usersnamegists)
15
+ * [Comment](#comment)
16
+ * [GET /gists/:id/comments](#get-gistsidcomments)
17
+ * [POST /gists/:id/comments](#post-gistsidcomments)
18
+ * [Commit](#commit)
19
+ * [GET /gists/:id/commits](#get-gistsidcommits)
20
+
21
+ ## Gist
22
+ Gist object
23
+
24
+ ### Properties
25
+ * id - Identifier of a gist
26
+ * Example: `"1"`
27
+ * Type: string
28
+
29
+ ### GET /gists
30
+ List the authenticated user's gists or if called anonymously, this will return all public gists
31
+
32
+ ```
33
+ GET /gists HTTP/1.1
34
+ Content-Type: application/json
35
+ Host: api.github.com
36
+ ```
37
+
38
+ ```
39
+ HTTP/1.1 200
40
+ Content-Type: application/json
41
+
42
+ {
43
+ "id": "1"
44
+ }
45
+ ```
46
+
47
+ ### POST /gists
48
+ Create a gist
49
+
50
+ ```
51
+ POST /gists HTTP/1.1
52
+ Content-Type: application/json
53
+ Host: api.github.com
54
+
55
+ {
56
+ "id": "1"
57
+ }
58
+ ```
59
+
60
+ ```
61
+ HTTP/1.1 201
62
+ Content-Type: application/json
63
+
64
+ {
65
+ "id": "1"
66
+ }
67
+ ```
68
+
69
+ ### GET /gists/:id
70
+ Get a single gist
71
+
72
+ ```
73
+ GET /gists/:id HTTP/1.1
74
+ Content-Type: application/json
75
+ Host: api.github.com
76
+ ```
77
+
78
+ ```
79
+ HTTP/1.1 200
80
+ Content-Type: application/json
81
+
82
+ {
83
+ "id": "1"
84
+ }
85
+ ```
86
+
87
+ ### PATCH /gists/:id
88
+ Edit a gist
89
+
90
+ ```
91
+ PATCH /gists/:id HTTP/1.1
92
+ Content-Type: application/json
93
+ Host: api.github.com
94
+
95
+ {
96
+ "id": "1"
97
+ }
98
+ ```
99
+
100
+ ```
101
+ HTTP/1.1 200
102
+ Content-Type: application/json
103
+
104
+ {
105
+ "id": "1"
106
+ }
107
+ ```
108
+
109
+ ### DELETE /gists/:id
110
+ Delete a gist
111
+
112
+ ```
113
+ DELETE /gists/:id HTTP/1.1
114
+ Content-Type: application/json
115
+ Host: api.github.com
116
+ ```
117
+
118
+ ```
119
+ HTTP/1.1 200
120
+ Content-Type: application/json
121
+
122
+ {
123
+ "id": "1"
124
+ }
125
+ ```
126
+
127
+ ### POST /gists/:id/forks
128
+ Fork a gist
129
+
130
+ ```
131
+ POST /gists/:id/forks HTTP/1.1
132
+ Content-Type: application/json
133
+ Host: api.github.com
134
+
135
+ {
136
+ "id": "1"
137
+ }
138
+ ```
139
+
140
+ ```
141
+ HTTP/1.1 201
142
+ Content-Type: application/json
143
+
144
+ {
145
+ "id": "1"
146
+ }
147
+ ```
148
+
149
+ ### GET /gists/:id/star
150
+ Check if a gist is starred
151
+
152
+ ```
153
+ GET /gists/:id/star HTTP/1.1
154
+ Content-Type: application/json
155
+ Host: api.github.com
156
+ ```
157
+
158
+ ```
159
+ HTTP/1.1 200
160
+ Content-Type: application/json
161
+
162
+ {
163
+ "id": "1"
164
+ }
165
+ ```
166
+
167
+ ### PUT /gists/:id/star
168
+ Star a gist
169
+
170
+ ```
171
+ PUT /gists/:id/star HTTP/1.1
172
+ Content-Type: application/json
173
+ Host: api.github.com
174
+
175
+ {
176
+ "id": "1"
177
+ }
178
+ ```
179
+
180
+ ```
181
+ HTTP/1.1 200
182
+ Content-Type: application/json
183
+
184
+ {
185
+ "id": "1"
186
+ }
187
+ ```
188
+
189
+ ### DELETE /gists/:id/star
190
+ Unstar a gist
191
+
192
+ ```
193
+ DELETE /gists/:id/star HTTP/1.1
194
+ Content-Type: application/json
195
+ Host: api.github.com
196
+ ```
197
+
198
+ ```
199
+ HTTP/1.1 200
200
+ Content-Type: application/json
201
+
202
+ {
203
+ "id": "1"
204
+ }
205
+ ```
206
+
207
+ ### GET /gists/public
208
+ List public gists
209
+
210
+ ```
211
+ GET /gists/public HTTP/1.1
212
+ Content-Type: application/json
213
+ Host: api.github.com
214
+ ```
215
+
216
+ ```
217
+ HTTP/1.1 200
218
+ Content-Type: application/json
219
+
220
+ {
221
+ "id": "1"
222
+ }
223
+ ```
224
+
225
+ ### GET /gists/starred
226
+ List the authenticated user’s starred gists
227
+
228
+ ```
229
+ GET /gists/starred HTTP/1.1
230
+ Content-Type: application/json
231
+ Host: api.github.com
232
+ ```
233
+
234
+ ```
235
+ HTTP/1.1 200
236
+ Content-Type: application/json
237
+
238
+ {
239
+ "id": "1"
240
+ }
241
+ ```
242
+
243
+ ### GET /users/:name/gists
244
+ List a user's gists
245
+
246
+ ```
247
+ GET /users/:name/gists HTTP/1.1
248
+ Content-Type: application/json
249
+ Host: api.github.com
250
+ ```
251
+
252
+ ```
253
+ HTTP/1.1 200
254
+ Content-Type: application/json
255
+
256
+ {
257
+ "id": "1"
258
+ }
259
+ ```
260
+
261
+ ## Comment
262
+
263
+
264
+ ### Properties
265
+ * id -
266
+ * Example: `1`
267
+ * Type: integer
268
+ * url -
269
+ * Example: `"https://api.github.com/gists/928ee253e79db4809168/comments/1"`
270
+ * Type: string
271
+ * body -
272
+ * Example: `"Just commenting for the sake of commenting"`
273
+ * Type: string
274
+ * created_at -
275
+ * Example: `"2011-04-18T23:23:56Z"`
276
+ * Type: string
277
+ * Format: date-time
278
+ * updated_at -
279
+ * Example: `"2011-04-18T23:23:56Z"`
280
+ * Type: string
281
+ * Format: date-time
282
+
283
+ ### GET /gists/:id/comments
284
+ List comments on a gist
285
+
286
+ ```
287
+ GET /gists/:id/comments HTTP/1.1
288
+ Content-Type: application/json
289
+ Host: api.github.com
290
+ ```
291
+
292
+ ```
293
+ HTTP/1.1 200
294
+ Content-Type: application/json
295
+
296
+ {
297
+ "id": 1,
298
+ "url": "https://api.github.com/gists/928ee253e79db4809168/comments/1",
299
+ "body": "Just commenting for the sake of commenting",
300
+ "created_at": "2011-04-18T23:23:56Z",
301
+ "updated_at": "2011-04-18T23:23:56Z"
302
+ }
303
+ ```
304
+
305
+ ### POST /gists/:id/comments
306
+ Create a comment
307
+
308
+ ```
309
+ POST /gists/:id/comments HTTP/1.1
310
+ Content-Type: application/json
311
+ Host: api.github.com
312
+
313
+ {
314
+ "id": 1,
315
+ "url": "https://api.github.com/gists/928ee253e79db4809168/comments/1",
316
+ "body": "Just commenting for the sake of commenting",
317
+ "created_at": "2011-04-18T23:23:56Z",
318
+ "updated_at": "2011-04-18T23:23:56Z"
319
+ }
320
+ ```
321
+
322
+ ```
323
+ HTTP/1.1 201
324
+ Content-Type: application/json
325
+
326
+ {
327
+ "id": 1,
328
+ "url": "https://api.github.com/gists/928ee253e79db4809168/comments/1",
329
+ "body": "Just commenting for the sake of commenting",
330
+ "created_at": "2011-04-18T23:23:56Z",
331
+ "updated_at": "2011-04-18T23:23:56Z"
332
+ }
333
+ ```
334
+
335
+ ## Commit
336
+
337
+
338
+ ### Properties
339
+ * url -
340
+ * Example: `"https://api.github.com/gists/e49e8dbd1b30d170449c"`
341
+ * Type: string
342
+ * version -
343
+ * Example: `"57a7f021a713b1c5a6a199b54cc514735d2d462f"`
344
+ * Type: string
345
+ * committed_at -
346
+ * Example: `"2010-04-14T02:15:15Z"`
347
+ * Type: string
348
+ * Format: date-time
349
+
350
+ ### GET /gists/:id/commits
351
+ List gist commits
352
+
353
+ ```
354
+ GET /gists/:id/commits HTTP/1.1
355
+ Content-Type: application/json
356
+ Host: api.github.com
357
+ ```
358
+
359
+ ```
360
+ HTTP/1.1 200
361
+ Content-Type: application/json
362
+
363
+ {
364
+ "url": "https://api.github.com/gists/e49e8dbd1b30d170449c",
365
+ "version": "57a7f021a713b1c5a6a199b54cc514735d2d462f",
366
+ "committed_at": "2010-04-14T02:15:15Z"
367
+ }
368
+ ```
369
+
@@ -0,0 +1,219 @@
1
+ ---
2
+ "$schema": http://json-schema.org/draft-04/hyper-schema
3
+ definitions:
4
+ user:
5
+ title: User
6
+ definitions:
7
+ name:
8
+ type:
9
+ - string
10
+ example: "r7kamura"
11
+ comment:
12
+ title: Comment
13
+ properties:
14
+ id:
15
+ "$ref": "#/definitions/comment/definitions/id"
16
+ url:
17
+ "$ref": "#/definitions/comment/definitions/url"
18
+ body:
19
+ "$ref": "#/definitions/comment/definitions/body"
20
+ created_at:
21
+ "$ref": "#/definitions/comment/definitions/created_at"
22
+ updated_at:
23
+ "$ref": "#/definitions/comment/definitions/updated_at"
24
+ definitions:
25
+ id:
26
+ type: integer
27
+ example: 1
28
+ url:
29
+ type: string
30
+ example: "https://api.github.com/gists/928ee253e79db4809168/comments/1"
31
+ body:
32
+ type: string
33
+ example: Just commenting for the sake of commenting
34
+ created_at:
35
+ type: string
36
+ format: date-time
37
+ example: "2011-04-18T23:23:56Z"
38
+ updated_at:
39
+ type: string
40
+ format: date-time
41
+ example: "2011-04-18T23:23:56Z"
42
+ commit:
43
+ title: Commit
44
+ properties:
45
+ url:
46
+ "$ref": "#/definitions/commit/definitions/url"
47
+ version:
48
+ "$ref": "#/definitions/commit/definitions/version"
49
+ committed_at:
50
+ "$ref": "#/definitions/commit/definitions/committed_at"
51
+ definitions:
52
+ url:
53
+ type: string
54
+ example: "https://api.github.com/gists/e49e8dbd1b30d170449c"
55
+ version:
56
+ type: string
57
+ example: 57a7f021a713b1c5a6a199b54cc514735d2d462f
58
+ committed_at:
59
+ type: string
60
+ format: date-time
61
+ example: "2010-04-14T02:15:15Z"
62
+ gist:
63
+ title: Gist
64
+ description: Gist object
65
+ type:
66
+ - object
67
+ required:
68
+ - id
69
+ definitions:
70
+ id:
71
+ description: Identifier of a gist
72
+ type:
73
+ - string
74
+ example: "1"
75
+ public:
76
+ description: "Indicates whether the gist is public. Default: `false`"
77
+ type:
78
+ - boolean
79
+ example: true
80
+ description:
81
+ description: the description for this gist
82
+ type:
83
+ - string
84
+ example: "description of gist"
85
+ files:
86
+ description: Files that make up this gist (used for both POST and PATCH)
87
+ type: object
88
+ example:
89
+ file1.txt:
90
+ content: updated file contents
91
+ old_name.txt:
92
+ filename: new_name.txt
93
+ content: modified contents
94
+ new_file.txt:
95
+ content: a new file
96
+ delete_this_file.txt: null
97
+ links:
98
+ - title: Show
99
+ description: Get a single gist
100
+ method: GET
101
+ href: "/gists/{(#/definitions/gist/definitions/id)}"
102
+ rel: show
103
+ - title: List
104
+ description: List the authenticated user's gists or if called anonymously, this will return all public gists
105
+ method: GET
106
+ href: "/gists"
107
+ rel: instances
108
+ - title: ListStarred
109
+ description: List the authenticated user’s starred gists
110
+ method: GET
111
+ href: "/gists/starred"
112
+ rel: instances
113
+ - title: ListUsers
114
+ description: List a user's gists
115
+ href: "/users/{(#/definitions/user/definitions/name)}/gists"
116
+ method: GET
117
+ rel: instances
118
+ - title: ListPublic
119
+ description: List public gists
120
+ href: "/gists/public"
121
+ method: GET
122
+ rel: instances
123
+ - title: Create
124
+ description: Create a gist
125
+ href: "/gists"
126
+ method: POST
127
+ rel: create
128
+ schema:
129
+ properties:
130
+ description:
131
+ "$ref": "#/definitions/gist/definitions/description"
132
+ public:
133
+ "$ref": "#/definitions/gist/definitions/public"
134
+ files:
135
+ "$ref": "#/definitions/gist/definitions/files"
136
+ - title: Update
137
+ description: Edit a gist
138
+ method: PATCH
139
+ href: "/gists/{(#/definitions/gist/definitions/id)}"
140
+ rel: update
141
+ schema:
142
+ type: object
143
+ properties:
144
+ description:
145
+ "$ref": "#/definitions/gist/definitions/description"
146
+ public:
147
+ "$ref": "#/definitions/gist/definitions/public"
148
+ files:
149
+ "$ref": "#/definitions/gist/definitions/files"
150
+ - title: Delete
151
+ description: Delete a gist
152
+ method: DELETE
153
+ href: "/gists/{(#/definitions/gist/definitions/id)}"
154
+ rel: delete
155
+ - title: ListCommits
156
+ description: List gist commits
157
+ method: GET
158
+ href: "/gists/{(#/definitions/gist/definitions/id)}/commits"
159
+ rel: instances
160
+ targetSchema:
161
+ $ref: "#/properties/commit"
162
+ - title: Star
163
+ description: Star a gist
164
+ method: PUT
165
+ href: "/gists/{(#/definitions/gist/definitions/id)}/star"
166
+ rel: update
167
+ - title: Unstar
168
+ description: Unstar a gist
169
+ method: DELETE
170
+ href: "/gists/{(#/definitions/gist/definitions/id)}/star"
171
+ rel: delete
172
+ - title: Starred
173
+ description: Check if a gist is starred
174
+ method: GET
175
+ href: "/gists/{(#/definitions/gist/definitions/id)}/star"
176
+ rel: show
177
+ - title: Fork
178
+ description: Fork a gist
179
+ method: POST
180
+ href: "/gists/{(#/definitions/gist/definitions/id)}/forks"
181
+ rel: create
182
+ - title: ListComments
183
+ description: List comments on a gist
184
+ method: GET
185
+ href: "/gists/{(#/definitions/gist/definitions/id)}/comments"
186
+ rel: instances
187
+ targetSchema:
188
+ "$ref": "#/properties/comment"
189
+ - title: CreateComment
190
+ description: Create a comment
191
+ method: POST
192
+ href: "/gists/{(#/definitions/gist/definitions/id)}/comments"
193
+ rel: create
194
+ targetSchema:
195
+ "$ref": "#/properties/comment"
196
+ schema:
197
+ type: object
198
+ properties:
199
+ body:
200
+ "$ref": "#/definitions/comment/definitions/body"
201
+ properties:
202
+ id:
203
+ "$ref": "#/definitions/gist/definitions/id"
204
+ properties:
205
+ gist:
206
+ "$ref": "#/definitions/gist"
207
+ commit:
208
+ "$ref": "#/definitions/commit"
209
+ comment:
210
+ "$ref": "#/definitions/comment"
211
+ user:
212
+ "$ref": "#/definitions/user"
213
+ type:
214
+ - object
215
+ description: GitHub API v3
216
+ links:
217
+ - href: https://api.github.com
218
+ rel: self
219
+ title: GitHub API v3
metadata ADDED
@@ -0,0 +1,204 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruboty-ss
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - block_given?
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dropbox-sdk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: gyazo
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jsonism
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mem
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: ruboty
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: phantomjs
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: bundler
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.7'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.7'
111
+ - !ruby/object:Gem::Dependency
112
+ name: jdoc
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '10.0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '10.0'
153
+ description:
154
+ email:
155
+ - block_given@outlook.com
156
+ executables: []
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - ".gitignore"
161
+ - Gemfile
162
+ - LICENSE.txt
163
+ - README.md
164
+ - Rakefile
165
+ - lib/ruboty/handlers/ss.rb
166
+ - lib/ruboty/ss.rb
167
+ - lib/ruboty/ss/actions/take_screenshot.rb
168
+ - lib/ruboty/ss/storage/dropbox.rb
169
+ - lib/ruboty/ss/storage/gist.rb
170
+ - lib/ruboty/ss/storage/gyazo.rb
171
+ - lib/ruboty/ss/version.rb
172
+ - ruboty-ss.gemspec
173
+ - scripts/screenshot.js
174
+ - vendor/r7kamura/json-collection/Gemfile
175
+ - vendor/r7kamura/json-collection/Gemfile.lock
176
+ - vendor/r7kamura/json-collection/README.md
177
+ - vendor/r7kamura/json-collection/github/docs.md
178
+ - vendor/r7kamura/json-collection/github/schema.yml
179
+ homepage: https://github.com/blockgiven/ruboty-ss/
180
+ licenses:
181
+ - MIT
182
+ metadata: {}
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubyforge_project:
199
+ rubygems_version: 2.2.2
200
+ signing_key:
201
+ specification_version: 4
202
+ summary: ruboty plugin for take a screenshot of website.
203
+ test_files: []
204
+ has_rdoc: