Cricket Fever? Dr. Flock’s got your daily dose of Action
Sixteen teams. Seven cities. One sport. A massive tournament.
The ICC T20 world cup is back, and cricket fever and has got temperatures soaring across the globe. But back in India, cricket is not just a sport. We call it a religion! And with that comes our zeal and vigour to support our very own Team India at the World Cup.
As India plays the West Indies in the semi finals on the 31st, we at Flock are rooting for our beloved team. With party mode settling in, we pulled a ‘Kohli’, and pushed the barriers of webhook technology to give you your dose of the World Cup. So here’s an uber interesting way to keep abreast of the latest score updates while making sure your work isn’t sidelined. We’ve integrated a Bleed Blue API that gets you your Cricket updates on Flock itself.
As majority of the good APIs were paid, we tried [espncricinfo.com](espncricinfo.com).
What’s the Hack?
One can go through [espncricinfo.com](espncricinfo.com)’s webpage and easily figure out the scores wrapped inside particular set of html tags. A basic script can then be written to parse HTML and identify scores from the page’s source.
P.S. We know this isn’t the ideal way to get scores. But then again, ‘Where there’s a will, there’s a way!’.
Sample script can be found [here](https://gist.github.com/bb713b836cb52889122047b3f82f07a6).
The hard part just got over. Now, all we need to do is integrate this with Flock. Anyone who simply asks for cricket score anytime, gets the update. Use the steps that follow-
1) Deploy simple web service to retrieve cricket score. You can use ‘https://aqueous-river-70811.herokuapp.com/support' as sample URL.
2) Use web service URL to configure outgoing webhook for a particular group in Flock.
And that’s it. Just send a message ‘cricket score’ on your Flock group now to get live cricket score updates.
So while at work, don’t miss out on the Cricket fever. Get all your cricket updates seamlessly within Flock itself and continue rooting for Team India! Just like we do at Flock.
-Authored by Yatin Sarbalia, Project lead (iOS) at Flock