get_post_meta: Retrieve mata data from an individual PTT post

Description Usage Arguments Value Examples

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

Description

get_post_meta returns a data frame with 1 row and 4 cols.

Usage

1
get_post_meta(post_xml, board_col = FALSE)

Arguments

post_xml

xml_document created by read_html2 or read_html. See read_html for details.

board_col

Logical. Whether to set board name as a variable. Defaults to FALSE. Note you can get the board name with attributes{df}$board or attr(df, "board") regardless of the value of this argument.

Value

A data frame with 1 row and 4 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.

Examples

1
2
3
4
5
6
#url <- "https://www.ptt.cc/bbs/Gossiping/M.1534415307.A.BE5.html"

#post_meta <- get_post_meta(read_html2(url))
#post_meta

#attributes(post_meta)$board

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