Skip to content

Instantly share code, notes, and snippets.

@jolij
Forked from kikocorreoso/ddg_magic.py
Created March 27, 2016 00:14
Show Gist options
  • Save jolij/edb65047fe3eaa5e4e00 to your computer and use it in GitHub Desktop.
Save jolij/edb65047fe3eaa5e4e00 to your computer and use it in GitHub Desktop.
Duckduckgo magic for he IPython notebook
from IPython.display import IFrame
def ddg(self, arg):
phrase = arg.replace(' ', '+')
url = "https://duckduckgo.com/?&q={0}".format(phrase)
return IFrame(url, 600, 400)
ip = get_ipython()
ip.define_magic('ddg', ddg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment