Dalton F. Posted March 5, 2006 Share Posted March 5, 2006 (edited) Hello everyone, I am wondering can someone make a small program for me that reads an RSS feed and displays the title of it in a small window? (The window size should be about like this size: |------------------------------------------------------------- | |--------------------------------------------------------------| |latest-rss-topic-in-this-box-the-program-name-in | |box-above-which-I-can-edit-via-script-thanks-all! | |--------------------------------------------------------------| ) Also if you could make it so it plays the Windows notify sound when a new post is added? Thanks so much! I would like this script if anyone could help to make an RSS reader app for my wordpress blog. -Dalton Edited March 5, 2006 by Dalton F. Link to comment Share on other sites More sharing options...
Valuater Posted March 5, 2006 Share Posted March 5, 2006 (edited) 1we can help for free... if you try, we help2You can make a small Donation to Autoit.. post that recipt here and i am sure someone ( including me ) will help make it for you3What a mess.So which one do I use?That's 7 -- count 'em, 7! -- different formats, all called "RSS".4http://www.autoitscript.com/forum/index.php?showtopic=21048#8) Edited March 5, 2006 by Valuater Link to comment Share on other sites More sharing options...
Dalton F. Posted March 5, 2006 Author Share Posted March 5, 2006 Ok, thanks, what do you mean in your quote? I didn't even post that. I'll try to donate tomorrow if I have time. G'night. Link to comment Share on other sites More sharing options...
Valuater Posted March 5, 2006 Share Posted March 5, 2006 Ok, thanks, what do you mean in your quote? I didn't even post that. I'll try to donate tomorrow if I have time. G'night.http://www.xml.com/pub/a/2002/12/18/dive-into-xml.htmlI will try to write that for you tomorrow if i have time8) Link to comment Share on other sites More sharing options...
MikelSevrel Posted March 5, 2006 Share Posted March 5, 2006 (edited) I'll try(since I'm stuck on my other project), but could you be more specific about what you want? EDIT: This is trickier than I figured, many RSS feeds use something that inetgetsize won't read. So, the problem is how do you want it updated? If the file size is 0 on the server, we'd have to download the file once again, even if there are no changes. This would be a large waste of resources, so if anyone has any advice that'd be great. Edited March 5, 2006 by MikelSevrel Coming soon.... Link to comment Share on other sites More sharing options...
Dalton F. Posted March 5, 2006 Author Share Posted March 5, 2006 Thanks everyone, ok-here's what I want: A program, about the size of an alert window that runs in the background and every [time I can edit in script] downloads a feed from my WordPress blog and displays the post title in the box, and the title I can edit in the script. No traybar icon, if possible I don't really want a button in the taskbar, no ok,yes,no buttons but you can close it by clicking X and closing it. Thanks for anyone who helps! Link to comment Share on other sites More sharing options...
MikelSevrel Posted March 5, 2006 Share Posted March 5, 2006 Could we see what your blog's feed looks like? Coming soon.... Link to comment Share on other sites More sharing options...
Dalton F. Posted March 5, 2006 Author Share Posted March 5, 2006 (edited) Ok Edited March 14, 2006 by Dalton F. Link to comment Share on other sites More sharing options...
Dalton F. Posted March 5, 2006 Author Share Posted March 5, 2006 I'm sorry, my stupid server is down at the time, I hate it-third time today!! Link to comment Share on other sites More sharing options...
MikelSevrel Posted March 5, 2006 Share Posted March 5, 2006 I don't think I understand what you want, but here is this. :::NOTE::: Do NOT Run, because this will constantly download your feed. I'm tired, right now, and I can't think of a way to do download every so often without the exit button being inaccessible. expandcollapse popup#include <GUIConstants.au3> #include <File.au3> #include <Array.au3> ; == GUI generated with Koda == _retreive() Func _retreive() InetGet("http://dtfnet.com/press/?feed=rss2","tmp.xml") _makeheadlines() EndFunc Func _makeheadlines() $lines = _FileCountLines("tmp.xml") For $i = 1 To $lines $fileline = FileReadLine("tmp.xml",$i) If StringInStr($fileline,"<item>") Then $headline = StringTrimRight(StringTrimLeft(FileReadLine("tmp.xml",$i + 1),9),8) ExitLoop EndIf Next FileWriteLine("tmp.txt",$headline) $rss = GUICreate("RSS", 325, 56, 192, 125) GUICtrlCreateLabel($headline, 16, 8, 195, 41) GUISetState(@SW_SHOW) EndFunc Func _retreive2() InetGet("http://dtfnet.com/press/?feed=rss2","tmp2.xml") $size1 = FileGetSize("tmp.xml") $size2 = FileGetSize("tmp2.xml") If $size1 = $size2 Then Else FileMove("tmp2.xml","tmp.xml") SoundPlay("Some wav or mp3 here") _makeheadlines() EndIf EndFunc While 1 _retreive2() $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case Else ;;;;;;; EndSelect WEnd Exit Coming soon.... Link to comment Share on other sites More sharing options...
Dalton F. Posted March 5, 2006 Author Share Posted March 5, 2006 (edited) Thanks! Could someone maybe fix it though? Edited March 5, 2006 by Dalton F. Link to comment Share on other sites More sharing options...
MikelSevrel Posted March 5, 2006 Share Posted March 5, 2006 Yeah, sorry I can't help more right now. My brain is imploding. Plus, I barely know anything about AutoIt. Coming soon.... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 5, 2006 Moderators Share Posted March 5, 2006 Yeah, sorry I can't help more right now. My brain is imploding. Plus, I barely know anything about AutoIt. I commend you.. You Read the help file >> Demonstrated Intuiteness >> Put forth an effort. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
MikelSevrel Posted March 6, 2006 Share Posted March 6, 2006 (edited) ^Thank you. I've never done anything like this before, but AutoIt seems to be pretty well documented. Anyhow, looks like AdlibEnable will get us out of this mess. expandcollapse popup#include <GUIConstants.au3> #include <File.au3> #NoTrayIcon _retreive() Func _retreive() InetGet("http://dtfnet.com/press/?feed=rss2","tmp.xml") _makeheadlines() EndFunc Func _makeheadlines() $lines = _FileCountLines("DIR OF YOUR CHOICE\tmp.xml") For $i = 1 To $lines $fileline = FileReadLine("tmp.xml",$i) If StringInStr($fileline,"<item>") Then $headline = StringTrimRight(StringTrimLeft(FileReadLine("tmp.xml",$i + 1),9),8) ExitLoop EndIf Next FileWriteLine("DIR OF YOUR CHOICE\tmp.txt",$headline) $rss = GUICreate("RSS", 296, 94, 199, 126) GUICtrlCreateLabel($headline,8, 8, 280, 68) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) EndFunc Func _retreive2() FileDelete("tmp2.xml") InetGet("http://dtfnet.com/press/?feed=rss2","tmp2.xml") $size1 = FileGetSize("DIR OF YOUR CHOICE\tmp.xml") $size2 = FileGetSize("DIR OF YOUR CHOICE\tmp2.xml") If $size1 = $size2 Then Else FileMove("DIR OF YOUR CHOICE\tmp2.xml","DIR OF YOUR CHOICE\tmp.xml") SoundPlay("Some wav or mp3 here") _makeheadlines() EndIf EndFunc While 1 AdlibEnable("_retreive2",1200000) $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case Else ;;;;;;; EndSelect WEnd ExitIt's currently set to update every 20 minutes. I think I got it this time, if I didn't, sorry. Also, if anyone could provide any input on the thread in my sig that'd be great. EDIT: Forgot you didn't want a tray icon. Edited March 6, 2006 by MikelSevrel Coming soon.... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 6, 2006 Moderators Share Posted March 6, 2006 (edited) @MikeSevrel - Since you did try very hard, thought I would take a stab at it a bit... Look over the code... It's useless really to someone that the RSS feed information would be different (intentional), because if you study the code you'll know where to edit to fix the issue of a different feed. I went off your exampleexpandcollapse popup#include <GUICONSTANTS.AU3> #include <File.au3> #NoTrayIcon Opt('OnExitFunc', 'EXITSCRIPT') HotKeySet('{ESC}', 'EXITSCRIPT'); USE THE ESC BUTTON ON YOUR KEY BOARD TO EXIT THE SCRIPT Global $RSS_URL = '' Global $XML_DIRECTORY = FileSelectFolder('Select the folder to put the XML files in', @HomeDrive);@ScriptDir $MAIN_GUI = GUICreate('RSS Feeds', 600, 400) $BUTTON = GUICtrlCreateButton('Start Feed', 10, 10, 80, 30) $INPUT = GUICtrlCreateInput('http://dtfnet.com/press/?feed=rss2', 100, 15, 450, 20) $EDIT1 = GUICtrlCreateEdit('', 10, 50, 580, 340, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $WS_VSCROLL, $WS_HSCROLL)) GUISetState() Local $TIMER = '' Local $StartTimer = 0 While 1 $rss_msg = GUIGetMsg() Select Case $rss_msg = $GUI_EVENT_CLOSE EXITSCRIPT() Case $rss_msg = $BUTTON $RSS_URL = GUICtrlRead($INPUT) If $INPUT <> '' And StringInStr($RSS_URL, 'http:') Then InetGet($RSS_URL, $XML_DIRECTORY & "\tmp.xml") $fzPath = $XML_DIRECTORY & '\tmp.xml' $DataRetrieve = GetRSSFeed($fzPath) GUICtrlSetData($EDIT1, $DataRetrieve) $TIMER = TimerInit() $StartTimer = 1 Else MsgBox(64, 'Error', 'You need to provide the RSS url or you are missing the http:') EndIf Case TimerDiff($TIMER) / 1000 >= 10 And $StartTimer = 1; CHECK EVERY 1 MINUTE, CHANGE 60 (IN SECONDS) IF YOU NEED IT LONGER OR SHORTER RSS_RETRIEVE() $fzPath = $XML_DIRECTORY & '\tmp2.xml' $DataRetrieve = GetRSSFeed($fzPath) If GUICtrlRead($EDIT1) <> $DataRetrieve Then GUICtrlSetData($EDIT1, $DataRetrieve) $TIMER = TimerInit(); RESET THE TIMER EndSelect Sleep(10) WEnd Func RSS_RETRIEVE() InetGet($RSS_URL, $XML_DIRECTORY & '\tmp2.xml') Local $fz_FileOpen1 = FileOpen($XML_DIRECTORY & '\tmp.xml', 0) Local $fz_FileOpen2 = FileOpen($XML_DIRECTORY & '\tmp2.xml', 0) Local $fz_FileRead1 = FileRead($XML_DIRECTORY & '\tmp.xml', _FileCountLines($XML_DIRECTORY & '\tmp.xml')) Local $fz_FileRead2 = FileRead($XML_DIRECTORY & '\tmp2.xml', _FileCountLines($XML_DIRECTORY & '\tmp2.xml')) If $fz_FileRead1 <> $fz_FileRead2 Then FileMove($XML_DIRECTORY & '\tmp2.xml', $XML_DIRECTORY & '\tmp.xml') ;SoundPlay("Some wav or mp3 here") If FileExists($XML_DIRECTORY & '\tmp2.xml') Then Do FileDelete($XML_DIRECTORY & '\tmp2.xml') Until Not FileExists($XML_DIRECTORY & '\tmp2.xml') EndIf EndIf FileClose($fz_FileOpen1) FileClose($fz_FileOpen2) EndFunc ;==>RSS_RETRIEVE Func EXITSCRIPT() If FileExists($XML_DIRECTORY & '\tmp.xml') Then Do FileDelete($XML_DIRECTORY & '\tmp.xml') Until Not FileExists($XML_DIRECTORY & '\tmp.xml') EndIf If FileExists($XML_DIRECTORY & '\tmp2.xml') Then Do FileDelete($XML_DIRECTORY & '\tmp2.xml') Until Not FileExists($XML_DIRECTORY & '\tmp2.xml') EndIf Exit EndFunc ;==>EXITSCRIPT Func GetRSSFeed($fzPath) Local $nArray = '' Local $ReturnRSS = '' Local $Show_Date_Time = '' Local $fzFileRead = _FileReadToArray($fzPath, $nArray) For $i = 1 To UBound($nArray) - 1 $rss_Date = StringRegExp($nArray[$i], '(<pubDate>)([^</]*)', 1) If @error = 0 And @extended Then If StringInStr($rss_Date[1], ' +0000') Then $Show_Date_Time = StringReplace($rss_Date[1], ' +0000', "") Else $Show_Date_Time = $rss_Date[1] EndIf EndIf $rss_Feed = StringRegExp($nArray[$i],'(<p>)([^</]*)', 1) If @error = 0 And @extended Then If StringInStr($rss_Feed[1], '’') Then $rss_Feed = StringReplace($rss_Feed[1], '’', "'") $ReturnRSS = $ReturnRSS & $Show_Date_Time & @CRLF & $rss_Feed & @CRLF & @CRLF Else $ReturnRSS = $ReturnRSS & $Show_Date_Time & @CRLF & $rss_Feed & @CRLF & @CRLF EndIf EndIf Next Return $ReturnRSS EndFunc Edit: Had timer set to 10 for testing, it's reset to 60 representing 60 seconds. Edit2: Had a variable backwards. Edited March 6, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Dalton F. Posted March 6, 2006 Author Share Posted March 6, 2006 Got an error- Line 21 FileWriteLine("C:\tmp.txt",$headline) FileWriteLine("C:\tmp.txt,^ERROR Error: Variable used without being declared Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 6, 2006 Moderators Share Posted March 6, 2006 Got an error-Line 21FileWriteLine("C:\tmp.txt",$headline)FileWriteLine("C:\tmp.txt,^ERRORError: Variable used without being declaredI don't even have that in the example I gave. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
MikelSevrel Posted March 6, 2006 Share Posted March 6, 2006 Thanks, SmOke_N, but I'm actually dropping the idea in that other thread. Coming soon.... Link to comment Share on other sites More sharing options...
Dalton F. Posted March 7, 2006 Author Share Posted March 7, 2006 Oh sorry, you posted before I did-nevermind! Thanks! 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