twitter2vk_reposter 0.2 → 0.2.1

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.
Files changed (3) hide show
  1. data/ChangeLog +3 -0
  2. data/bin/twitter2vk_reposter +5 -2
  3. metadata +11 -1
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.2.1 (Оливье)
2
+ * Fix UTF-8 support.
3
+
1
4
  == 0.2 (Желе)
2
5
  * Add format to config to change reposted status view.
3
6
  * Add replace to config to change reposted status text.
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Check new Twitter statuses and repost it to VK.
3
3
 
4
+ $KCODE = 'u'
5
+
4
6
  require 'rubygems'
5
7
  require 'json'
8
+ require 'activesupport'
6
9
 
7
10
  require 'yaml'
8
11
  require 'open-uri'
@@ -53,8 +56,9 @@ def format_status(status, config)
53
56
  text.gsub!(replace[0], replace[1])
54
57
  end
55
58
 
59
+ text = text.mb_chars
56
60
  text = text[0...159] + '…' if text.length > 160
57
- text
61
+ text.to_s
58
62
  end
59
63
 
60
64
  def set_status_to_vk(text, session, activityhash)
@@ -77,7 +81,6 @@ request = open('http://twitter.com/statuses/user_timeline/' +
77
81
  "#{config['twitter']}.json?#{query}")
78
82
  statuses = JSON.parse(request.read.to_s)
79
83
 
80
- statuses.delete statuses.last
81
84
  unless statuses.empty?
82
85
  activityhash = load_vk_activityhash(config['vk_session'])
83
86
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter2vk_reposter
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.2"
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "A.I." Sitnik
@@ -12,6 +12,16 @@ cert_chain: []
12
12
  date: 2009-10-13 00:00:00 +04:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: json
17
27
  type: :runtime