Working with Telescope API
This week I have started working with the Seneca Telescope project, the setups required for this project was way more complex than I thought, it took me around two hours just to install and figure out how to get the project running, I ran into a problem while installing Elasticsearch where it wouldn't run on my machine, it was eventually resolved by trying a different version. After all the required technologies were installed, I spent a few minutes checking out how the project works, including running the front end and testing the blog post API.
My task for this week is to use the DLCheck command line tool to work with the Telescope API to check the status code of the 10 most recent blog posts. The method I chose is to add another command line argument (--telescope or --t), and this will make a get request by utilizing the "request" npm module, the body then will be parsed into a JSON object array, then each of the JSON objects' id will be used. I have used a npm module called "tmp", this module allowed me to create a temporary file in the Node.js environment without having to create an actual file on my machine. The "file" was used to store the links coming from the telescope API and it could be checked by the DLCheck tool, and the temporary file could be cleaned up by simply calling the "removeCallBack()" function, this was very convenient and saved me a fair amount of time.
After I was done with the functionality updates, I have created a gist on GitHub to document the updates I made for this functionality and the file diffs.
Link Test Results:
GitHub gist: https://gist.github.com/Wei-J-Huang/c61af88878dac98e3a65cfaa8e7ed036
Comments
Post a Comment