Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
boB Rudis cacf682a85
refreshed some functions and setup pkg for expansion
pirms 4 gadiem
R refreshed some functions and setup pkg for expansion pirms 4 gadiem
man refreshed some functions and setup pkg for expansion pirms 4 gadiem
tests initial commit pirms 6 gadiem
.Rbuildignore refreshed some functions and setup pkg for expansion pirms 4 gadiem
.codecov.yml initial commit pirms 6 gadiem
.gitignore refreshed some functions and setup pkg for expansion pirms 4 gadiem
.travis.yml initial commit pirms 6 gadiem
CONDUCT.md initial commit pirms 6 gadiem
DESCRIPTION refreshed some functions and setup pkg for expansion pirms 4 gadiem
LICENSE refreshed some functions and setup pkg for expansion pirms 4 gadiem
LICENSE.md refreshed some functions and setup pkg for expansion pirms 4 gadiem
NAMESPACE refreshed some functions and setup pkg for expansion pirms 4 gadiem
NEWS.md initial commit pirms 6 gadiem
README.Rmd refreshed some functions and setup pkg for expansion pirms 4 gadiem
README.md refreshed some functions and setup pkg for expansion pirms 4 gadiem
pressur.Rproj initial commit pirms 6 gadiem

README.md

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. Signedby Signed commit% Linux buildStatus CoverageStatus Minimal RVersion License

pressur

Query and Orchestrate the ‘WordPress’ ‘API’

Description

‘WordPress’ has a fairly comprehensive ‘API’ https://developer.wordpress.com/ that makes it possible to perform blog orchestration (‘CRUD’ operations on posts, users, sites, etc.) as well as retrieve and process blog statistics. Tools are provided to work with the ‘WordPress’ ‘API’ functions.

<dalek_voice> YOU WILL O-BEY </dalek_voice>

WordPress API requiring authentication means you have to do the OAuth2 dance, and most API calls require authentication. That means you need to start off working with the WordPress API in/from pressur using the wp_auth() function. For that to work, YOU MUST::

=> Go here and make an app: https://developer.wordpress.com/apps/

=> Put the Client ID you receive into ~/.Renviron with a line that looks like:

`WORDPRESS_API_KEY=#####`

=> Put the Client Secret you receive into ~/.Renviron with a line that looks like:

`WORDPRESS_API_SECRET=Yn50ds........`

And start with a fresh R session for any of this to even have a remote possibility of working.

I’ll make friendlier documentation for ^^ in the near future.

NOTE

Only minimal functionality is provided at present (enough to get stats out).

You are encouraged to poke around the source and contribute PRs or issues for high priority items you’d like to see in the package.

What’s Inside The Tin

The following functions are implemented:

  • wp_about_me: Get metadata about the current user.
  • wp_auth: Authenticate to WordPress
  • wp_get_posts: Get all posts across all sites of the authenticated user
  • wp_post_stats: Retrieve statistics for a WordPress post
  • wp_site_info: Get information about a site
  • wp_site_stats: Get a site’s stats

Installation

remotes::install_gitlab("hrbrmstr/pressur")
# or
remotes::install_github("hrbrmstr/pressur")

NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.

Usage

library(pressur)

# current version
packageVersion("pressur")
## [1] '0.2.0'

Basic operation

library(hrbrthemes)
library(ggplot2)

wp_auth()

stats <- wp_site_stats()

ggplot(stats$visits, aes(period, views)) +
  geom_col(fill = ft_cols$slate) +
  scale_y_comma() +
  labs(x = NULL, y = "views", title = "Site Views") +
  theme_ipsum_gs(grid="Y")

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.