Description Usage Arguments Value Examples
You can use following arguments to get/filter the PTT post data you want. Note that you need at least choose which board you want to crawl.
1 2 3 4 5 6 7 8 9 |
ptt.miner |
a R6 class object uses |
board |
a string. PTT board you want to crawl. |
keyword |
a string. The keyword you want to search on selected board. |
author |
a string. The post author you want to search on selected board. |
recommend |
a number. The number of net recommend you want to filter. |
min.date |
a date format string. The farthest date you want to set. |
last.n.page |
a number. The number of page you wnat to crawl. |
post_info_dt: the data.table type post's information.
post_comment_dt: the data.table type post's comments.
The result is store in miner_object$result_dt, but my
suggestion is don't modify the data in miner_object, use
export_ptt()
to get and analysis your data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # assume that rookie_miner is an object using `PTTmineR$new()` to create
# get all Gossiping posts
## Not run: rookie_miner %>%
mine_ptt(board = "Gossiping")
## End(Not run)
# get all Gossiping posts to filter by keyword 'youtuber'
## Not run: rookie_miner %>%
mine_ptt(board = "Gossiping", keyword = "youtuber")
## End(Not run)
# get all Gossiping posts to filter by keyword 'youtuber' and
# net recommend nuber 10.
## Not run: rookie_miner %>%
mine_ptt(board = "Gossiping", recommend = 10)
## End(Not run)
# if you want to do multiple crawling task on one eval,
# you can use multiple `%>%` :
## Not run: rookie_miner %>%
mine_ptt(board = "Gossiping", recommend = 10) %>%
mine_ptt(board = "Soft_job", keyword = "python")
## End(Not run)
# or use `purrr::pwalk()`:
## Not run: board_list <- c("Gossiping", "Soft_job", "Beauty")
pwalk(board_list, ~mine_ptt(board = .x, recommend = 10))
## End(Not run)
# why `pwalk()`? because all PTTmineR's functions are
# side-effect funciton. The data will return to rookie_miner.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.