This code
$html = file_get_html('http://runkeeper.com/user/'.RUNKEEPER_ID.'/activity/');
$link1 = $html->find('.activityMonth', 0);
will return the FIRST (foo, 0) element of a list of activities using Simple HTML DOM.
Here’s the output (content of $link1):
<div class="activityMonth menuItem selected" link="/user/zzvimercm/activity/95648619"><div class="highlight"></div><div class="distanceUnit">km.</div><div class="distance">7.26</div>
<div class="day"><img src="http://d2b4ufapzmnxpw.cloudfront.net/build/3694/static/kronos/images/icon-calendar-17.png" width="24" height="26" border="0" /></div>
<div class="mainText">Running</div>
</div>
I need to parse the “link” attribute of the first div, and retrieve the activity id (95648619, in this case). I guess that sscanf or Simple HTML DOM itself may do the trick, but I haven’t had success so far.
Any hints?
Thanks in advance
Example: