Lefora Free Forum
221 views

betfair results site parser

Page 1
posts 1–1 of 1
novice - member
37 posts

Some linux command line madness that pulls recent soccer results from betfair and extracts the market id, the winner of the Match Odds market and the market name/date.  It needs xmlstarlet which you can get with apt-get etc.  Not sure if it's any use to anyone, but I thought it was neat in a geeky way.  The elements inside double quotes are xpath queries.

curl -s  'http://rss.betfair.com/RSS.aspx?format=xml&sportID=1' | xmlstarlet sel -t -m "//market[name ='Match Odds']" -v "concat(@id, ' | ', winners/winner, ' | ', menuHint)" -n

it produces output like:
100340901 | The Draw | Fixtures 01 February / Zamora v Bilbao B
100333047 | The Draw | Fixtures 01 February / Santos Laguna v Puebla
100340108 | Boca Juniors | Fixtures 01 February / Boca Juniors v River Plate
100333163 | Fiorentina | Fixtures 02 February / Bologna v Fiorentina
100330905 | The Draw | Fixtures 02 February / Olympiakos V. v Atromitos

Page 1
posts 1–1 of 1

This Topic Is Locked To Guest Posts

It's been a while since this topic was active, if you'd like to get it going again, please post as a registered member

join now