-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshot project #23
base: main
Are you sure you want to change the base?
Screenshot project #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really well done but remember to hide your API keys!
@@ -0,0 +1,61 @@ | |||
const apiUrl = 'https://website-screenshot6.p.rapidapi.com'; | |||
const crudcrudUrl = 'https://crudcrud.com/api/3a35969637ce44f39102d0523902a7e1'; | |||
const apiKey = '08b2e4a664msh162c459a452cb14p1e70a3jsnd054693f2b71'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be in another file that you put in the .gitignore.
const url = urlInput.value; | ||
const params = new URLSearchParams({ | ||
url: url, | ||
width: '1920', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the screen object to get the width and height:
const screenWidth = window.screen.width;
const screenHeight = window.screen.height;
// Display the screenshot | ||
const screenshotImg = document.createElement('img'); | ||
screenshotImg.src = result.screenshot; | ||
screenshotsDiv.appendChild(screenshotImg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done
No description provided.