twitter2vk 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +6 -1
- data/README.markdown +10 -8
- data/bin/twitter2vk +8 -3
- metadata +3 -3
data/ChangeLog
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
== 0.1.2 (Лаваш)
|
2
|
+
* Fix installer: expand all paths in config.
|
3
|
+
* Fix json dependency in responser gem.
|
4
|
+
* Add #vk to include in installer by default.
|
5
|
+
|
1
6
|
== 0.1.1 (Лапша)
|
2
7
|
* Fix reply regexp in default exclude.
|
3
8
|
* Fix cron time format.
|
4
|
-
* Don
|
9
|
+
* Don’t delete exists crontab on add new task.
|
5
10
|
* Fix gem dependencies.
|
6
11
|
|
7
12
|
== 0.1 (Сервелат)
|
data/README.markdown
CHANGED
@@ -7,7 +7,8 @@ separated package CLI tool to create config and add cron task.
|
|
7
7
|
Warning: config contain session ID for VK, which can be used to get full access.
|
8
8
|
Make sure that outsiders don’t have access to this file.
|
9
9
|
|
10
|
-
By default, reply and statuses with #novk willn’t be reposted to VK
|
10
|
+
By default, reply and statuses with #novk willn’t be reposted to VK (but you may
|
11
|
+
use #vk to repost any status).
|
11
12
|
|
12
13
|
You may install on server only twitter2vk_reposter package and create config
|
13
14
|
on home computer (don’t remember to add cron task). Or you can uninstall
|
@@ -18,15 +19,15 @@ You can follow author @andrey_sitnik to receive last updates info.
|
|
18
19
|
### Install
|
19
20
|
1. Install Ruby and Rubygems. For example, on Ubuntu:
|
20
21
|
|
21
|
-
|
22
|
+
sudo apt-get install rubygems
|
22
23
|
|
23
24
|
2. Install twitter2vk gem:
|
24
25
|
|
25
|
-
|
26
|
+
sudo gem install twitter2vk
|
26
27
|
|
27
28
|
3. Run master to create config and add crom task:
|
28
29
|
|
29
|
-
|
30
|
+
twitter2vk
|
30
31
|
|
31
32
|
### Config
|
32
33
|
Config is a YAML files with options:
|
@@ -46,7 +47,8 @@ Config is a YAML files with options:
|
|
46
47
|
Внимание: настройки содержат ID сессии во В Контакте, с помощью которого можно
|
47
48
|
получить полный доступ. Убедитесь, что посторонние не имеют к файлу доступ.
|
48
49
|
|
49
|
-
По умолчанию, ответы и статусы с #novk не будут публиковаться во В
|
50
|
+
По умолчанию, ответы и статусы с #novk не будут публиковаться во В Контакте (но
|
51
|
+
можно использовать #vk для перепубликации любого статуса).
|
50
52
|
|
51
53
|
Вы можете установить на сервер только пакет twitter2vk_reposter и создать
|
52
54
|
настройки на домашнем компьютере (не забудьте добавить задание cron). Или можете
|
@@ -58,15 +60,15 @@ Config is a YAML files with options:
|
|
58
60
|
### Установка
|
59
61
|
1. Установите Ruby и Rubygems. Например, для Ubuntu:
|
60
62
|
|
61
|
-
|
63
|
+
sudo apt-get install rubygems
|
62
64
|
|
63
65
|
2. Установите gem twitter2vk:
|
64
66
|
|
65
|
-
|
67
|
+
sudo gem install twitter2vk
|
66
68
|
|
67
69
|
3. Запустите мастер, чтобы создать настройки и добавить задание к cron:
|
68
70
|
|
69
|
-
|
71
|
+
twitter2vk
|
70
72
|
|
71
73
|
### Настройки
|
72
74
|
Настройки хранятся в YAML файле с полями:
|
data/bin/twitter2vk
CHANGED
@@ -40,7 +40,7 @@ config['vk_session'] = resource.body.match(/value='([a-z0-9]+)'/)[1]
|
|
40
40
|
config['twitter'] = ask(i18n.twitter)
|
41
41
|
|
42
42
|
config['exclude'] = ['#novk', /^@\w/]
|
43
|
-
config['include'] =
|
43
|
+
config['include'] = ['#vk']
|
44
44
|
|
45
45
|
path = ask(i18n.config) { |q| q.default = "./#{config['twitter']}.yml" }
|
46
46
|
path = File.expand_path(path)
|
@@ -48,17 +48,22 @@ path = File.expand_path(path)
|
|
48
48
|
config['last_message'] = ask(i18n.last_message) do |q|
|
49
49
|
q.default = "./#{config['twitter']}_last_message"
|
50
50
|
end
|
51
|
+
config['last_message'] = File.expand_path(config['last_message'])
|
51
52
|
|
52
53
|
File.open(path, 'w') { |io| io << config.to_yaml }
|
53
54
|
FileUtils.chmod 0700, path
|
54
55
|
|
55
56
|
period = ask(i18n.period) { |q| q.default = 5 }
|
56
57
|
|
57
|
-
task = "*/#{period} *
|
58
|
+
task = "*/#{period} * * * * twitter2vk_reposter #{path}"
|
58
59
|
|
59
60
|
if agree(i18n.cron) { |q| q.default = 'yes' }
|
60
61
|
tasks = `crontab -l`
|
61
|
-
|
62
|
+
if tasks.empty?
|
63
|
+
tasks << "# m h dom mon dow command\n"
|
64
|
+
elsif tasks[-1..-1] != "\n"
|
65
|
+
tasks << "\n"
|
66
|
+
end
|
62
67
|
tasks << task
|
63
68
|
`echo '#{tasks}' | crontab -`
|
64
69
|
say i18n.success.cron
|
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.
|
4
|
+
version: 0.1.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-
|
12
|
+
date: 2009-10-11 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.
|
23
|
+
version: 0.1.2
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|