Skip to content

carlcarl/dcard_coworker

Repository files navigation

Deprecated!

Use aiodcard instead!!

dcard_coworker

Dcard crawler using asyncio(coroutine)

Feature

Get article list and content using coroutine

Dependencies

Installation

python setup.py install

or

pip install dcard_coworker

Example

import asyncio

import aiohttp
import dcard_coworker

@asyncio.coroutine
def get_funny_articles():
    session = aiohttp.ClientSession()
    forum_name = 'funny'
    page_index = 1
    result = yield from dcard_coworker.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()

Todo

  • test all functions

Authors and License

The dcard_coworker 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

[Deprecared: use aiodcard instead] Dcard crawler using asyncio(coroutine)

Resources

License

Stars

Watchers

Forks

Packages

No packages published