FelisCatus / switchysharp

Automatically exported from code.google.com/p/switchysharp
GNU General Public License v3.0
140 stars 50 forks source link

可不可以通过一个txt列表,批量导入情景模式 #1019

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
我有一个txt文本,里面有很多ip和端口以及他们所在地(每个
一行),我想批量导入到情景模式去。这个应该有办法把

Original issue reported on code.google.com by ilikaxi on 30 Sep 2014 at 9:06

Attachments:

GoogleCodeExporter commented 9 years ago
见 Issue 887. 
这个估计不会正式添加支持,不过可以先用脚本折腾。

Original comment by shyc2...@gmail.com on 30 Sep 2014 at 9:09

GoogleCodeExporter commented 9 years ago
看不懂,是贴代码吗。具体该怎么做

Original comment by ilikaxi on 30 Sep 2014 at 9:32

GoogleCodeExporter commented 9 years ago
不懂英语语法啊,软件翻译的都很混乱。麻烦用中文的教教

Original comment by ilikaxi on 30 Sep 2014 at 9:37

GoogleCodeExporter commented 9 years ago
你好,我看了看代码会用了。但是我想把每行ip的地区名字来
命名每个情景模式的名字这该怎么办?
比如:127.0.0.1:5678 美国、127.0.0.1:5678 日本

Original comment by ilikaxi on 1 Oct 2014 at 3:29

GoogleCodeExporter commented 9 years ago
Issue 1020 has been merged into this issue.

Original comment by shyc2...@gmail.com on 1 Oct 2014 at 5:06

GoogleCodeExporter commented 9 years ago
格式说明(注意分号和空格):

127.0.0.1:1234 名称; 127.0.0.1:2345 名称

代码:
(function(Settings){var p = Settings.getObject('profiles'); var t = 
p['template']; window.prompt().split(';').forEach(function(spec) { spec = 
spec.split(/\s+/); p[spec[1]]=jQuery.extend({}, t, 
{id:spec[1],name:spec[1],proxyHttp:spec[0]}); }); 
Settings.setObject('profiles', p); history.go(0) 
})(chrome.extension.getBackgroundPage().Settings)

Original comment by shyc2...@gmail.com on 1 Oct 2014 at 5:10

GoogleCodeExporter commented 9 years ago
代码好像不行,前面第一个ip端口可以成功给情景模式命名,
后面的不行

210.101.131.231:8080 韩国; 183.207.229.10:80 江苏省; 183.207.224.19:80 
江苏; 211.151.57.76:8081 北京市世纪互联

Original comment by ilikaxi on 1 Oct 2014 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ilikaxi on 1 Oct 2014 at 6:25

Attachments:

GoogleCodeExporter commented 9 years ago
忘记空格了……

(function(Settings){var p = Settings.getObject('profiles'); var t = 
p['template']; window.prompt().split(';').forEach(function(spec) { spec = 
spec.trim().split(/\s+/); p[spec[1]]=jQuery.extend({}, t, 
{id:spec[1],name:spec[1],proxyHttp:spec[0]}); }); 
Settings.setObject('profiles', p); history.go(0) 
})(chrome.extension.getBackgroundPage().Settings)

Original comment by shyc2...@gmail.com on 1 Oct 2014 at 6:26

GoogleCodeExporter commented 9 years ago
行了,万分感谢。你厉害哇

Original comment by ilikaxi on 1 Oct 2014 at 6:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
再次 谢谢!!!

Original comment by ilikaxi on 1 Oct 2014 at 6:36

GoogleCodeExporter commented 9 years ago
抱歉,还有个问题。如果我想批量删除情景模式列表,该怎��
�做?只留下下面图片3个列表

Original comment by ilikaxi on 1 Oct 2014 at 6:43

Attachments:

GoogleCodeExporter commented 9 years ago
该运行什么代码

Original comment by ilikaxi on 1 Oct 2014 at 6:44

GoogleCodeExporter commented 9 years ago
批量删除请导入之前的备份文件(有备份过吧?),或重置��
�项。

Original comment by shyc2...@gmail.com on 1 Oct 2014 at 10:11

GoogleCodeExporter commented 9 years ago
嗯,谢谢

Original comment by ilikaxi on 2 Oct 2014 at 1:33