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

feat: request anomaly detection #135

Merged
merged 3 commits into from
Dec 4, 2023
Merged

feat: request anomaly detection #135

merged 3 commits into from
Dec 4, 2023

Conversation

blackmad
Copy link
Contributor

@blackmad blackmad commented Dec 4, 2023

I was getting this error from DDG when I didn't sleep in between three requests, and was getting a nasty exception from a regex rather than a nice helpful error

/Users/blackmad/Code/md-googlify/node_modules/duck-duck-scrape/lib/search/search.js:80
    const searchResults = JSON.parse(SEARCH_REGEX.exec(response.body.toString())[1].replace(/\t/g, '    '));

this is the error I discovered in the body (that was also a buffer, not a string)

 body: "DDG.deep.anomalyDetectionBlock({gk:'nac7b3a5f507fb907b94049aa855db990',q:'Friche%20la%20Belle%20de%20Mai',iadb:1,sc:1,e:0,p:'80-386-283-234-262-245-251-127-263',cc:'sre',o:'lTCdmsFCzbUSUhPvj7hnXN%2BlaWGPLfIPMY%2F0kNT0Tzw%3D%0A',er:'',s:'index', r:'euw'})",

@Snazzah Snazzah changed the title Throw error for DDG anomaly detection. feat: request anomaly detection Dec 4, 2023
@Snazzah Snazzah merged commit 8612128 into Snazzah:master Dec 4, 2023
2 checks passed
@Snazzah Snazzah added the type: enhancement New feature or request label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants