Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeli1991
Copy link

No description provided.

Copy link

@chezzoba chezzoba left a 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';

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',

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants