Chris here again back for a quick blog post update for lab 2.
As a reminder (or an FYI for readers who may not be going to Seneca College and taking OSD600) for our last lab (lab 1) we had to fork, review, and test the code from our partner’s release 0.1. I got a lot of great feedback from Plamen (besides him telling me that he hated me). Although all we had to do was test and file issues, both of us decided to file some minor pull requests to help improve our readmes, remove comments, or change variable names, in an attempt to learn more about Git and GitHub.
For this lab (lab 2) we had to implement an optional feature on our partner’s release 0.1 project. How exciting: an opportunity to disappoint someone further. Contrary to my charming negative demeanor, I had a lot of fun implementing not one, but two optional features to Plamen’s project. I chose to do two because Plamen was doing two because I felt that simply adding linux-style CLI arguments wasn’t exactly enough as it was just a simple change. I wouldn’t say I bit off more than I could chew, but I also wouldn’t say it was as easy as I thought it would be.
I tried opening another page using web driver, but I ended up spending more time begging the web driver to cooperate rather than implementing the feature. This was by far the biggest headache, as the selenium web driver automatically took me to the final destination of the URL, which makes sense given that Selenium is generally used for testing purposes, and if we’re testing a page for links who cares how you got there, as long as you did.
The big breakthrough for this was to set httpURLConnect.setInstanceFollowRedirects(true);
to true. This allowed me to follow the redirect to the final destination instead of simply spitting out ERROR 30x
.
I have to say that getting a PR on my own repo is extremely thrilling. Someone actually gives enough of a damn (or uh… is being coerced to) to contribute something to your project. I actually just merged two PRs that Plamen sent me back today. One even featured a timer (which he used to determine that head was causing the program to process faster), and the other creatively displays how many hoops the redirect had to hop through to get to its destination. Awesome! Really well done.
Some other thoughts are that in hindsight I think we spent too much time not communicating via GitHub, it might have been a better idea to as this would have given us some more experience “blindly“ communicating with random programmers over the internet.
Well that was fun. Now if you don’t mind me, I’m gonna go spend my night watching a comedy and enjoying a bottle glass of wine.
C