Skip to content

Conversation

@poludnev
Copy link
Member

@poludnev poludnev commented Jul 7, 2023

No description provided.

@poludnev poludnev marked this pull request as ready for review July 7, 2023 22:48
@poludnev poludnev requested review from pixelPepe and utgarda July 7, 2023 22:48
Copy link
Member

@utgarda utgarda left a comment

Choose a reason for hiding this comment

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

Pls take care

responseUrl.match(/TweetDetail/g) &&
headers['content-type'] &&
headers['content-type'].includes('application/json')
responseUrl.match(/TweetDetail/g) ||
Copy link
Member

Choose a reason for hiding this comment

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

.

console.log('process.env.TWITTER_USERNAME', process.env.TWITTER_USERNAME);
console.log('process.env.TWITTER_EMAIL', process.env.TWITTER_EMAIL);

if (!process.env.TWITTER_USERNAME) {
Copy link
Member

Choose a reason for hiding this comment

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

Please check all 3 in one go


const loginPageButtons = await page.$$('[role="button"]');

const loginPgaeNextButton = await findElementByTextContentAsync(
Copy link
Member

Choose a reason for hiding this comment

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

.

TWITTER_NEXT_BUTTON_TEXT_CONTENT,
);

// console.log(nextButton);
Copy link
Member

Choose a reason for hiding this comment

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

.

}
}

const coockies = await page.cookies();
Copy link
Member

Choose a reason for hiding this comment

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

.

Comment on lines 49 to 51
const clearUrl = imgageUrl.includes('data:image/png;base64,')
? imgageUrl.replace('data:image/png;base64,', '')
: imgageUrl;
Copy link
Member

Choose a reason for hiding this comment

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

what does it do?


export const makeImageBase64UrlfromBuffer = (buffer: Buffer, filetype: string = 'png') => {
export const makeImageBase64UrlfromBuffer = (buffer: Buffer | null, filetype: string = 'png') => {
if (!buffer) return null;
Copy link
Member

Choose a reason for hiding this comment

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

.

export const getTrustedHashSum = (data: string | Buffer) =>
enchex.stringify(
// @ts-ignore
sha256(CryptoJS.lib.WordArray.create(data)),
Copy link
Member

Choose a reason for hiding this comment

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

RIG - Let it Rest in Git

const author = tweetData?.user.screen_name ? tweetData?.user.screen_name : 'unknown autor';
const author = parsedTweetData?.user.screen_name
? parsedTweetData?.user.screen_name
: 'unknown autor';
Copy link
Member

Choose a reason for hiding this comment

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

typo - author

expect(res.ok).to.be.true;
expect(res.status).to.equal(200);
const { imageUrl, tweetdata, metadata } = JSON.parse(res.text);
//TODO: revise tests as handler changed
Copy link
Member

Choose a reason for hiding this comment

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

.

Copy link
Member

Choose a reason for hiding this comment

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

We can code the new test together!

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.

3 participants