From 043673760a7bf50a4fee58d01b7f9742c7243197 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 9 Oct 2007 13:54:47 +0000 Subject: [PATCH] Google.ru and Yandex search. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@70 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- phd_pp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phd_pp.py b/phd_pp.py index 1352b18..603211a 100644 --- a/phd_pp.py +++ b/phd_pp.py @@ -1,4 +1,4 @@ -import os, re, time +import os, re, time, urllib from Cheetah.Template import Template @@ -91,3 +91,9 @@ class phd_pp(Template): return """\ %(img_name)s-thumbnail.jpg
800x600, 1024x800""" % {"img_name": img_name} + + def google_ru(self, query): + return "http://www.google.ru/search?hl=ru&ie=utf-8&oe=utf-8&q=%s" % urllib.quote_plus(unicode(query, "koi8-r").encode("utf-8")) + + def yandex(self, query): + return "http://www.yandex.ru/yandsearch?text=%s&rpt=rad" % urllib.quote_plus(unicode(query, "koi8-r").encode("cp1251")) -- 2.39.5