get_post: Get all information from an individual PTT post

Description Usage Arguments Value

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

Description

get_post returns a data frame with 1 row and 9 cols, where the column comment is a list column.

Usage

1
get_post(post_url, board_col = FALSE)

Arguments

post_url

Character. An URL of a PTT post.

board_col

Logical. Whether to set board name as a variable. Defaults to FALSE.

Value

A data frame with 1 row and 10 variables:

author

Author of the post.

category

Category of the post, such as "xin wen", "wen gua", "Re:".

title

Title of the post.

date

The date of the post.

content

The content of the post.

comment

A list column. See get_post_comment for information about entries in this list column.

n_comment

Number of comments.

n_push

Number of "Push" comments.

n_boo

Number of "Boo" comments.

link

URL of the post with https://www.ptt.cc/bbs/ removed.

One additional variable is optional:

board

The board the post belongs to. Exist only if board_col = TRUE.


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