It is currently October 18th, 2024, 3:20 am

Mlb Live Scores

Get help with creating, editing & fixing problems with skins
jake2456
Posts: 93
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

Regex is a little confusing for me. Im having trouble finding if theres a way to do something.

In this code im skipping to detmlb with regex=(?siU).*detmlb. Once there is there a way to back track to outs=?

Code: Select all

   <ig_game outs="2">
      <game id="2016_05_05_detmlb_clemlb_1" league="AA" status="IN_PROGRESS"
User avatar
balala
Rainmeter Sage
Posts: 16669
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

I think I missing something, but why would you want to go back? Why is not enough a simple RegExp=(?siU)<ig_game outs="(.*)"> option?
jake2456
Posts: 93
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

Well on that page where i get the info. It has multiple game info and each each games info starts with <ig_game outs and then the next line has the specfic game code. i have to regex to regex=(?siU).*detmlb(teamcode) for that specific teams live info. as regexing to what you said would only go to first instance of that on the page and not the correct games outs info as each games outs info gets displayed in the line above where it finds the teamcode.
User avatar
balala
Rainmeter Sage
Posts: 16669
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

You've provided us very little information, but I'd say to try the following RegExp:
RegExp=(?siU)<ig_game outs="(.*)">.*<game id="(.*)_detmlb.*"(?(?=.*<ig_game).*outs="(.*)">.*<game id="(.*)_detmlb.*")(?(?=.*<ig_game).*outs="(.*)">.*<game id="(.*)_detmlb.*"). The first returned info is what you have on first line (the number from the <ig_game outs="???"> expression), and the second one is the live info (I hope I understood well). The first expression is without the lookahead assertion, the others are with it, so the measure will return up to three string pairs, but if there are less such expressions, the last returned strings will be empty.
However I don't think I understood well what you want. If I indeed didn't, please give me some more information, eg a URL (if it's another then the previous).
jake2456
Posts: 93
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

I may not be explaining it very well im sorry. Heres a link http://gd2.mlb.com/components/game/mlb/year_2016/month_05/day_06/scoreboard.xml Unfortunately theres only 1 game in progress right now so its hard to test as the outs line only appears during a game in progress. As you can see theres multiple games info on the page. each games section starts with either <ig_game or <sg_game followed by the line under it with the games id. Now the order of the games is different every day so you cant regex=(?siU).*<ig_game.* outs="(.*)".*detmlb as this would pull outs for the first game on the page and not from the game id your jumping to.

I dont think theres a way to do what i want, but im able to get the outs info correctly by parsing from a different page. So ill probably just have to use that. Was just hoping not to have some many different urls being parsed in one skin to get the info needed.
User avatar
balala
Rainmeter Sage
Posts: 16669
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

It seems there are no game in progress? Am I right? At least the page don't has now and didn't have today (I'm on GMT+2) those information you've described. Do you know when will have?
User avatar
jsmorley
Developer
Posts: 22861
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Mlb Live Scores

Post by jsmorley »

balala wrote:It seems there are no game in progress? Am I right? At least the page don't has now and didn't have today (I'm on GMT+2) those information you've described. Do you know when will have?
The Washington Nationals have a game starting at 4pm EDT, I think that is 8pm UTC.
User avatar
balala
Rainmeter Sage
Posts: 16669
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

jsmorley wrote:The Washington Nationals have a game starting at 4pm EDT, I think that is 8pm UTC.
Thanks, in this case I'll have to wait two hours (I hope I calculated correctly).
User avatar
jsmorley
Developer
Posts: 22861
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Mlb Live Scores

Post by jsmorley »

balala wrote:Thanks, in this case I'll have to wait two hours (I hope I calculated correctly).
No, about 45 minutes...
User avatar
balala
Rainmeter Sage
Posts: 16669
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

jsmorley wrote:No, about 45 minutes...
Ok, thanks, that's due of the daylight saving, I think.