okpublished 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/okpublished/base.rb +6 -7
- 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: 3fc10e29a7649168681b216c095a423e3bdf88e2
|
4
|
+
data.tar.gz: 9c36a828e3708d3a987de6a640efa84c78f3a408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48b74af37ffc38a9d1cae053cb3f248b87ee89b8ae41537ce454b392f4bba8d470ec7bc18f60d2d4e52c8157bae4ceec56aec3b5263e4e4c6bfe250fbeb6dfc9
|
7
|
+
data.tar.gz: 332159d6ded103b5539cf4221aa6d84d042ae465e03605fcecf91675d1c87db6bb0484207794762aaf7ea15d194af1428fa27d255a0d28f68473d8b62149e152
|
data/lib/okpublished/base.rb
CHANGED
@@ -7,15 +7,11 @@ module Okpublished
|
|
7
7
|
@config = config
|
8
8
|
end
|
9
9
|
|
10
|
-
def publicate_facebook(text, image
|
10
|
+
def publicate_facebook(text, image)
|
11
11
|
url_to_file(image)
|
12
12
|
graph = Koala::Facebook::API.new(@config[:facebook][:access_token])
|
13
13
|
page_token = graph.get_page_access_token(@config[:facebook][:page_id])
|
14
14
|
|
15
|
-
if debug
|
16
|
-
puts "#{text} - #{image}"
|
17
|
-
end
|
18
|
-
|
19
15
|
@page = Koala::Facebook::API.new(page_token)
|
20
16
|
@page.put_picture(File.new("/tmp/image.jpg"), { :message => text})
|
21
17
|
end
|
@@ -47,8 +43,11 @@ module Okpublished
|
|
47
43
|
end
|
48
44
|
|
49
45
|
|
50
|
-
def publicate(text, image)
|
51
|
-
|
46
|
+
def publicate(text, image,debug=false)
|
47
|
+
if debug
|
48
|
+
puts "#{text} - #{image}"
|
49
|
+
end
|
50
|
+
|
52
51
|
if validate_facebook?
|
53
52
|
publicate_facebook(text, image)
|
54
53
|
end
|
data/lib/okpublished/version.rb
CHANGED