okpublished 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/okpublished/base.rb +5 -5
- data/lib/okpublished/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf7f6bf2f25b6805b4c46a107c08266e674a2654
|
4
|
+
data.tar.gz: 9ea54637025b5f786b0379a3e06e0a13b941d219
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 017d8a784b72e9bd58c439c1b5a28f6f596685d35c6b5447ff046208ca6e6dcbccd0f526f8f862e642251c66fc11defa1cc32cbf43b151dc72a338cbce4461c9
|
7
|
+
data.tar.gz: 746321f84978085554157a5fa81ab1a8af0c87b1b6cb52785212ba5d57dcb823f703afe8a48f80106c324244bc753cb1aad4471d9347c441b7424903e6e49cfc
|
data/lib/okpublished/base.rb
CHANGED
@@ -8,22 +8,22 @@ module Okpublished
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def publicate_facebook(text)
|
11
|
-
graph = Koala::Facebook::
|
11
|
+
graph = Koala::Facebook::API.new(@config[:facebook][:access_token])
|
12
12
|
page_token = graph.get_page_access_token(@config[:facebook][:page_id])
|
13
13
|
|
14
|
-
page = Koala::Facebook::API.new(page_token)
|
15
|
-
page.put_picture(File.new("/tmp/image.jpg"), { :message => text})
|
14
|
+
@page = Koala::Facebook::API.new(page_token)
|
15
|
+
@page.put_picture(File.new("/tmp/image.jpg"), { :message => text})
|
16
16
|
end
|
17
17
|
|
18
18
|
def publicate_twitter(text)
|
19
|
-
client = Twitter::REST::Client.new do |config|
|
19
|
+
@client = Twitter::REST::Client.new do |config|
|
20
20
|
config.consumer_key = @config[:twitter][:consumer_key]
|
21
21
|
config.consumer_secret = @config[:twitter][:consumer_secret]
|
22
22
|
config.access_token = @config[:twitter][:access_token]
|
23
23
|
config.access_token_secret = @config[:twitter][:access_token_secret]
|
24
24
|
end
|
25
25
|
|
26
|
-
client.update_with_media("#{text}", File.new("/tmp/image.jpg"))
|
26
|
+
@client.update_with_media("#{text}", File.new("/tmp/image.jpg"))
|
27
27
|
end
|
28
28
|
|
29
29
|
def url_to_file(url)
|
data/lib/okpublished/version.rb
CHANGED