Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 893 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 893 Bytes

ylecomments v1

Python package for fetching comments from Yle Comments API

POSTing comments is not supported at this time. Support for this is unlikely.

Installation

pip install ylecomments

Example usage

from ylecomments import ylecomments

# Get comments for a specific article
# https://yle.fi/a/74-20023410
article = ylecomments.YleArticle("74-20023410")
comments = article.get_approved_comments()

# Print the first comment
print(comments[0].content)

# Print the comment author's name
print(comments[0].author)

# Print the amount of likes the comment has
print(comments[0].likes)

# Other attributes:
# rejectedAt, children, content, likes, acceptedAt, createdByModerator,
# author, topicExternalId, id, parentId, topCommentId, authenticatedAuthor,
# topicId, createdAt, createdByTrustedCommentAuthor, createdByCommentator,
# isModerationReply