social_poster 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/social_poster.rb +2 -2
- data/lib/social_poster/poster/vkontakte.rb +3 -2
- data/lib/social_poster/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -63,6 +63,10 @@ SocialPoster.write(:vk, 'Something that will appear on your Vkontakte Wall...')
|
|
63
63
|
SocialPoster.write(:twitter, 'Tweet tweet tweet')
|
64
64
|
SocialPoster.write(:lj, 'A long text of the post...', 'A short title of it')
|
65
65
|
```
|
66
|
+
For Vkontakte API there is a possibility of providing additional options. For instance, for posting on a group wall use this example:
|
67
|
+
```ruby
|
68
|
+
SocialPoster.write(:vk, 'Text on the Group Wall...', nil, owner_id: '-GROUP_ID')
|
69
|
+
```
|
66
70
|
|
67
71
|
|
68
72
|
Contribute
|
data/lib/social_poster.rb
CHANGED
@@ -41,12 +41,12 @@ module SocialPoster
|
|
41
41
|
@@twitter = value
|
42
42
|
end
|
43
43
|
|
44
|
-
def self.write(network, text, title = '')
|
44
|
+
def self.write(network, text, title = '', options = {})
|
45
45
|
site = case network.to_sym
|
46
46
|
when :fb
|
47
47
|
site = Poster::Facebook.new
|
48
48
|
when :vk
|
49
|
-
site = Poster::Vkontakte.new
|
49
|
+
site = Poster::Vkontakte.new(options)
|
50
50
|
when :twitter
|
51
51
|
site = Poster::Twitter.new
|
52
52
|
when :lj
|
@@ -6,12 +6,13 @@ module SocialPoster
|
|
6
6
|
class Vkontakte
|
7
7
|
include SocialPoster::Helper
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(options)
|
10
|
+
@options = options
|
10
11
|
@app = VK::Application.new(access_token: (config_key :access_token))
|
11
12
|
end
|
12
13
|
|
13
14
|
def write(text, title)
|
14
|
-
@app.wall.post(message: text)
|
15
|
+
@app.wall.post({message: text}.merge(@options))
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_poster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|