Adding digg paging

This commit is contained in:
Israel Yago Pereira 2022-01-28 09:20:49 -03:00
parent f09017c956
commit 2eb3a41155
1 changed files with 7 additions and 1 deletions

View File

@ -22,18 +22,24 @@ about = {
# engine dependent config
categories = ['news', 'social media']
paging = False
paging = True
base_url = 'https://digg.com'
results_per_page = 10
# search-url
search_url = base_url + (
'/search'
'?{query}'
'&size={size}'
'&offset={offset}'
)
def request(query, params):
offset = (params['pageno'] - 1) * results_per_page + 1
params['url'] = search_url.format(
query = urlencode({'q': query}),
size = results_per_page,
offset = offset,
)
return params