social_pilot 0.1.2 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/social_pilot.rb +5 -9
- data/lib/social_pilot/post.rb +17 -0
- data/lib/social_pilot/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 233ccf3f5772d32d01e0daba5d1f3c7a71842d76
|
4
|
+
data.tar.gz: 45c88571c03032a730ffc749faabae5770c34e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ae58fabfc940be761e16abd36d8b9fbbecc7cd573f20bff3ee35758923e65ee7e01acf6482cf618f63df4d3a733f8f9376aafe9bdbb98132dad7765926a437e
|
7
|
+
data.tar.gz: 9bded967a0c6343f357cb9589cad770b1b98385a93283e0137e7588c2584065a7794b416f1a5dec928aa2cac0289f1afe422756140dc0d9161edcbf97772bffa
|
data/lib/social_pilot.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rest-client'
|
2
2
|
|
3
3
|
require 'social_pilot/account'
|
4
|
+
require 'social_pilot/post'
|
4
5
|
|
5
6
|
|
6
7
|
module SocialPilot
|
@@ -25,6 +26,8 @@ module SocialPilot
|
|
25
26
|
|
26
27
|
params.merge!({access_token: vd_access_token})
|
27
28
|
|
29
|
+
|
30
|
+
|
28
31
|
defined? vd_access_token or raise(
|
29
32
|
ConfigurationError, "SocialPilot access token not configured"
|
30
33
|
)
|
@@ -34,19 +37,12 @@ module SocialPilot
|
|
34
37
|
defined? resource or raise(
|
35
38
|
ArgumentError, "Request resource has not been specified"
|
36
39
|
)
|
37
|
-
|
38
|
-
|
39
|
-
headers = { :accept => :json, content_type: :json }.merge({params: params})
|
40
|
-
payload = nil
|
41
|
-
else
|
42
|
-
headers = { :accept => :json, content_type: :json }
|
43
|
-
payload = params
|
44
|
-
end
|
40
|
+
|
41
|
+
headers = { :accept => :json, content_type: :json }.merge({params: params})
|
45
42
|
|
46
43
|
RestClient::Request.new({
|
47
44
|
method: method,
|
48
45
|
url: API_BASE + resource,
|
49
|
-
payload: payload ? payload.to_json : nil,
|
50
46
|
headers: headers
|
51
47
|
}).execute do |response, request, result|
|
52
48
|
str_response = response.to_str
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SocialPilot
|
2
|
+
class Post
|
3
|
+
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def update params={}
|
7
|
+
response = SocialPilot.request(:post, 'post/update', params)
|
8
|
+
return response
|
9
|
+
end
|
10
|
+
|
11
|
+
def update_with_image params={}
|
12
|
+
response = SocialPilot.request(:post, 'post/updatewithimage', params)
|
13
|
+
return response
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/social_pilot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_pilot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Dallimore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- Rakefile
|
35
35
|
- lib/social_pilot.rb
|
36
36
|
- lib/social_pilot/account.rb
|
37
|
+
- lib/social_pilot/post.rb
|
37
38
|
- lib/social_pilot/version.rb
|
38
39
|
- lib/tasks/social_pilot_tasks.rake
|
39
40
|
- test/dummy/Gemfile
|