Hey guys,
I need a little help here, my brain is about to explode trying to think about this...
I'm wanting to make a new skin, similar to my Steam headlines skin, only with the Steam Specials instead.
The problem is that sometimes there aren't very many sales going on, like right now, just three.
This means that a simple linear parser will not work, since if I put in a single parser for say, 12 items, and there's only html for three, it will break the parser.
The only way I can think to get around this is to write 12 (or whatever) different parser measures, and deactivate them all except one depending on how many items there are, which is stated on the page. In case it helps, here's the url I'm referring to:
http://store.steampowered.com/search/?specials=1
Is there a much easier way of doing this that I am missing?
Thanks,
It is currently April 26th, 2024, 4:10 am
Code Concept Question
-
- Posts: 30
- Joined: May 22nd, 2010, 6:51 pm
-
- Posts: 667
- Joined: April 18th, 2010, 2:16 pm
- Location: NY, USA
Re: Code Concept Question
http://rainmeter.net/cms/Tips-GoogleReaderRSS
Tips and Tricks wrote: -The link to 8 items (if they exist -- the RegExp won't fail if less than 8 items are available)
-
- Posts: 30
- Joined: May 22nd, 2010, 6:51 pm
Re: Code Concept Question
Hm... ok. I thought I tried it and it broke. I'll try some more.
-
- Posts: 667
- Joined: April 18th, 2010, 2:16 pm
- Location: NY, USA
Re: Code Concept Question
It breaks unless you're using the google reader trick
-
- Posts: 30
- Joined: May 22nd, 2010, 6:51 pm
Re: Code Concept Question
I don't think the Google Reader trick is going to work for this. The number of current sales is always changing. And I only want to display the current sales, not the last 12 sales in history. I did find an RSS feed, but the parser like you said breaks because I don't match the number exactly in the parser.
Would there be a way to fetch the number of current sales from the steam site and then dynamically change the parser or something to show only that many from the Google Reader feed?
Would there be a way to fetch the number of current sales from the steam site and then dynamically change the parser or something to show only that many from the Google Reader feed?
-
- Posts: 667
- Joined: April 18th, 2010, 2:16 pm
- Location: NY, USA
Re: Code Concept Question
Possibly.
If there is you'd almost certainly have to use !RainmeterWriteKeyValue to change the number of times you run the same sections of your RegExp
If there is you'd almost certainly have to use !RainmeterWriteKeyValue to change the number of times you run the same sections of your RegExp
-
- Developer
- Posts: 22630
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Code Concept Question
Why are we not just pointing this guy to "look ahead assertions" in Regular Expressions? What am I missing?
http://www.regular-expressions.info/lookaround.html
http://www.regular-expressions.info/lookaround.html
-
- Posts: 667
- Joined: April 18th, 2010, 2:16 pm
- Location: NY, USA
Re: Code Concept Question
Because reg exp and analog clocks are my weakpoints. ><
Never read anything about look aheads in here that helped.
Never read anything about look aheads in here that helped.
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Code Concept Question
In case you're lazy:jsmorley wrote:Why are we not just pointing this guy to "look ahead assertions" in Regular Expressions? What am I missing?
http://www.regular-expressions.info/lookaround.html
(?(?=.*<item>)<item>(.*)</item>)
Which means if <item> exists, apply <item>(.*)</item>. Repeat that 12 times (or however many you want). For example:
RegExp="(?siU)(?(?=.*<item>)<item>(.*)</item>)(?(?=.*<item>)<item>(.*)</item>)(?(?=.*<item>)<item>(.*)</item>)(?(?=.*<item>)<item>(.*)</item>)"
And you also get multiple index for one if:
(?(?=.*<item>)<item>(.*)</item>.*<otheritem>(.*)</otheritem>)
-
- Developer
- Posts: 22630
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Code Concept Question
Analog clocks are a mystery to me too.. I just steal from an existing one and hope for the best.JpsCrazy wrote:Because reg exp and analog clocks are my weakpoints. ><
Never read anything about look aheads in here that helped.