[kupfer: 1/8] Add DuckDuckGo Search plugin to search securely using DuckDuckGo
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer: 1/8] Add DuckDuckGo Search plugin to search securely using DuckDuckGo
- Date: Fri, 11 Nov 2011 15:41:12 +0000 (UTC)
commit 4b3f56ca8c16934da8d23fc689b3cbffa1f08f5b
Author: Isaac Aggrey <isaac aggrey gmail com>
Date: Wed Jun 8 11:29:58 2011 -0500
Add DuckDuckGo Search plugin to search securely using DuckDuckGo
kupfer/plugin/duckduckgo_search.py | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/duckduckgo_search.py b/kupfer/plugin/duckduckgo_search.py
new file mode 100644
index 0000000..03b18a4
--- /dev/null
+++ b/kupfer/plugin/duckduckgo_search.py
@@ -0,0 +1,34 @@
+"""
+This is a DuckDuckGo search plugin initially modified from the Wikipedia search
+plugin
+"""
+
+__kupfer_name__ = _("DuckDuckGo HTTPS Search")
+__kupfer_sources__ = ()
+__kupfer_actions__ = ("DuckDuckGoSearch",)
+__description__ = _("Search securely with DuckDuckGo")
+__version__ = "0.1"
+__author__ = "Isaac Aggrey <isaac aggrey gmail com>"
+
+import urllib
+
+from kupfer.objects import Action, TextLeaf
+from kupfer import utils, plugin_support
+
+class DuckDuckGoSearch (Action):
+ def __init__(self):
+ Action.__init__(self, _("Search securely with DuckDuckGo"))
+
+ def activate(self, leaf):
+ search_url="https://duckduckgo.com/"
+ query_url = search_url + "&" + urllib.urlencode({"q" : leaf.object})
+ utils.show_url(query_url)
+
+ def item_types(self):
+ yield TextLeaf
+
+ def get_description(self):
+ return _("Search securely for this term in DuckDuckGo")
+
+ def get_icon_name(self):
+ return "edit-find"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]