get_post_comment: Retrieve user comments from an individual PTT post

Description Usage Arguments Value Examples

View source: R/scrape-post-helper.R

Description

get_post_comment returns a data frame with n rows and 5 cols, where n is the number of comments in the post.

Usage

1
get_post_comment(post_xml)

Arguments

post_xml

xml_document created by read_html2 or read_html See read_html for details.

Value

A data frame with n rows and 5 variables:

tag

tag of the comment, can be one of the 3 values: Push corresponds to "tui", Boo corresponds to "xu", and Neu corresponds to "bu tui bu xu"

user

ID of the user who left the comment.

comment

The content of the comment.

ip

ip address of the comment.

time

The comment date time.

Examples

1
2
3
4
#url <- "https://www.ptt.cc/bbs/Gossiping/M.1534415307.A.BE5.html"
#post <- read_html2(url)

#get_post_comment(post)

liao961120/pttR documentation built on Dec. 16, 2019, 2:19 a.m.