|
@@ -32,6 +32,9 @@ title_xpath = './/h2//a//text()'
|
32
|
32
|
content_xpath = './/p//text()'
|
33
|
33
|
pubdate_xpath = './/time'
|
34
|
34
|
|
|
35
|
+digg_cookie_chars = string.ascii_uppercase + string.ascii_lowercase +\
|
|
36
|
+ string.digits + "+_"
|
|
37
|
+
|
35
|
38
|
|
36
|
39
|
# do search-request
|
37
|
40
|
def request(query, params):
|
|
@@ -39,9 +42,7 @@ def request(query, params):
|
39
|
42
|
params['url'] = search_url.format(position=offset,
|
40
|
43
|
query=quote_plus(query))
|
41
|
44
|
params['cookies']['frontend.auid'] = ''.join(random.choice(
|
42
|
|
- string.ascii_uppercase +
|
43
|
|
- string.ascii_lowercase +
|
44
|
|
- string.digits + "+_") for _ in range(22))
|
|
45
|
+ digg_cookie_chars) for _ in range(22))
|
45
|
46
|
return params
|
46
|
47
|
|
47
|
48
|
|