Anyways, this week's lab was an interesting one. We were tasked with installing telescope, Seneca alumni made website to gather open source blogs together in one place using RSS Feeds, and YOU GUESSED IT, use our never ending link checker tool we had made way back in Release 0.1.
Man it feels like ages ago
So, I dreaded setting up telescope because when I tried to set it up last time for hacktoberfest, I was left only in disappointment and quickly lost interest in setting it up because who RTFM...
To my luck, of course our professor wants us to work with telescope for Release 0.3 and lab 6. Meaning I was forced to figure out how to set it up and actually RTFM. To my surprise everything installed properly this time and everything went pretty smooth. I also took my sweet time installing it...
YEP... 5 HOURSTo be fair it only took that long because I was taking down Halloween decorations before it snowed again. I don't even know why I decorated this year, only two, TWO, kids showed up.
EH! Whatever, I am not complaining. Now, I have a good reason as to why I am stuffing my face with so much candy. (#SorryNotSorry Dr. Roberts, my dentist)
Anyways, back to the point.
Everything went buttery smooth, so I ran telescope, ran docker, opened up and saw the JSON that the backend was returning for the 10 latest posts and began to think about how I would implement yet another functionality into my DeadLinkage.
Thank god I had refactored my code from the previous lab, otherwise this would have been a NIGHTMARE.
I made a new file that would be dedicated to handling and parsing the JSON formatted array and pass back links to the actual main driver.
I then simply duplicated my logic for checking through all the links but added an extra loop to switch each link that was passed back from the JSON parser. To my avail it worked perfectly. I had to tweak it a tad to make it look pretty and all but I have spent so much time with this code I know all the ins and outs of it by heart and line (man I have no social life).
The ending result was something like this:
I am actually pretty happy with the results to be honest. This continuous expansion on the link checker tool is turning out to be a neat little app (especially after refactoring).
OH, here is the diff if you want to check it out.
I will leave that with you and go
Till next time,
XOXO,
Gossip Plamen
No comments:
Post a Comment