Ticker: An RSS Scroller

Post your working scripts, libraries and tools
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Ticker: An RSS Scroller

17 Mar 2014, 11:16

I needed an AHK news ticker but could not really find one to my liking. This is a smooth news ticker that uses RSS feeds as its source of items. Everything is easily configurable. It's click-through for all buttons except for one (Default MButton), that takes you to the news article.

Image

I hope somebody likes it, input is welcomed.

Code: [Select all] [Expand] [Download] (Ticker.ahk)GeSHi © Codebox Plus

Last edited by Nextron on 15 Apr 2014, 16:21, edited 9 times in total.
roberti9
Posts: 3
Joined: 30 Mar 2014, 08:22

Re: Ticker: An RSS Scroller

30 Mar 2014, 09:02

Windows 7 Ultimate, If I toggle the Desktop,I can just see the Ticker working between screens, otherwise it's not visible. Good try, but not working as intended.

Ian
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Ticker: An RSS Scroller

30 Mar 2014, 09:14

Could you elaborate what you mean with "If I toggle the Desktop,I can just see the Ticker working between screens"? You don't see anything like in the screenshot?
roberti9
Posts: 3
Joined: 30 Mar 2014, 08:22

Re: Ticker: An RSS Scroller

30 Mar 2014, 09:28

I've just tried it again, and If I minimize my open window, then I can see the Ticker. If I then toggle i.e Show Desktop, the thingy at the right hand side of the Task bar, the Ticker will appear and disappear. Now I know whats happening, all's well, thanks for everything.

Ian
User avatar
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

Re: Ticker: An RSS Scroller

30 Mar 2014, 10:10

How can I edit the script to show something like a string instead of the RSS feeds?
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Ticker: An RSS Scroller

30 Mar 2014, 11:36

All titles from the RSS-feeds are stored in the TickerItem[i][1] array, with i being the index and 1 being static for the title (2=description, 3=url). So you can manually load the array with your own strings. As long as you haven't defined any RSS-urls in the TickerRss-array, your strings shouldn't get overwritten.
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

30 Mar 2014, 16:56

doh!! i just tested this but it runs in the background. is it possible to make it run ALWAYS ON TOP of all open programs?
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Ticker: An RSS Scroller

30 Mar 2014, 17:09

Change TickerTopMostInsteadOfBottom=0 to TickerTopMostInsteadOfBottom=1
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

30 Mar 2014, 17:29

Nextron wrote:Change TickerTopMostInsteadOfBottom=0 to TickerTopMostInsteadOfBottom=1

yes, very cool! now this script should receive the official seal of excellence. :lol: :ugeek:
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

30 Mar 2014, 23:43

doh!! AP and Reuters RSS feeds fail (ignored as in blank ticker) in my script. any ideas why?
http://hosted.ap.org/lineups/TOPHEADS.rss?SITE=AP&SECTION=HOME
http://feeds.reuters.com/reuters/topNews
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Ticker: An RSS Scroller

31 Mar 2014, 04:21

Thanks for everybody who likes it :mrgreen:.

Guest10 wrote:doh!! AP and Reuters RSS feeds fail (ignored as in blank ticker) in my script. any ideas why?
http://hosted.ap.org/lineups/TOPHEADS.rss?SITE=AP&SECTION=HOME
http://feeds.reuters.com/reuters/topNews

The homemade RSS-parsing is probably the weakest part of the script and the cause of not processing these feeds. The main script is updated to work with these feeds. To update your copy of the script, do a search&replace for: iU) to iUs) to make it work with more types of line breaks.

Just wait until you encounter a feed that includes full HTML styling... it doesn't look nice unparsed :(. But should anyone need that fixed, I've may found something to easily fix that too, but I just haven't gotten around to it.
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

31 Mar 2014, 05:34

thanks, now it works. oddly enough, it did work with Google feeds even though it is the longest i have:
http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=w&output=rss
and of course with Yahoo feeds, the shortest i have:
http://news.yahoo.com/rss/
:ugeek:
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

