I am looking for some snippet made using websocket implementation in tcl to retrieve footaball game events of the games marked as HOJE (portuguese word for TODAY) from this site.
The snippet has to accept a manual url (like this one) and it stays listening to websocket responses. The responses are just text, what seems to be json. There are cookies involved (iola and gig*) which I presume they are generated when loading the page firstly.
I (you) can see the events if we use Firefox browser for example, by going to Dev Tools (F12), network tab, and clicking next on WS tab and Responses at right (you probably need to refresh the page once). You need to go first to the main page and click one of the games marked as HOJE (today) and the next page is the page with websocket responses.
It should be possible to accomplish such task. The snippet may be written as regular tcl file, so I can modify the code.
You may be asking why I need this.
I do have an eggdrop bot with a tcl script done by myself. I'm not looking for an eggdrop script, just an working example that works with that site above. The script I made uses bind time by minute the url of the on-going match game by downloading the WHOLE html (using wget, and later lynx -source) and process the new events by parsing the html, throwing the new events to an IRC channel.
The whole html usually weighs over dozens of kilobytes but if we use websockets, the data size is just under 2/3 kbytes.
The script I made took some days to make and more days to fix bugs and add more features, like channel topic change. I simply don't find the available documentation and examples compeling to try to understand websockets, it would take me ages to undestand websockets and get cookies working. The whole html is just plain text with all events and ready to process, while websockets is another thing.
Can someone help me out by provide an working tcl example? One that accepts a football match link and sits listening to events from server. Note that the link marked as #2 was/is a football match scheduled for today as of time of writing. The link will not work if you read this in the future. There will be other links by going to the link #1.
Thanks in advance.