Use the GitHub API. Given a GitHub repository name and owner, download all the contributors' profile images and save them to a subdirectory folder called avatars
.The avatars
folder should contain images corresponding to the avatars of the contributors of the repoThe name of each image file should be the contributor's name and the file extension (ex. johnny.png
).
Your program should be executed from the command line in the following manner:
node download_avatars.js USER PROJECT
i.e. node download_avatars.js nodejs node
... where USER is any valid user (i.e. jquery) and PROJECT is a project belonging to that user (i.e. jquery).
Follow this link to generate a new token with github: https://github.com/settings/tokens
Once generated, create a new file called ".env" and input GITHUB_TOKEN = YOUR-TOKEN-HERE
and save.
dotenv
for accessing GitHub API keysfs
to save the avatar profile imagespath
to work with directories and file pathsrequest
for managing HTTP requests