Dim objIE0,sIe Dim s,u(4000),nn(4000),e(99) e(0)="議員" e(1)="女" e(2)="アイドル" e(3)="鬼六"
Set Fs = WScript.CreateObject("Scripting.FileSystemObject") Set rankHtm = Fs.OpenTextFile("twittCeleb.htm",1) Set objIEx = CreateObject("InternetExplorer.application")
sLine = rankHtm.ReadLine '1行読み込む if instr(sLine,"http://twitter.com/")>0 then nn(num)=sLine u(num)=strmid(sLine,"href=""http://twitter.com/","""") num=num+1
loop Set xml = CreateObject("MSXML2.XMLHTTP") tUsername = "" 'Range("tusername") tPassword = "" 'Range("tpasswd") for i=0 to num-1 skip=false for j=0 to 3 'uboud(e) if instr(nn(i),e(j))>0 then skip=true exit for end if next objIEx.Document.Write i & ":" & u(i) if skip=false then xml.Open "POST", "http://api.twitter.com/1/friendships/destroy/" & u(i) & ".xml", "false", tUsername, tPassword xml.setRequestHeader "Content-Type", "content=text/html; charset=unicode" 'shift-jis" xml.send tResult = xml.responsetext 'you can view Twitter’s response in debug window objIEx.Document.Write " destroy" else objIEx.Document.Write " skip" end if objIEx.Document.Write "<br>" next Set xml = Nothing Function strmid(org,mae,usiro) pos = InStr(org, mae) If pos > 0 Then strmid = Right(org, Len(org) - pos - Len(mae) + 1) org = strmid pos = InStr(strmid, usiro) If usiro = "" Then ' strmid = "" Else If pos > 0 Then strmid = Left(strmid, pos - 1) End If End If Else strmid = "" End If End Function