Added Duckduckgo search - #22
Conversation
| def search(query, num=10, start=0, sleep=True, recent=None, country_code=None): | ||
| if sleep: | ||
| wait(1) | ||
| url = generate_url(query) |
There was a problem hiding this comment.
You're using only query. What about other arguments?
There was a problem hiding this comment.
I used query: line 58
num & start: line 60
sleep: line 56
duckduckgo does not have a news search feature and does not give a date to
it's search results, so I did not use recent.
country_code is not set via the url. I suppose there is a way to
initialize the country by creating a session, but this is above my skill
set.
I just needed the code to do some work for me so I thought I would pay back
the favor.
On Sat, Mar 5, 2016 at 10:18 PM, Rohith PR notifications@github.com wrote:
In pws/ddg.py
#22 (comment):
- """
- query = '%20'.join(query.split())
- url = 'https://duckduckgo.com/html/?q=' + query
- return url
+##################################################
+# Class
+##################################################
+class Ddg:
+
- @staticmethod
- def search(query, num=10, start=0, sleep=True, recent=None, country_code=None):
if sleep:wait(1)url = generate_url(query)You're using only query. What about other arguments?
—
Reply to this email directly or view it on GitHub
https://github.com/rohithpr/py-web-search/pull/22/files#r55132459.
Added duckduckgo.