“飞信机器人/命令行参数”的版本间的差异

来自Blueidea
跳转至: 导航搜索
举例
第71行: 第71行:
  
 
== 举例 ==
 
== 举例 ==
  fetion --mobile=135xxxxxxxx --pwd=mypwd --to=137xxxxxxxx --msg-gb=测试
+
  fetion --mobile=135xxxxxxxx --pwd=mypwd --to=137xxxxxxxx --msg-gb=测试 --msg-type=2
 
向137xxxxxxxx 手机发送内容为“测试”的短信,机器人手机号是135xxxxxxxx
 
向137xxxxxxxx 手机发送内容为“测试”的短信,机器人手机号是135xxxxxxxx
  
  fetion --sid=66xxxx --pwd=mypwd --to=137xxxxxxxx --msg-gb=测试
+
  fetion --sid=66xxxx --pwd=mypwd --to=137xxxxxxxx --msg-gb=测试 --msg-type=2
 
向137xxxxxxxx 手机发送内容为“测试”的短信,机器人飞信号是66xxxx
 
向137xxxxxxxx 手机发送内容为“测试”的短信,机器人飞信号是66xxxx
  
  fetion --config=sample.conf --index=1 --to=137xxxxxxxx --msg-gb=测试
+
  fetion --config=sample.conf --index=1 --to=137xxxxxxxx --msg-gb=测试 --msg-type=2
 
向137xxxxxxxx 手机发送内容为“测试”的短信,机器人是sample.conf 文件中排1的帐号
 
向137xxxxxxxx 手机发送内容为“测试”的短信,机器人是sample.conf 文件中排1的帐号
  
  fetion --sid=66xxxx --pwd=mypwd --to=137xxxxxxxx,136xxxxx,138xxxxx --msg-gb=测试
+
  fetion --sid=66xxxx --pwd=mypwd --to=137xxxxxxxx,136xxxxx,138xxxxx --msg-gb=测试 --msg-type=2
 
向137xxxxxxxx,136xxxxx,138xxxxx 手机发送内容为“测试”的短信,机器人飞信号是66xxxx
 
向137xxxxxxxx,136xxxxx,138xxxxx 手机发送内容为“测试”的短信,机器人飞信号是66xxxx
 
 

2009-08-04T10:56:40的版本

飞信机器人的启动有如下的参数,以WIN32版本为例:

Version:[20090406003-win32]

参数 说明
--mobile=[mobile] 手机号
--sid=[sid] 飞信号
--pwd=[pwd] 密码
--config=[file] 配置手机号、密码的文件。[1]
--index=[ID] 在配置文件中的ID号
--debug 记录日志到日志目录
--hide 隐身登录
--to=[mobile/sid/URI] 把信息发送给手机号/飞信号/URI[2] 支持多个号码,中间用半角逗号分隔
--add=[uri] 添加好友信息发送给URI地址,通常用来加自家机器人
--command-path=[path] 命令池文件夹路径[3]
--robotmode 机器人优化模式[4]
--daemon 守护模式(仅支持linux)
--proxy-ip http代理IP
--proxy-port http代理端口
--msg-gb=[message] gb2312/gbk编码的信息内容
--msg-utf8=[message] UTF8编码的信息内容
--msg-type=[0/1/2] 信息类型[5]
--file-gb=[file] gb2312/gbk 文件
--file-utf8=[file] UTF8文件
--query-cmcc-no 查询移动公司手机段,检查手机号是否合法
--testaccount 测试帐号[6]
--auto-retry 自动重连功能[7]
--get-web-session 取得websession值,可取飞信头像。
--action=[getpiccode/appsubscribe/subscribe/updatepwd] 取得验证码/验证/注册飞信/更新密码

注释说明

  1. 配置格式:ID Mobile Password
  2. 如果知道对方URI,则只需自己在对方好友列表,无需对方在自己好友列表就能发送。
  3. 配置此参数后,还应该修改机器人框架里的命令路径
  4. 为了加快机器人的启动,避免加载好友列表信息时间太长,通常第一次启动不用这个模式,以同步好友列表,第二次启动才加这个参数
  5. 0:手机短信、1:长短信、2:智能短信(智能判断长短信,并且如果飞信不在线,则发手机短信)
  6. 测试用户名密码是否正确,直接返回xml,也可用于手机号码或者飞信号码的反查
  7. 默认,飞信断线后是自动退出,加入这个命令后,会重新连接

以下为特殊启动参数,可以用于 web网站集成注册、修改密码

--action=getpiccode --mobile=13910000000 --pwd=任意 (--piccode-url=[url])  返回图形验证码,base64解码后,就是图形验证码图片 
--action=appsubscribe --mobile=[注册手机号] --pwd=[任意] --pic-certificate-id=[certid] --pic-cert-code=[certcode] --apply-sub-service-url=[url] 提交验证码ID,图形识别码,手机号
--action=subscribe --mobile=[注册手机号] --pwd=[密码] --sms-code=[短信验证码] --subscribe-url=[url]
--action=updatepwd --mobile=[修改密码的手机号] --pwd=[新密码] --sms-code=[短信验证码] --update-pwd-url=[url]


举例

fetion --mobile=135xxxxxxxx --pwd=mypwd --to=137xxxxxxxx --msg-gb=测试 --msg-type=2

向137xxxxxxxx 手机发送内容为“测试”的短信,机器人手机号是135xxxxxxxx

fetion --sid=66xxxx --pwd=mypwd --to=137xxxxxxxx --msg-gb=测试 --msg-type=2

向137xxxxxxxx 手机发送内容为“测试”的短信,机器人飞信号是66xxxx

fetion --config=sample.conf --index=1 --to=137xxxxxxxx --msg-gb=测试 --msg-type=2

向137xxxxxxxx 手机发送内容为“测试”的短信,机器人是sample.conf 文件中排1的帐号

fetion --sid=66xxxx --pwd=mypwd --to=137xxxxxxxx,136xxxxx,138xxxxx --msg-gb=测试 --msg-type=2

向137xxxxxxxx,136xxxxx,138xxxxx 手机发送内容为“测试”的短信,机器人飞信号是66xxxx

发送消息中如果需要换行,请用 \n

// 以下为 sample.conf 内容,文件内容中, #号为注释行 
# This config file is for fetion robot tool.
#	Usage demo: ./fetion --config=/etc/fetion.conf --index=1

# ID	Mobile		Password
1	137xxxx		1234234