python JSON API duckduckgo search engine 使用duckduckgo API 尝试搜索引擎

The duckduckgo.com's search engine is very neat to use.

Acutally it has many things to do with other things since its API is also very neat. 

We can find many API which are free to use on different platforms. Here we got one for JavaScript on github. "https://github.com/devnulled/duckduckgo-api"

Here we can get official API of it.

https://api.duckduckgo.com/api

https://duckduckgo.com/api

Now we can use duckduckgo's API to test other things as it refers.

"

To consume it yourself, you can use one of the language libraries listed below or simply add '&format=json' (or xml if you have a death wish) onto any query URL in the api subdomain, e.g. 
http://api.duckduckgo.com/?q=DuckDuckGo&format=json

"

Now we just choose python since it has very neat JSON lib and parser.

You will need to have a look of my pervious blog which could be helpful to understand how to parse JSON within python.

    http://www.cnblogs.com/spaceship9/p/3153952.html

I now just want to get useful information from duckduckgo to be mine.

I found an interesting thing here: http://duckduckhack.com/ 

Open-source DuckDuckGo

Now you can hack your search engine.

Also we use this :

  • For !bang commands, the redirect will happen at the HTTP level (since that is fastest), but it will also be returned in the content (for parsing). If you don't want the redirect to happen in the HTTP header, use the no_redirect flag.

  https://duckduckgo.com/bang.html 

 ______To Be continued 00:51 10th Nov, I am sleepy and tired today. gonna have an important visite to a studio in the morning.

原文地址:https://www.cnblogs.com/spaceship9/p/3416292.html