21 lines
710 B
Python
21 lines
710 B
Python
import asyncio
|
|
import aiohttp
|
|
from wallabag_api.wallabag import Wallabag
|
|
from helpers import load_configuration, connect_to_wallabag
|
|
|
|
async def get_paginated_entries(w_api: Wallabag, per_page: int, page: int):
|
|
return await w_api.get_entries(perPage=per_page, page=page)
|
|
|
|
|
|
async def main(path: str, per_page=10):
|
|
async with aiohttp.ClientSession(loop=asyncio.get_event_loop()) as session:
|
|
configuration = dict(load_configuration(path))
|
|
w_api = await connect_to_wallabag(configuration, session)
|
|
|
|
for page in range(1, 10):
|
|
entries = await get_paginated_entries(w_api, per_page, page)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main("config.ini"), debug=True)
|