Ruby CLI Gem
Courtesy of a Nogogiri web scrape of boxofficemojo.com, this Ruby command-line interface gem returns a list of the current top of the box office.
The greatest challenge was isolating the correct information via the web scrape. Without defined IDs or classes, data was retrieved. This involved a process of trial and error.
HTML of Box Office Mojo
The country-slinging adage "gotta know when to hold 'em know when to fold 'em" wasn't intended to be a metaphor for software development, but it could so and very succinct at that. The BoxOfficeMojo site was taking me down a rabbit hole, though devoid of Cheshire Cats just as perplexing.
A familiar predicament to developers.
Consulting the 'Google Gods', I fortunately found a site with civilized classes and IDs, courtesy of the ninjas at Fandango. From here, scraping was a more straightforward process, though even the simple is complex when coding.
A class for the first row helps guide where needed data is stored.
A case operator guides the user through the top 5 movies of the weekend. An instance variable 'gross' is set to a method in the gross.rb file.
Need to get rid of the spaces, as well as the '/n's.
Styling the variable to split at the '/n's and interpolating objects that include the character "M" latched on the the data needed.
Now you've seen under the hood, try a test-drive.