소스 검색

Don't quote_plus() the query.

tags/v0.2
Ben Kurtovic 9 년 전
부모
커밋
5890ee6e6a
1개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. +4
    -5
      earwigbot/wiki/copyvios/search.py

+ 4
- 5
earwigbot/wiki/copyvios/search.py 파일 보기

@@ -23,7 +23,6 @@
from gzip import GzipFile
from json import loads
from StringIO import StringIO
from urllib import quote_plus

from earwigbot import importer
from earwigbot.exceptions import SearchQueryError
@@ -64,9 +63,9 @@ class YahooBOSSSearchEngine(BaseSearchEngine):
def search(self, query):
"""Do a Yahoo! BOSS web search for *query*.

Returns a list of URLs, no more than fifty, ranked by relevance (as
determined by Yahoo). Raises
:py:exc:`~earwigbot.exceptions.SearchQueryError` on errors.
Returns a list of URLs, no more than five, ranked by relevance
(as determined by Yahoo).
Raises :py:exc:`~earwigbot.exceptions.SearchQueryError` on errors.
"""
key, secret = self.cred["key"], self.cred["secret"]
consumer = oauth.Consumer(key=key, secret=secret)
@@ -77,7 +76,7 @@ class YahooBOSSSearchEngine(BaseSearchEngine):
"oauth_nonce": oauth.generate_nonce(),
"oauth_timestamp": oauth.Request.make_timestamp(),
"oauth_consumer_key": consumer.key,
"q": quote_plus(query.encode("utf8")), "count": 5,
"q": query.encode("utf8"), "count": 5,
"type": "html,text", "format": "json",
}



불러오는 중...
취소
저장