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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 755158e3b3af0b68d0c65207624ab43b5ac84796
4
- data.tar.gz: 448e5b8b402e719524535796113d106b60d97e89
3
+ metadata.gz: 233ccf3f5772d32d01e0daba5d1f3c7a71842d76
4
+ data.tar.gz: 45c88571c03032a730ffc749faabae5770c34e74
5
5
  SHA512:
6
- metadata.gz: f2116cb1a96b2006e543f1645321fb40c2354e5384b17e569e1315b39f23e6391756824b4b04a315caffbd74ea01bca8654f0b62ba1ebb9a5af505a8c1bd0eef
7
- data.tar.gz: bebaba4e30b8cb533bc2d3616b4629f46ce7d6f675eae6bb74d3a89411e03b612cbf2d91f8fbb216d1a12dc45992395fbe26b6298fb96a5af63383391aaa1871
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
- if method == :get
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
@@ -1,3 +1,3 @@
1
1
  module SocialPilot
2
- VERSION = "0.1.2"
2
+ VERSION = "0.3.2"
3
3
  end
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.1.2
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-17 00:00:00.000000000 Z
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