For this week's challenge, we want to include a feature to enable bot users view Match Highlights from the English Premier League.
- High Level Algorithm
- Low Level Algorithm breakdown
-
This is achieved by making calls to reddits API, for a start signup to reddit
-
Next create An App and get APP credentials for the API call. Create App here
-
Find a wrapper for your prefered Language, then Use the wrapper to make API calls, here is a wrapper for PHP
-
You can also decide to make the API call yourself, here is a look at the documentation, another reference here
-This is what a sample API call to The SubReddit FootballHighlights we are using for the data looks like
-
search for only matches with title containing Premiership
-
return urls to such matches, one way of doing this is to use regex, this is what a PHP snippet regex for this looks like '/href="([\w/:?.-=]+|[\w/:.-]+)"/'. this PHP class does exactly that
- This is the messenger documentation for carousels, thankfully a webview button is included
- You have come this far Congratulations To take a dip dive into what the code for this loks like, see this complete PHP implementation
thanks for stoping by.