twitter2vk 0.1.2 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/ChangeLog +5 -0
  2. data/README.markdown +21 -11
  3. data/bin/twitter2vk +12 -2
  4. metadata +3 -3
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2 (Желе)
2
+ * Add format to config to change reposted status view.
3
+ * Add replace to config to change reposted status text.
4
+ * Fix installer: expand path to reposter.
5
+
1
6
  == 0.1.2 (Лаваш)
2
7
  * Fix installer: expand all paths in config.
3
8
  * Fix json dependency in responser gem.
data/README.markdown CHANGED
@@ -32,11 +32,16 @@ You can follow author @andrey_sitnik to receive last updates info.
32
32
  ### Config
33
33
  Config is a YAML files with options:
34
34
 
35
- * vk_session – session ID to access to VK.
36
- * twitter – your Twitter login.
37
- * exclude – list of text or regexp patterns to exclude statuses from your VK.
38
- * include list of text or regexp patterns to repost excluded statuses.
39
- * last_messagefile to contain ID of last reposted message.
35
+ * `vk_session` – session ID to access to VK.
36
+ * `twitter` – your Twitter login.
37
+ * `exclude` – list of text or regexp patterns to exclude statuses from your VK.
38
+ Code `:reply` will exclude your replies to another Twitter users.
39
+ * `include`list of text or regexp patterns to repost excluded statuses.
40
+ * `format` – format reposted status. `%status%` will be replaced by status text,
41
+ `%url%` by status link on Twitter.
42
+ * `replace` – list of array with 2 elements to replace text in status. Code
43
+ `:user_to_url` will replace user name to his Twitter link.
44
+ * `last_message` – file to contain ID of last reposted message.
40
45
 
41
46
  ## Russian
42
47
 
@@ -73,9 +78,14 @@ Config is a YAML files with options:
73
78
  ### Настройки
74
79
  Настройки хранятся в YAML файле с полями:
75
80
 
76
- * vk_session – ID сессии для доступка к В Контакте.
77
- * twitter — логин от вашего Twitter’а.
78
- * exclude — список слов или regexp’ов для статусов, которые не нужно публиковать
79
- во В Контакте.
80
- * include — список слов или regexp’ов для отмены exclude.
81
- * last_messageфайл, чтобы хранить ID последнего полученного сообщения.
81
+ * `vk_session` – ID сессии для доступка к В Контакте.
82
+ * `twitter` — логин от вашего Twitter’а.
83
+ * `exclude` — список слов или regexp’ов статусов, которые не нужно публиковать
84
+ во В Контакте. Код `:reply` исключ ваши ответы другим пользователя
85
+ Twitter.
86
+ * `include`список слов или regexp’ов для отмены exclude.
87
+ * `format` — вид статуса во В Контакте. `%status%` будет заменен на текст
88
+ статуса, `%url%` — на ссылку на статус в Twitter’е.
89
+ * `replace` — список массивов из двух элементов для замены текста в статусе. Код
90
+ `:user_to_url` заменит имена пользователей на ссылку на их Twitter.
91
+ * `last_message` — файл, чтобы хранить ID последнего полученного сообщения.
data/bin/twitter2vk CHANGED
@@ -39,8 +39,10 @@ end
39
39
  config['vk_session'] = resource.body.match(/value='([a-z0-9]+)'/)[1]
40
40
  config['twitter'] = ask(i18n.twitter)
41
41
 
42
- config['exclude'] = ['#novk', /^@\w/]
42
+ config['exclude'] = ['#novk', :reply]
43
43
  config['include'] = ['#vk']
44
+ config['format'] = '%status%'
45
+ config['replace'] = []
44
46
 
45
47
  path = ask(i18n.config) { |q| q.default = "./#{config['twitter']}.yml" }
46
48
  path = File.expand_path(path)
@@ -55,7 +57,15 @@ FileUtils.chmod 0700, path
55
57
 
56
58
  period = ask(i18n.period) { |q| q.default = 5 }
57
59
 
58
- task = "*/#{period} * * * * twitter2vk_reposter #{path}"
60
+ reposter = if File.expand_path(__FILE__).start_with? Gem.dir
61
+ File.join(Gem.bindir, 'twitter2vk_reposter')
62
+ elsif File.exists? File.join(File.dirname(__FILE__), 'twitter2vk_reposter')
63
+ File.expand_path File.join(File.dirname(__FILE__), 'twitter2vk_reposter.rb')
64
+ else
65
+ 'twitter2vk_reposter'
66
+ end
67
+
68
+ task = "*/#{period} * * * * #{reposter} #{path}"
59
69
 
60
70
  if agree(i18n.cron) { |q| q.default = 'yes' }
61
71
  tasks = `crontab -l`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter2vk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: "0.2"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "A.I." Sitnik
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-11 00:00:00 +04:00
12
+ date: 2009-10-13 00:00:00 +04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.1.2
23
+ version: "0.2"
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: highline