Add an example to the scraping package
Shows example usage for the function, and how to dispaly its
output.
Signed-off-by: Het Satasiya <satasiyahet@gmail.com>
Change-Id: Ic721e99a53ccfa8c41b84a7bbe22f893d49dd931
diff --git a/scouting/scraping/scraping_demo.go b/scouting/scraping/scraping_demo.go
new file mode 100644
index 0000000..1d727f3
--- /dev/null
+++ b/scouting/scraping/scraping_demo.go
@@ -0,0 +1,20 @@
+package main
+
+// To run the demo, ensure that you have a file named scouting_config.json at the workspace root with your TBA api key in it.
+import (
+ "log"
+
+ "github.com/davecgh/go-spew/spew"
+ "github.com/frc971/971-Robot-Code/scouting/scraping"
+)
+
+func main() {
+ // Get all the matches.
+ matches, err := scraping.AllMatches("2016", "nytr", "")
+ // Fail on error.
+ if err != nil {
+ log.Fatal("Error:", err.Error)
+ }
+ // Dump the matches.
+ spew.Dump(matches)
+}