getpost: Get a list of posts, intelligently filtered by tag specified...

Description Usage Arguments Value Examples

View source: R/getpost.R

Description

This function can make request THE MUSE API with "posts" endponit to get a list of advice posts. The results it will return include the amount of posts that meet the criteria, the name of the post, the excerpt, its tags, its author, the reference link, etc.

Usage

1
getpost(page = NULL, decending = NULL, tag = NULL, apikey = NULL)

Arguments

page

The page number to load (required).

decending

Whether to show descending results(default value: FALSE).

tag

Only show posts for a specific tag, please refer to the vignette to find proper available tags.

apikey

Pass your own API key can increase the rate limit from 500 to 3600 per hour.

Value

A named list with the following elements:

message

a list of messages including the number of results in specified pages, total number of results returned by the API

response

a list of API-specific response values in JSON format, including the name of the post, the excerpt, its tags, its author, the reference link, etc. At this time, no further coercion is performed, so you may have to use functions from the jsonlite package to extract the desired output. Or you can refer to the "cleanpost" function in this package to get a clean dataframe with some key information of list of posts.

Examples

1
2
3
## Not run: 
getpost(page = 1, tag = "Tools & Skills")
## End(Not run)

brandywwy/Rmuse documentation built on Aug. 12, 2019, 1:49 p.m.