mIRC Home    About    Download    Register    News    Help

Print Thread
script for live score on flashscore.com #257512 17/04/16 12:26 PM
Joined: Apr 2016
Posts: 1
K
kazie Offline OP
Mostly harmless
OP Offline
Mostly harmless
K
Joined: Apr 2016
Posts: 1
Hi,

I'm new to scripting. I am creating a betting bot on my channel and was thinking of getting a script to display live scores from flashscore.com

for example this link: http://www.flashscore.com/match/zcN2SxcI/#match-summary

the script should just capture the first line of text which is

Socar Spor 27-23 Gediz Universitesi

and return it to the channel on command.

Someone help?

Thanks a bunch.

Re: script for live score on flashscore.com [Re: kazie] #257576 22/04/16 10:04 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias getscore {
  if ($2 == $null) { echo -a * /getscore: insufficient parameters }
  else { 
    sockclose getscore
    sockopen getscore www.flashscore.com 80
    sockmark getscore $1-
  }
}

on *:sockopen:getscore:{
  sockwrite -n getscore GET /match/ $+ $gettok($sock(getscore).mark,1,32) $+ /#match-summary
  sockwrite -n getscore Host: www.flashscore.com
  sockwrite -n getscore Accept: */*
  sockwrite -n getscore User-Agent: mIRC/ $+ $version
  sockwrite -n getscore
}
on *:sockread:getscore:{
  var %data
  sockread %data
  if ($regex(%data,/<title>(.+?)<\/title>/)) { $gettok($sock(getscore).mark,2-,32) $regml(1) }
}


/getscore <match number> <command>

e.g. /getscore zcN2Sxcl echo -s