I usually use DuckDuckGo search engine WEB API because it do not required key or any sort of logging, and it has good information about websites and so on...
With Import function we can do the WEB API call and get the message as Wolfram language associations
Just to check info, we can plot the text from related topics, according the JSON message data structured provided by DuckDuckGo web service
In[]:=
ddg=Import["https://api.duckduckgo.com/?q=Nicola+Tesla&format=json","RawJSON"];
Framed[#["Text"]]&/@ddg["RelatedTopics"]//Column
Out[]=
We can inspect the DuckDuckGo message data with a dataset:
Dataset[ddg]
Out[]=
This is a function to parse DuckDuckGo message and create a notebook and highlights some details such as abstract, image and related links (and make it clickable):
In[]:=
ddgQuery[query_String]:=Module[{ddgMessage=Import["https://api.duckduckgo.com/?format=json&q="<>URLEncode[query],"RawJSON"]},CellPrint[Flatten@{TextCell[ddgMessage["Heading"],"Section"],TextCell[ddgMessage["Abstract"],"Text"],TextCell[Import["https://www.duckduckgo.com/"<>ddgMessage["Image"]],"Text"],TextCell[Row[{#["Text"]," ",Hyperlink["»",#["FirstURL"]]}],"Item"]&/@ddgMessage["RelatedTopics"]}]]
Now test the function searching for Nicola Tesla info.
Any hint to make it better will be appreciated! :-)
Any hint to make it better will be appreciated! :-)
In[]:=
ddgQuery["Nicola Tesla"]
Nikola Tesla
Nikola Tesla
Nikola Tesla was a Serbian-American inventor, electrical engineer, mechanical engineer, and futurist best known for his contributions to the design of the modern alternating current electricity supply system. Born and raised in the Austrian Empire, Tesla studied engineering and physics in the 1870s without receiving a degree, gaining practical experience in the early 1880s working in telephony and at Continental Edison in the new electric power industry. In 1884 he emigrated to the United States, where he became a naturalized citizen. He worked for a short time at the Edison Machine Works in New York City before he struck out on his own. With the help of partners to finance and market his ideas, Tesla set up laboratories and companies in New York to develop a range of electrical and mechanical devices.
◼
Nikola Tesla Category