-
Notifications
You must be signed in to change notification settings - Fork 5
lab 6
Saturday November 7 by Midnight.
This week we are going to get you started working on Telescope, one of the open source projects you'll be contributing to for the remainder of the term. Telescope is a somewhat complex system that uses many technologies. Getting the development environment set up on your local computer can take some time.
This lab will help you practice the following:
- setting up the Telescope development environment
- using the Telescope REST API with your Link Checker project
- using your Link Checker project in new ways, and hopefully improving the code
- working with gists
Begin by forking and cloning the Telescope repo. Next, read the CONTRIBUTING guide and the Environment Setup guide.
Follow these instructions carefully to get Telescope running on your local computer. Getting everything setup may take some time, but don't give up! You will likely have questions, and can use the #telescope Slack channel to ask for help or discuss the project. Remember, real-world software isn't necessarily easy to develop and deploy, and you need to build some experience not giving up when it seems hard. You can do this! Every line of code in Telescope was written by a former Seneca student.
Once Telescope is properly configured, you can run the back-end server using:
npm start
This will start a number of processes, including an Express.js based web server on http://localhost:3000. You should be able to query the server's REST API for posts at http://localhost:3000/posts, which should give back JSON that looks something like this:
[
{
"id": "4bd6cb2046",
"url": "/posts/4bd6cb2046"
},
{
"id": "fcae3b14c4",
"url": "/posts/fcae3b14c4"
},
{
"id": "6cf4e49d53",
"url": "/posts/6cf4e49d53"
},
{
"id": "78e5c53128",
"url": "/posts/78e5c53128"
},
{
"id": "5711a54f70",
"url": "/posts/5711a54f70"
},
{
"id": "1c187660b8",
"url": "/posts/1c187660b8"
},
{
"id": "dd0d8dbf71",
"url": "/posts/dd0d8dbf71"
},
{
"id": "550ee34314",
"url": "/posts/550ee34314"
},
{
"id": "228b01591f",
"url": "/posts/228b01591f"
},
{
"id": "10ee28212c",
"url": "/posts/10ee28212c"
}
]
These are the most recent 10 posts that have been indexed by your local Telescope instance. Each post has a unique id
and a url
, which is made using the id
.
You can query for a particular post using its URL. For example, the post with an id
of 4bd6cb2046
is available at http://localhost:3000/posts/4bd6cb2046.
When you query for the post, you can request the post data in a number of formats, depending on the value of the Accept
header. Telescope will return posts in JSON, HTML, or plain text.
Use your Link Checker project to check the links in the last 10 posts indexed by your local Telescope. You can do this a number of ways:
- Modify your link checker's core API so it can be included as a library (e.g., your CLI tool and this program can both load the core of your link checker via a set of functions or Objects)
- Modify your link checker to accept data from
stdin
and pipe the result of requesting these posts to your link checker - Write some code to interact with the local Telescope server and download the 10 posts to files, which you pass to your link checker
Or you can do it another way not listed above. It doesn't have to be pretty, just make it work quickly--this is a proof-of-concept vs. a product. Be creative and come up with a solution that works for you. Ask your friends how they are going to solve this, and collaborate on the best solutions. Whatever way you do it, remember that your goal here is to write some new code that connects your link checker to the local Telescope REST API. You do not need to modify Telescope to do this (i.e., please don't send a PR to add this code to Telescope).
When you have your program working, create a gist with all the files you had to write. If you needed to modify your link checker, also include a DIFF (git diff
). This gist will be a set of technical notes of everything you had to do to make this work.
Write a blog post about the entire experience. In your post, talk about the following:
- setting up Telescope. How did it go? Did you run into any hurdles? How did you overcome them?
- working with the Telescope REST API. Did you have any issues?
- modifying/using your link checker with the data from Telescope. What did you have to change to make it work? Was your code in good shape to accomplish this, or did you have to change a lot?
When you have completed all the requirements above, please add your details to the table below.