Skip to main content

Python 2ch.hk API wrapper

Project description

Codacy Badge

2ch.hk API Wrapper

Requirements

  • Python (3.4, 3.5, 3.6)

Install

pip install api2ch

Usage

Getting threads on board

from api2ch import Api

api = Api('b')

board = api.get_board()

for thread in board:
print(f'Num: {thread.num}, Replies: {thread.reply_count}, Post: {thread.post.comment}')

Getting posts in thread

from api2ch import Api

api = Api('abu')

thread = api.get_thread(42375)

for post in thread:
print(post.comment)

Getting top of threads on board

from api2ch import Api

api = Api()

# board='доска', method='метод сортировки (views, score, posts), num=количество тредов
top = api.get_top(board='pr', method='posts', num=10)

for thread in top:
print(thread)

Bug tracker

Warm welcome for suggestions and concerns

https://github.com/anonim-legivon/dvach.api/issues

License

Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvach.api-0.0.4.1.tar.gz (5.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page