vk_api_simple 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: a332ed134a60ebd09511dbfeba5b9933eb41170bc7312d352b0752a0b6165e96
4
- data.tar.gz: a5d10a860f5069b754b2e67c0bdf57b87b76a03bf3c423bb933cb0252f4ebbdc
3
+ metadata.gz: 846cc24a8cc83a7368518f0431eda89c2733a2bf425788837e9cfd9d7946e663
4
+ data.tar.gz: e4a97dc5d41191a85549f4b589d05f17bed4f6a8e54cb65c9701d5a04ceaefdf
5
5
  SHA512:
6
- metadata.gz: bec6f250dcced8accaf41eb584fb36062c816f63918f25f615a27921d94d48df92f3d60d96b392314bb0e01ebbcbe42e488b8a9b806932e39360e80dd87b9ec2
7
- data.tar.gz: 0dbb72988ac9fc1dbf6468981318fec56a320b85ae6e36863d54006f34fc0e42cf711592e4d07b682201ceeb5571074e244fc0755d04367dd19d86f5317fa40b
6
+ metadata.gz: edfa6bba803f372ee0287c9c6658f7364ea96d49b9e2d44b533bd05d08187bf1be0b361e674d052887988d6c0f260136d8719d616437082c0ecfd65fa71f9ba9
7
+ data.tar.gz: d5c61d4edb61d1858b4f42f177c26a8e6b2f0ba245d2b6b2999ce04b4775955f03c476bcd00bdd009f9d2367bf84f33ec72589badbaf506ab5b6ef1a01322dde
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Photos
3
+ # Returns server's url for uploading photos
4
+ module GetMarketUploadServer
5
+ def get_market_upload_server(args = {})
6
+ response = RestClient.get("#{BASE_URI}getMarketUploadServer?access_token=#{token}&main_photo=1&group_id=#{args[:group_id]}&v=#{api_version}")
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Photos
3
+ # Save uploaded image at server
4
+ module SaveMarketPhoto
5
+ def save_market_photo(args = {})
6
+ response = RestClient.post("#{BASE_URI}saveMarketPhoto?access_token=#{token}&group_id=#{args[:group_id]}&server=#{args[:server]}&photo=#{args[:photo]}&hash=#{args[:hash]}&crop_data=#{args[:crop_data]}&crop_hash=#{args[:crop_hash]}&v=#{api_version}")
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,14 +1,18 @@
1
1
  require 'rest-client'
2
2
  require 'json'
3
+ require_relative 'photos/get_market_upload_server'
3
4
  require_relative 'photos/get_upload_server'
4
5
  require_relative 'photos/save'
6
+ require_relative 'photos/save_market_photo'
5
7
  require_relative 'photos/upload_image'
6
8
 
7
9
  module VkApiSimple
8
10
  # Clients requests
9
11
  class Photos
12
+ include VkApiSimple::Photos::GetMarketUploadServer
10
13
  include VkApiSimple::Photos::GetUploadServer
11
14
  include VkApiSimple::Photos::Save
15
+ include VkApiSimple::Photos::SaveMarketPhoto
12
16
  include VkApiSimple::Photos::UploadImage
13
17
 
14
18
  BASE_URI = 'https://api.vk.com/method/photos.'.freeze
@@ -1,3 +1,3 @@
1
1
  module VkApiSimple
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vk_api_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kortirso
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-05 00:00:00.000000000 Z
11
+ date: 2018-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,8 +100,10 @@ files:
100
100
  - bin/setup
101
101
  - lib/vk_api_simple.rb
102
102
  - lib/vk_api_simple/photos.rb
103
+ - lib/vk_api_simple/photos/get_market_upload_server.rb
103
104
  - lib/vk_api_simple/photos/get_upload_server.rb
104
105
  - lib/vk_api_simple/photos/save.rb
106
+ - lib/vk_api_simple/photos/save_market_photo.rb
105
107
  - lib/vk_api_simple/photos/upload_image.rb
106
108
  - lib/vk_api_simple/version.rb
107
109
  - vk_api_simple.gemspec