ritiek / AskQuora

Quora Q&A right from the command-line
MIT License
14 stars 2 forks source link

No search results after a while #1

Open ritiek opened 7 years ago

ritiek commented 7 years ago

After looking around for some questions for a while, it stops giving results for any search term. This happens when there is not much delay between the searches. Thus, making DuckDuckGo temporarily block requests coming from the script.

Looking for a fix..

ritiek commented 7 years ago

Randomly selecting a header from a given list increases the number of requests that can be made before it gets temporarily blocked.

codecakes commented 7 years ago

What you are fundamentally doing is a brute search with random headers. This is not efficient.

Your goal is to search for answers in Quora. There are two alternatives I would suggest:

This way you would be able to run concurrent search queries(say 16) from qoura with a given browser header (if you care so ) for multiple searches. You could then even come up with a bunch of cached queries using something like an in memory db like Redis (although this would be a small scale project) and setup a UI that acts like ytinstant.com/ for qoura.

ritiek commented 7 years ago

@codecakes Quora API does not exist.

https://www.quora.com/search?q=how+do+i+make+chicken+curry

If I use this (or any other search) link without logging in, it redirects me to the login page and tells me to login to see the search results.

So, the only way I can think of is scraping search engines. :confused:

codecakes commented 7 years ago

So, the only way I can think of is scraping search engines. :confused:

Have you tried the second option yet that I proposed?

codecakes commented 7 years ago

Let me go through your code again and suggest a PR soon. @ritiek