I feel lucky to have already been a Telescope contributor

Tony Vu
3 min readNov 4, 2020

--

Background info: Telescope is a open source feed aggregator tracking Seneca related open source activities and built by Senecacians. You can find more about the project here

First week of coming back to school and I also resumed my journey in the world of open source. This week we learn how Telescope works as well as getting its environment set up ready for future requirements. In lab 7, we are required to follow the docs on “environment-setup” to have Telescope up and running in our local machines. Luckily, I have already been a Telescope contributor and gone through this process, but frankly speaking, it was not the easiest process to follow. You would have to install quite a few web servers like Redis and Elasticsearch for Telescope to work and some students might find the installation a bit intimidating if they are not familiar with the steps. I remember when I did the set up, it took me the whole day to make it run on my computer. With that being said, I think Telescope’s team have done a great job creating a very detail docs compared to some of the repo I have visited during Hacktoberfest.

Assuming you have already got Telescope running, the second task is to add code to my LinkChecker so it can interact with Telescope backend. My LinkChecker needs to make a call to Telescope’s endpoint at http://localhost:3000/posts to receive the URLs of the latest 10 posts as a JSON array. Each of the JSON object has the following form.

{
"id": "4bd6cb2046",
"url": "/posts/4bd6cb2046"
},

My first thought was to decode the JSON array into an array of objects, then loop through the array to fetch the content of each URL in the form of HTML. After having the HTML data, I follow the same process as if it was read from a file (i.e: Parsing valid links > Run checker on each link > Display results). It seemed like I had a good idea how to do it. However, there was a problem that I forgot how I structured my code after not touching it for a couple weeks. I actually had to review some functions closely to remember how they work. At the beginning, my idea was to put all the post data into one big text file then run the checker at once, but after discussing it with Chris, my dear friend from OSD, I agreed that it was better to check it one by one. I added another new function in features package called `checkTelescopePosts()` holding all the logic required to achieve what I mentioned earlier. Despite my first loop through the post links is synchronous, the link checker processes are still concurrent to minimize wait time over the network. After successful running it locally, I created the gist to store all file differences and push the new code to Github.

I don’t want to drag this blog too long as the next couple weeks will be very busy for me. I will start my first software developer position as a part time next Monday. I decided to speed up the process so there will be a lot to catch up.

Thank you for reading.

Tony Vu

--

--

No responses yet