webpurify_api 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cca296ba0e42f58beccb90eb65da48b494a5cdcc
4
- data.tar.gz: ab82364a0424d6a6c1ebb50cc7f87a272d655d0c
3
+ metadata.gz: 5f10e533c7e7a05fb26ca862ce9c9f9300ea619c
4
+ data.tar.gz: e1683f7a9d62cd1a09ba83fde3c1a4589de390e9
5
5
  SHA512:
6
- metadata.gz: d1e54aaf496ac332a03758d6b8a1b6096979ba5a02ec02b370bbdfbf5ffdd6051db729b541d8c05ae2bc97caab44b814a4b6ae1bdc70f9fc7c40d0745bf89d00
7
- data.tar.gz: c10cafbcb298fe8fc1f0936d6f6d7f55c8ad7eae24153db81c8799ccd6a710f116e410529dfbaa77e4cfeb8c090180635aad7fb5b9bc3c6426557d82592d6f78
6
+ metadata.gz: 21424eeee0e4f6dbc7d32532b1e326e815ca23948d0135bb6417f3c9c48160764b74523e3b743633b61c805d242e0c32583d00bc5315957beda637d422d35e6f
7
+ data.tar.gz: 53e281e2203f9e823b977eb11c25c58a466ec809e271a428967f1a0adb15aebdd06d5c78f40fbe800d8240085c887e5a7a6196bc6d43bd37337247dd76607105
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # WebpurifyApi
2
2
 
3
- API Wrapper for http://webpurify.com image moderation api
3
+ API Wrapper for http://webpurify.com image and video moderation api
4
4
 
5
5
  ## Installation
6
6
 
@@ -3,6 +3,7 @@ require 'active_support/all'
3
3
  require "webpurify_api/version"
4
4
  require "webpurify_api/base"
5
5
  require "webpurify_api/image"
6
+ require "webpurify_api/video"
6
7
 
7
8
  module WebpurifyApi
8
9
  end
@@ -57,7 +57,7 @@ class WebpurifyApi::Base
57
57
  private
58
58
 
59
59
  def valid_method?(method)
60
- %w(imgcheck imgstatus imgaccount).include?(method.to_s)
60
+ %w(imgcheck imgstatus imgaccount vidcheck vidstatus vidaccount).include?(method.to_s)
61
61
  end
62
62
 
63
63
  def request_method(method)
@@ -6,8 +6,7 @@ class WebpurifyApi::Image < WebpurifyApi::Base
6
6
  # callback url receive a get request with +imgid+ and +status+ parameters
7
7
  # status: 1 = approved , status: 2 = declined
8
8
  def check(url, custom_image_id: nil, callback: nil)
9
- res = do_request(:imgcheck, params: { imgurl: url, customimgid: custom_image_id, callback: callback })
10
- res
9
+ do_request(:imgcheck, params: { imgurl: url, customimgid: custom_image_id, callback: callback })
11
10
  end
12
11
 
13
12
  def status(custom_image_id: nil, image_id: nil)
@@ -1,3 +1,3 @@
1
1
  module WebpurifyApi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,20 @@
1
+ class WebpurifyApi::Video < WebpurifyApi::Base
2
+ def initialize(api_key: nil, live: nil)
3
+ super(api_key: api_key, live: live, endpoint: "https://im-api1.webpurify.com/video/services/rest/")
4
+ end
5
+
6
+ # callback url receive a get request with +imgid+ and +status+ parameters
7
+ # status: 1 = approved , status: 2 = declined
8
+ def check(url, custom_video_id: nil)
9
+ do_request(:vidcheck, params: { vidurl: url, customvidid: custom_video_id })
10
+ end
11
+
12
+ def status(video_id: nil, custom_video_id: nil)
13
+ params = custom_video_id.nil? ? { vidid: video_id } : { customvidid: custom_video_id }
14
+ do_request(:vidstatus, params: params)
15
+ end
16
+
17
+ def account
18
+ do_request(:vidaccount)
19
+ end
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpurify_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-15 00:00:00.000000000 Z
11
+ date: 2015-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,6 +82,7 @@ files:
82
82
  - lib/webpurify_api/base.rb
83
83
  - lib/webpurify_api/image.rb
84
84
  - lib/webpurify_api/version.rb
85
+ - lib/webpurify_api/video.rb
85
86
  - webpurify_api.gemspec
86
87
  homepage: https://github.com/veilleperso/webpurify_api
87
88
  licenses: