vbs飞信免费发短信接口
vbscript吧
全部回复
仅看楼主
level 9
H_氢 楼主
'By mady(我是企鹅)
Dim LoginUrl,homeUrl,url,msg,logstate
phoneNum="" '手机号
pass="" '密码
loginstatus="1" '在线
msg="已登录!" '信息内容
homeUrl="http://f.10086.cn/im/index/indexcenter.action "
LoginUrl="http://f.10086.cn/im/login/inputpasssubmit1.action?loginstatus= "& loginstatus &"&pass="& pass &"&m="& honeNum
url="http://f.10086.cn/im/user/sendMsgToMyselfs.action?msg= "& msg
Dim xmlhttp,xmlresult
Set xmlhttp=createobject("microsoft.xmlhttp")
if not sendMMStoMyself() then
if login() then
if not sendMMStoMyself() then
msgbox "发送失败"
else
msgbox "发送成功"
end if
else
msgbox "登录失败"
end if
else
msgbox "发送成功"
end if
function getData(f,url,t)
If f="" Then f="post"
xmlhttp.open f,url,t
xmlhttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded;charset=gb2312"
xmlhttp.setRequestHeader "cache-control","no-cache"
xmlhttp.send()
If t Then
xmlhttp.onreadystatechange=GetRef("xmltb")
Else
getData=xmlhttp.responseText
End If
end Function
function xmltb()
If xmlhttp.readyState=4 Or xmlhttp.readyState="complete" then
If xmlhttp.status=200 Then
xmlresult=xmlhttp.responseText
Else
xmlresult="error contenting to server"
End If
End If
End Function
function sendMMStoMyself()
sendMMStoMyself=false
xmlresult=getData("",url,false)
if instr(xmlresult,"发送成功")>0 Then
sendMMStoMyself=true
end if
end function
function login()
login=false
logstate=false
xmlresult=getData("",loginUrl,false)
if instr(xmlresult,"您正在登录")>0 Then
login=true
logstate=true
end if
end function
function getfriend()
dim f,p,tempval,temparr
if not logstate then login()
xmlresult=getData("",homeUrl,false)
end function
'希望大家能够完善其功能
2014年08月01日 14点08分 1
level 9
H_氢 楼主
上面的代码只要填上手机号跟密码就可以给自己发送信息了。但是只限于开通了飞信的用户给自己发送信息,给好友发信息等功能没写。希望有时间的朋友完善它。
@black_mady 这是他的帖子
2014年08月01日 14点08分 2
level 9
H_氢 楼主
改后的: 给您修改了下。。。
num="" '开通飞信的手机号
pwd="" '飞信密码
msg=InputBox("请输如要发送的内容:","发送短信","测试")
dm="http://f.10086.cn/im/ "
post dm&"login/inputpasssubmit1.action","&pass="&pwd&"&m="&num
WScript.Sleep 500
If Instr(post(dm&"user/sendMsgToMyselfs.action","msg="&msg),"成功") Then
MsgBox "发送成功!"
Else
MsgBox "发送失败!"
End If
Function post(url,dat)
With CreateObject("Microsoft.XMLHTTP")
.Open "POST",url,False
.SetRequestHeader "content-type","application/x-www-form-urlencoded;charset=utf-8"
.Send dat
post=.ResponseText
End With
End Function
2014年08月01日 14点08分 3
1