31 Mar 2014, 06:11

i know this feed is of zero interest to this forum but why it shows blank ticker (not working)?
http://www.bondbuyer.com/resources/breaking_news.xml
:geek:
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Ticker: An RSS Scroller

31 Mar 2014, 07:12

Guest10 wrote:thanks, now it works. oddly enough, it did work with Google feeds even though it is the longest i have:
http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=w&output=rss
and of course with Yahoo feeds, the shortest i have:
http://news.yahoo.com/rss/
:ugeek:
Both those feeds output the content in a single line without line breaks, so indeed, no problems there. The parsing failed when there were multiple consecutive line break characters in the RSS source. So feeds with `n worked, but those with `r`n or `n`n failed.

Guest10 wrote:i know this feed is of zero interest to this forum but why it shows blank ticker (not working)?
http://www.bondbuyer.com/resources/breaking_news.xml
:geek:

That's the kind of feed I was worrying about, they use CDATA sections for their content to include HTML. This however makes the entire content look like HTML which gets stripped, resulting in an empty feed. I think explicitly stripping the CDATA-tags before stripping other HTML should fix the problem and not break anything else.

So the main script is updated. The patch your copy, add the line: item:=RegExReplace(item,"iUs)<!\[CDATA\[(.+)\]\]>","$1") to the TickerRssUpdate()-function, just before the three RegExMatch()'s, so you get:

Code: [Select all] [Download] GeSHi © Codebox Plus

startpos:=pos+StrLen(item)
item:=RegExReplace(item,"iUs)<!\[CDATA\[(.+)\]\]>","$1") ;Add this line
RegExMatch(item,"iUs)<title.*>(.*)</title>",title)
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

31 Mar 2014, 12:38

thanks, indeed this is a super smooth ticker! i threw another 10 rss feed locations at this and all were processed smoothly right away. :ugeek:
User avatar
tomoe_uehara
Posts: 203
Joined: 05 Oct 2013, 12:37
Contact:

Re: Ticker: An RSS Scroller

31 Mar 2014, 13:15

Oh I ran it for several hours, then it stops working as intended.
The script itself is still running and refreshing itself, but the words turns into stripes, just like - - - - - - -
Maybe it's just me, I'm not sure..

Image
User avatar
Nextron
Posts: 1207
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Ticker: An RSS Scroller

31 Mar 2014, 13:58

That's odd, in this version I haven't seen that happen and I've been running it on multiple computers for hours. During development I've seen it happen a lot however. Usually it was because a gui text element was moving over a stationary text element. But then again, that shouldn't be a problem in itself, but I guess Windows decided to mess up the redrawing of the gui for some reason. There might be other reasons for that to happen.

Troubleshooting is a bit difficult when the gui is clickthrough because Window Spy doesn't show anything. If you're willing to, you could comment the line WinSet,ExStyle,+0x20 to not make it clickthrough. Next time when it happens you can use Window Spy to see if the text elements scroll by properly, regardless of the text corruption. They should be named Static1, Static2, ..., Static%TickerMessageQueue%
Between each text element there should be a gap/spacing where you shouldn't see any name like Static1. If you do see something where the gap should be, it could indicate that some text element got 'stuck'.

Has the ticker been running the entire time, or have you toggled it on/off with the TickerGuiToggle label? If you have I could check the reinitialization which has caused problems before.
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

31 Mar 2014, 15:31

i've been running non-stop on 12 rss locations on XP2 and so far, so good! :geek:

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus

Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: Ticker: An RSS Scroller

03 Apr 2014, 16:44

i am running this script now for a few days. :D i wonder if some code could be added to this script so that certain individual items in the feeds are excluded (filtered or not displayed) based on a list of key words. this means if i add a key word to this list then any item including this word is filtered out (excluded and not displayed) in the feeds?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: au6, Davidb, Hotte and 8 guests