Hadez Posted December 17, 2010 Share Posted December 17, 2010 Im trying to read a shoutbox in real time on a website. It will read each line and then if it sees a string within that line, it will respond. I used: $sUrl = "http://site.com" $oIE = _IECreate($sUrl) $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) $oForm = _IEFormGetCollection($oIE, 1) $oShoutbox = _IEGetObjByName($oForm, 'shoutbox_form') $sText = _IEBodyReadText($oShoutbox) filewrite(@scriptdir & "\write.txt", $sText) $shoutstring = fileread(@scriptdir & "\write.txt") _Main() Func _Main() Local $aArray1 = _StringBetween($shoutstring, ">>>>>>", "<<<<<<") ;_ArrayDisplay($aArray1, 'Default Search') ;$aArray1[0] = StringReplace($aArray1[0], @CRLF & @CRLF, @CRLF) $aArray1[0] = StringStripWS($aArray1[0], 3) filewrite(@scriptdir & "\filewrite.txt",$aArray1[0]) EndFunc ;==>_Main This gets the correct section for the shoutbox, but i dont know how to only write new lines to the text file. Since i need it to be able to respond when it reads a line, i need it to only read new lines, 1 by 1. Any idea how i go about this? Thanks for any help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now