carlcarl / aiodcard

Dcard(https://www.dcard.tw) crawler using asyncio(coroutine)

Home Page:http://aiodcard.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aiodcard

https://travis-ci.org/carlcarl/aiodcard.svg?branch=master https://coveralls.io/repos/carlcarl/aiodcard/badge.svg?branch=master&service=github

Dcard crawler using asyncio(coroutine)

Feature

Get article list and content using coroutine

Dependencies

Installation

python setup.py install

or

pip install aiodcard

Example

import asyncio

import aiohttp
import aiodcard

@asyncio.coroutine
def get_funny_articles():
    session = aiohttp.ClientSession()
    forum_name = 'funny'
    page_index = 1
    result = yield from aiodcard.get_articles_of_page(session, forum_name, page_index)
    print(result)

def main():
    loop = asyncio.get_event_loop()
    loop.run_until_complete(get_funny_articles())

if __name__ == '__main__':
    main()

Authors and License

The aiodcard package is written by Chien-Wei Huang. It’s MIT licensed and freely available.

Feel free to improve this package and send a pull request to GitHub.

About

Dcard(https://www.dcard.tw) crawler using asyncio(coroutine)

http://aiodcard.readthedocs.org/en/latest/

License:MIT License


Languages

Language:Python 99.2%Language:Makefile 0.8%