Snowboard CLI Gem Progress

Posted by mystycs on August 27, 2016

So for my Ruby project i decided to work on a gem that scrapes The Good Ride and allow users to read reviews of the board of their choice.

It took about a few days to complete. The biggest hurdle i ran into to was finding out that the pages that displayed the snowboards was actually outputting JSON.

Mens Snowboard Page: http://thegoodride.com/snowboard-reviews/?mens=1 (resulted in [] null for all data pulled via nokogiri) JSON Outputted: http://thegoodride.com/ajax.php?sort=0&mens=1 (This data was rendered by the browser to show to the user rather than statically built into the html page)

I went at the attempt of using nokogiri to pull the data, but that resulted in data coming up empty every time. Luckily with the help of Avi I found out i had to pull the JSON. So i ended up adding JSON + Nokogiri to pull data from the website to display to the user.

Unlike the Snowboard list page, the Review page was actually static HTML so i was able to use nokogiri to pull the data.

Not every review page had the data for On Snow Feel, Powder, Turn Initiation etc. So i had to check if the data existed and then pull it and display it to the user so they wouldnt have blank data for reviews.

Below you can see what a review would look like when requested by the user.

Everything is displayed with nicer formatting as for ease of readability. Including the URL which was generated by combining the JSON data together into a formatted string rather than there being an actual link to pull out. Interesting way this site decided to do it.