DRAGnet (7 Part Series)
A Rails + React + Redux Project
This post is going to focus on some of the more challenging tasks I encountered while scraping data from Fandom and Wikipedia then connecting the data appropriately into the schema established in the last post. This post will focus on defining the get_seasons method and the get_queens method will follow. The gists are heavily commented!
Let's get started!
1. Def get_seasons in season.rb to scrape the list of season names from Fandom, concatenate each season name into an array of URLS for each Season's Wikipedia page, then iterate through the array to .create!() an instance of each Season.
2. Def get_queens in queen.rb to scrape the list of queens' names from Fandom, concatenate each queen's name into an array of URLs for each Queen's Fandom page, then iterate through the array to .create!() an instance of each Queen and her attributes (including associations for Quotes and Trivia.
3. With Seasons and Queens instantiated, iterate through the Seasons and .create!() an appearance for each episode per Queen and her appropriate appearance attributes.
That's all folks!
As we all know being a competent software developer or engineer means continuously learning throughout your career. It’s great! That makes this profession exciting and allows to escape everyday routine at work. In fact, it’s not a job anymore - it’s a lifestyle 👩💻👨💻