Hello,
I am working on an automated link generator for a men's basketball site. Basically, there are stats that exist and can be linked to from a remote page. I want to read that page in (as a string), locate the correct stat URL for the game being sought from that page, and parse it out into another string.
I'm having a devil of a time trying to figure out exactly how to attack it. I know there are multiple ways of doing this, but the Keep It Simple Stupid rule has to apply as I won't be the primary keeper of this code once it's handed over to the client. So, I was looking at using the substr, stripos, and strlen commands to whittle the massive full page string down to the piece I need.
I do have the following pieces of data, and know the structure of the page being parsed.
$gameDate - the date of the game I need the stats for and how it appears in the page
$linkText - the text of the link the anchor tag is tied to
Unfortunately, the link itself (i.e., <a href='link.html'>) varies in length so I will need to parse out everything between the quotes. That's not too hard, but figuring out how to isolate that specific link on a page full of them is.
Some thoughts on my direction and any example code would be appreciated. I'm sure someone has done something like this before.