Jump to content

kind or rss reader


Pakku
 Share

Recommended Posts

hi,

i have made a kind of rss reader, but the news file is not in xml but in a language i made myself.

here is the news reader script:

#include<GUIConstants.au3>

GUICreate("News reader",800,470)
$url = GUICtrlCreateCombo("",10,10,340,20)
$update = GUICtrlCreateButton("Update",360,10,40,20)
$list = GUICtrlCreateList("",10,40,400,400)
$read = GUICtrlCreateButton("Read",10,440,400,20)
GUICtrlCreateLabel("Title:",440,10)
GUICtrlCreateLabel("Description:",440,50)
GUICtrlCreateLabel("Text:",440,150)
GUICtrlCreateLabel("Link:",440,420)
$title = GUICtrlCreateLabel("",520,10,270,40)
$description = GUICtrlCreateLabel("",520,50,270,100)
$text = GUICtrlCreateLabel("",520,150,270,270)
$link = GUICtrlCreateLabel("",520,420,270,40)
GUISetState()

Call("updateurl")

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then
        FileDelete("list.ini")
        Exit
    EndIf
    If $msg = $update Then
        Call("updatelist")
    EndIf
    If $msg = $read Then
        Call("read")
    EndIf
WEnd

Func updateurl()
    $updaterurlnumber = 1
    $urlinput = ""
    While 1
        $urlread = IniRead("urls.ini","Url",$updaterurlnumber,"")
        If $urlread = "" Then
            ExitLoop
        Else
            $urlinput = $urlinput & "|" & $urlread
            $updaterurlnumber = $updaterurlnumber + 1
        EndIf
    WEnd
    GUICtrlSetData($url,$urlinput)
EndFunc

Func updatelist()
    FileDelete("list.ini")
    InetGet(GUICtrlRead($url),"list.ini",0,0)
    $updaterlistnumber = 1
    $listinput = ""
    While 1
        $listread = IniRead("list.ini","Rank",$updaterlistnumber,"")
        If $listread = "" Then
            ExitLoop
        Else
            $listinput = $listinput & "|" & $listread
            $updaterlistnumber = $updaterlistnumber + 1
        EndIf
    WEnd
    GUICtrlSetData($list,$listinput)
EndFunc

Func read()
    $readselected = GUICtrlRead($list)
    $descriptionread = IniRead("list.ini",$readselected,"Description","")
    $textread = IniRead("list.ini",$readselected,"Text","")
    $linkread = IniRead("list.ini",$readselected,"Link","")
    GUICtrlSetData($title,$readselected)
    GUICtrlSetData($description,$descriptionread)
    GUICtrlSetData($text,$textread)
    GUICtrlSetData($link,$linkread)
EndFunc

the urls.ini file is easy to make it is like:

[Url]
1=here is url 1
2=here is url 2
3=here is url 3

the news file which is host on a webserver or a ftpserver is also easy to create

it goes like this:

[Rank]
1=News 1
2=News 2
3=News 3
4=News 4
5=News 5

[News 1]
Description=Description1
Text=Text1
Link=Link1

[News 2]
Description=Description2
Text=Text2
Link=Link2

[News 3]
Description=Description3
Text=Text3
Link=Link3

[News 4]
Description=Description4
Text=Text4
Link=Link4

[News 5]
Description=Description5
Text=Text5
Link=Link5

The news file can have any name you want but the urls file have to be "urls.ini"!!!!!!!!

bug reports are welcome!

Edited by Pakku
Link to comment
Share on other sites

  • 1 year later...

This is very nice! I like the layout. Is the any way to make it automatically show the next news article when you click on it on the left instead of having to click the read button at bottom? That would be cool...

Thanks

Edited by gesller
Link to comment
Share on other sites

Arjan, parsing XML is so simple.. Probably even easier then using an ini.. :shocked:

i know but look at the date: Dec 25 2005

i hadn't have a glue what xml was (yes, the past: at Dec 25 2005, i didn't know much about xml), so the next version will be a full rss reader

Edited by Pakku
Link to comment
Share on other sites

Didn't notice the date at all, because gessler posted today. :shocked:

I know you can do a lot better now.. Are you actually going to work on that RSS, or are you just planning?

Yeah, sorry, I didn't notice the date either because I was looking thru new post and seen where Arjan posted. Sorry for any confusion.

Link to comment
Share on other sites

Didn't notice the date at all, because gessler posted today. :shocked:

I know you can do a lot better now.. Are you actually going to work on that RSS, or are you just planning?

Well you know how i am with planning... i will think about it and maybe do some stuff with xml/rss. i'm now bussy with an youtube downloader/manager (kind of Limewire) so xml/rss has to wait.

and i take this as a compliment: :(

I know you can do a lot better now

but feel free to make a rss reader, i might use it when i build my own one.

Yeah, sorry, I didn't notice the date either because I was looking thru new post and seen where Arjan posted. Sorry for any confusion.

No problem! Edited by Pakku
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...