The least easy part of the application was to decide on whether to scrape vs. consuming an API.
When it came to scraping data wikipedia was the top choice however the data I was interested in did not have clear identifying tags and I did not want to wrestle too much with merely extracting data.
The next logical step was to choose an API that provided formatted data. So I looked at the available APIs. Nearly all the interesting APIs had authorization keys and hiding the key looked rather involved (since the app was to be published online on github).
I finally came across TV Maze which had an extensive list of shows and a not so extensive cast/actors information. TV Maze is not as detailed or extensive as IMDB but it served my purposes. Somehow , I felt that I ought to write an application promoting a show I am watching currently on Netflix. I discovered this show recently and it was filmed in the 90s.
A quick review: the positives: the show goes over workings of the White House & other branches of the government. The pilot episode’s portrayal of President Bartlett is inspiring and promising. I also watch the West Wing because of Ms. Malone (the slim, tall blonde lady) and Mr. Rob Lowe (the good looking talented actor) & the amazing performance by Mr. Martin Sheen and the other cast members like Bradley Whitford. Watching the show sometimes you realize why Martin Sheen is a super star and why he is blessed with two talented, beautiful, virtuous children (Charlie and Emilio).
Besides this perhaps at times life in the WH is portrayed as rather mechanistic (revolving around mechanics) & minor issues. The writer(s) is/are perhaps slightly unfamiliar with government & basic ideas (like the difference between authoritarianism and fascism and I am saying this when I never even took a single government class, unfortunately, if only the Most High God would have mercy upon me). Briefly, If you dislike D.C. and if you want to run in the opposite direction of politics then watch the West Wing. It is filled with “pragmatic” moments where politicians wheel and deal , threaten & cajole legislators & judges and attorneys & a variety of professionals just to get some basic amendment or bill or political stance serviced. I laugh helplessly at the nature of it. The world is in need of real substantive reform & righting which require equity in every realm but particularly through large scale terraformation (large scale improvement in climate, land and culture) and the best minds of the greatest nation of this era are pre-occuppied with tackling minor socio- political issues.
I watch it nonetheless because it is rather pleasant and therefore better than some of the scary, not so wholesome, entertainment on network TV perhaps (better than the Witcher with its gratuitous sexuality & violence & acting, & yet redeemable due to Geralt’s high morality). The West Wing also forecasts how the extreme left will begin to think & talk about politics particularly ANTIFA (who also don’t get what fascism means while accusing everyone else of it) At times the show seems to be a brain scan of the organization that will rise to power: ANTIFA & some Brits who incidentally are also clueless about politics (primarily because of their fair government). It seems it is a show that is oft recommended by people hailing from S. Europe (& sympathizers) a people who are themselves intimately aware of human nature & use the show to perhps mislead the rest of us who are innocent of the dark side of human nature.
Returning to the technical aspects of the application (sigh). Once I looked at the API by TV Maze I became increasingly confident that this was the API I wished to build an application around. It is user friendly, extensive, clean.
The first concern was how muddled the hashes looked. I had to install pretty print or awesome print (Thanks Howard Devenish, my talented tech coach who can foretell what difficulties we may encounter). Once I had awesome print installed I could see more clearly what the hash was offering. I began with the API class which interacted with the exposed endpoints.
Once the endpoints were working, I created the classes that were going to take input from the hashes. Again, Howard’s advice about using a white list of variables instead of loading all the hash variables somehow made me feel warm and secure inside (darn you Howard!).
I quickly sketched the class hierarchy and the parent/child class relationship . At this point I had a foggy thought and had some terrible OO design thoughts. The thoughts were motivated by my desire to reuse code and I even fumed about my idea on reddit denouncing Ruby & Java’s inability to handle multiple inheritence. Thank God for the sane people of the world who brought some sense into my head. Finally when I was working out in the gym I had a clear thought and realized that my OO design angle was incorrect and I had needlessly argued with people on the internet. Oh God! why the embarassment ? I apologized to the internet & everyone and felt unhappy with my misguided and irrational frame of mind (something I attributed to annoying people from developing countries).
Alas, I realized that irrationality and misguidance is a result of insecurities, anxieties and stress , lack of courage, adversity (poverty of health or wealth or social capital) and lack of sleep (somethings I was suffering from when I posted everywhere demanding why Java/ Ruby did not support multiple inheritance). I still feel multiple inheritance is better but I am ashamed of the examples I picked to prove my point & I am unhappy about the subsequent low opinion of people (that I formed) who disagreed with me. I believe this is due to decades of encountering contrarians who contradict whatever I have to say, which has in turn turned me into a contrarian myself where I feel uneasy if I am not met with resistance and I therefore end up picking the opposite side or finding flaw with another’s argument. This is primarily the result of being an ethnic person. I have observed this more acutely with people who are non-white or not so attractive. Even when they state facts they are contradicted and over ruled. The scriptures also observe this trend :
What fellowship hath the lion with the lamb? so the sinner with the godly. What agreement is there between the wolf and a dog? and what peace between the rich and the poor? As the lamb is the lion’s prey in the wilderness: so the rich eat up the poor. As the proud hate humility: so do the rich abhor the poor. A rich man beginning to fall is held up by strangers: but a poor man being down is thrust away by his friends. When a rich man is fallen, he has many helpers: he speaks outragous things, and yet men justify him: the poor man makes one slip, and they are ready to rebuke him; even if the poor speak wisely, they are not given a proper hearing. When a rich man speaks, every man holds his tongue, and they say, look, what he says, they extol it to the clouds: but if the poor man speak, they say, What fellow is this? and if he stumble, they will help to overthrow him. - Ecclesiasticus 13
What a pitiful state and how unhappy an existence to live in an unfriendly microcosm of the world with a lessened sense of security, lessened good will, empathy or understanding and to be twisted by that antagonism into a contrarian. Oh what loss of innocence and lessened righteousness. I now feel concern interacting with some peoples lest they feel it necessary to argue or to contradict & I in turn lessen my own rectitude. In the interim I hold the promise of the very same scriptures which speaks of amity between lions and lambs & the Good Shepherd who rescues the lost and brings them prosperity , safety, freedom & everything good.
I encountered some unease when configuring my application and I got some help from the tech coaches in configuring it with gemfile, environment file and a working console. Thank you. That was helpful.
After I had the objects & API in place I moved to the CLI application which I finished in a day. The entire thing took me 2-2.5 days. I would make it 3-3.5 days the extra day spent on agonizing over what application to write given the time frame constraints. My decision was helped with the following line from the check list : “● You are not building the next twitter cli. You are creating a project to show your understanding. Do not make your project super complicated.”
Thank you to whoever wrote that.