Comments (12)
I think that there isn't a shared API key. This might be caused by someone in your network running lots of google api calls. (This probably makes more sense if you are in an office rather than at home).
from how2.
Have the same problem, after playing few minutes I always got an error "You are doing too many requests to Google. You need to wait a bit before trying again"
from how2.
- The how2 module does not use the Google Search API as it (to the best of my knowlege) has been deprecated in favour of Google Custom Search, which does not suit the needs of the project, not least of all because it imposes severe rate limits.
- The error actually stems from node-google, the dependency how2 uses for scraping google results, which (as it should) respects the rate limiting Google imposes on what it believes to be (correctly in this case) automated traffic. This appears to be in the neighbourhood of four queries per minute.
- A realistic (and useful!) fix for this issue would probably involve writing npm modules that implement the same interface as node-google (or a consistent adapter for existing modules) but for scraping bing and duck-duck-go. If searches were then scheduled round-robin from how2, it could perhaps triple the rate limit (depending on their respective limits). If there is sufficient interest in that solution, I'd be happy to take a look at it.
Hope that helps!
from how2.
I didn't even managed to use this once. I always get the rate limit msg
from how2.
Yeah we need someone to write an api to scrape bing or duckduckgo
from how2.
I'm happy to take a look at implementing that in the coming week, if you'd like.
from how2.
@mkohlmyr awesome
from how2.
Pretty sure I have ddg / bing / google basically working with an -e flag for search engine selection. If it sounds interesting I could also add support for an environment variable to set the default.
Let me know if you want any changes to https://github.com/mkohlmyr/how2/commit/4b0cf93f9e87634f125d28c658a313a7e1517e23 before I make a PR. Forgot about the tests!
https://github.com/mkohlmyr/how2/commit/4b0cf93f9e87634f125d28c658a313a7e1517e23
+
https://github.com/mkohlmyr/how2/commit/db290793ddf01d2e6729b566a387d82445cf1f53
Let me know if you want any changes.
from how2.
Ping @santinic re commits above
Happy to squash them if you feel that's cleaner, or if you want me to rename / restructure any of the changes.
from how2.
@mkohlmyr sorry for the delay. It looks really good ! I have two questions:
- I seem to get fewer answers with google compared with the node-google, do you know why?
- With bing, I get this:
|Cannot connect to search engine.
Error: Failed to locate valid search results on page for query: [object Object]```
But, it's amazing :) thanks for your work!
from how2.
- You're right, I didn't include the
num
querystring parameter for the google URL. What number would you like? node-google sets a default of 10 and a max of 100 I believe. - I will take a look at that over the next few days, I did notice sometimes bing struggled to return answers for some queries.
I'll hit you back up by the end of the weekend probably with some updates.
from how2.
So I have done some investigating.
Your error is probably a rate limiting page that I was unaware of. It would be easy to improve the printing of the parameters, I could also create a special error message for this case by looking at the source it brings back.
FWIW it also looks like Bing has a tendency to return questions that have been closed by the user, moderator or have no answers, all of which would cause the magic search to reply with "cannot find any reasonable answer for your query". e.g. how2 reverse proxy nginx -e bing
.
I have not had time to implement the changes I mentioned, but I will hopefully get to it later this week (after wednesday). If you don't want to wait, feel free to adapt the code I posted!
from how2.
Related Issues (20)
- Ver depois
- Clarify npm package
- [Feature request] Any other way of installing how2 without npm? HOT 2
- [Windows] Crash after pressing space
- Explain how it works on README.md
- Sorry, I cannot find any reasonable answer for your query HOT 1
- Result title is undefined?
- error ,not connect HOT 2
- DeprecationWarning HOT 3
- TypeError: Cannot read property 'prototype' of undefined HOT 1
- Problem in Using! HOT 1
- Type Error: Cannot read property 'prototype' of undefined HOT 2
- Sublime or Alfred plugin?
- Error: Cannot read property 'prototype' of undefined. HOT 2
- Unexpected token function when trying to launch how2 HOT 1
- Sorry, I cannot find any reasonable answer for your query. HOT 21
- OSX problem TypeError: Cannot read property 'prototype' of undefined HOT 2
- "ETIMEDOUT" error logged to console when pressing space for more choices HOT 1
- SyntaxError: Unexpected token function HOT 4
- Query error with mongodb HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from how2.