Skip to content

Commit

Permalink
Make sure all posts of given topic will be fetched (up to 1000 for now).
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Aug 11, 2019
1 parent 9bd20b7 commit 3c1bc88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ discodoc changelog

in progress
===========
- Make sure all posts of given topic will be fetched (up to 1000 for now).


2019-08-12 0.1.0
================
Expand Down
6 changes: 4 additions & 2 deletions discodoc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ def discourse_to_document(url, format=None, output_path=None):

format = format or 'pdf'

# Acquire posts from topic.
url = url + '.json'
# Acquire all posts from topic.
# Remark: The ``print=true`` option will return up to 1000 posts in a topic.
# API Documentation: https://docs.discourse.org/#tag/Topics%2Fpaths%2F~1t~1%7Bid%7D.json%2Fget
url = url + '.json?print=true'
response = requests.get(url)

# Extract information.
Expand Down

0 comments on commit 3c1bc88

Please sign in to comment.