Lmac34 Posted December 5, 2005 Share Posted December 5, 2005 hi guys long time read First time submission,Got bored in work today so i decided to look around the formsfound two programs of interest,http://www.autoitscript.com/forum/index.php?showtopic=12748andsome example from the IE.au3http://www.autoitscript.com/forum/index.php?showtopic=13398 Designer "Dale"and thought that they would be very useful if they where but together.so here it is.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Designer: Luke Mc Redmond;; Date: 05/12/2005;; Version: 1;; Description: To Read The Headlines form the RTE Web Site;; Acknowledgements: Dale "Internet Explorer Automation UDF library" and Unknown "speaks text to you";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#include <GUIConstants.au3>#include <IE.au3>$oIE = _IECreate()_IENavigate($oIE, "http://www.rte.ie/news/")$body = _IEBodyReadHTML($oIE)Dim $file = FileOpen("HtmlBody.txt",2)FileWrite($file,$body)FileClose($file)Dim $file = FileOpen("HtmlBody.txt",0)dim $file2 = FileOpen("htmlParsedTxt.txt",2)local $line;gets main body text removes all http tags <***************************>While 1 local $line = FileReadLine($file) If @error = -1 Then ExitLoop FileWriteLine($file2,StringRegExpReplace($line, "<(.|\n)+?>", @CRLF))WEndFileClose($file2)FileClose($file); NOW GOING TO OPEN THE PARSEDTXT FILE AND DELETE DOWN TO THE CONTACT USDIM $file3 = FileOpen("ReadFile.txt",2)$file2 = FileOpen("htmlParsedTxt.txt",0)local $foundContact = 0While 1 local $line = FileReadLine($file2) If @error = -1 Then ExitLoop If (StringInStr($line,"Contact us ")) Then $foundContact = 1 EndIf If (StringInStr($line,"Sports News")) Then $foundContact = 0 EndIf if ($foundContact == 1) Then if($line <> "") Then if(StringInStr($line," ")) Then $line = StringReplace($line," "," ") EndIf FileWriteLine($file3,$line) EndIf EndIf WEndFileClose($file2)FileClose($file3)$file3 = FileOpen("ReadFile.txt",0)local $index = 0While 1 local $line = FileReadLine($file3) If @error = -1 Then ExitLoop if ($index > 3) Then _TalkOBJ($line, 3) EndIf $index = $index + 1WEndFileClose($file3)FileDelete("HtmlBody.txt");FileDelete("htmlParsedTxt.txt")FileDelete("ReadFile.txt")_TalkOBJ("That was the Headlines for Today", 3)_TalkOBJ("This Program was Brought to you by Luke Mc Redmond", 3)_TalkOBJ("Hope You Enjoyed It Good Bye", 3)Func _TalkOBJ($s_text, $s_voice = 3) Local $o_speech = ObjCreate ("SAPI.SpVoice") Select Case $s_voice == 3 $o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Sam", "Language=409").Item(0) EndSelect $o_speech.Speak ($s_text) $o_speech = ""EndFunc ;==>_TalkOBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Just thought it might be useful for some one, Please feel free to modify, change, improve etc....TakeCare GentlePeopleLMAC34RTE_Headlines_Reader.au3 Link to comment Share on other sites More sharing options...
erifash Posted December 5, 2005 Share Posted December 5, 2005 Unknown? That's me! My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
Valuater Posted December 5, 2005 Share Posted December 5, 2005 (edited) Maybe edit your post with this [ code ] ; no spaces ; paste your code here [ /code] Looks like this ; paste your code here BTW.... Great first post 8) Edited December 5, 2005 by Valuater Link to comment Share on other sites More sharing options...
Lmac34 Posted December 6, 2005 Author Share Posted December 6, 2005 Maybe edit your post with this [ code ] ; no spaces ; paste your code here [ /code] Looks like this ; paste your code here BTW.... Great first post 8) Thank you for sharing that with me, I always wanted to know how that was done. I didnt see any option on the submit page. Cheers! Hope to hear for you again some time soon. LMAC 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