有名人の一覧htmlに従い順に自動フォローします 一覧htmlはhttp://www9.atpages.jp/issosakura/twittCeleb.htmです または同じ形式のものに作成とかしてください 下記vbsと同じフォルダに上記htmlをtwittCeleb.htmの名前で置いてください Dim objIE0,sIe Dim s,u(4000),nn(4000) 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 objIEx.Document.Write i & ":" & u(i) if skip=false then xml.Open "POST", "http://api.twitter.com/1/friendships/create/" & 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 " create" else objIEx.Document.Write " skip" end if objIEx.Document.Write "<br>" next Set xml = Nothing rankHtm.Close 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 Sub waitPage (objIE) Do While objIE.busy Loop Do While objIE.Document.readyState <> "complete" Loop End Sub