README.md

nexminer

https://nexushub.co/ provides and API to data mine several prices of in game items of the video game World of Warcraft Classic. The following tool simplifies R users to import the data or loop over several items. Please be reminded that all data is collected by the nexushub team and their development page can be visited here.

Install

devtools::install_github("gstephan30/nexminer")

Example

The following examples show how to import price trends of Black Lotus or Rugged Hide on the EU server Patchwerk Faction Horde:

library(nexminer)
library(patchwork)

server <- "patchwerk"
fraction <- "horde"

rh_raw <- import_item("rugged hide", server, fraction)
#> [1] "Reading data for rugged-hide on patchwerk horde"
rh_clean <- clean_json(rh_raw)
#> [1] "Cleaning raw json data"
p1 <- smooth_item(rh_clean)
p2 <- lm_item_wday(rh_clean)

p1 / p2

bl_raw <- import_item("Black LOTus", server, fraction)
#> [1] "Reading data for black-lotus on patchwerk horde"
bl_clean <- clean_json(bl_raw)
#> [1] "Cleaning raw json data"
p3 <- smooth_item(bl_clean)
p4 <- lm_item_wday(bl_clean)

p3 / p4

Or just loop over multiple items:

library(dplyr)
library(purrr)

flasks <- c("Flask of the Titans", "Flask of Distilled Wisdom", 
            "Flask of Supreme Power", "Flask of Chromatic Resistance",
            "Flask of Petrification")

flasks_df <- flasks %>%
  map_df(function (x)
    import_item(x, server, fraction) %>% 
      clean_json()
    )
#> [1] "Reading data for flask-of-the-titans on patchwerk horde"
#> [1] "Cleaning raw json data"
#> [1] "Reading data for flask-of-distilled-wisdom on patchwerk horde"
#> [1] "Cleaning raw json data"
#> [1] "Reading data for flask-of-supreme-power on patchwerk horde"
#> [1] "Cleaning raw json data"
#> [1] "Reading data for flask-of-chromatic-resistance on patchwerk horde"
#> [1] "Cleaning raw json data"
#> [1] "Reading data for flask-of-petrification on patchwerk horde"
#> [1] "Cleaning raw json data"

# count of times where flasks are captured
flasks_df %>% 
  count(item, sort = TRUE)
#> # A tibble: 5 x 2
#>   item                              n
#>   <chr>                         <int>
#> 1 Flask of the Titans            6085
#> 2 Flask of Supreme Power         6074
#> 3 Flask of Distilled Wisdom      5933
#> 4 Flask of Petrification          480
#> 5 Flask of Chromatic Resistance   420

flasks_df %>% 
  group_split(item) %>% 
  map(smooth_item) %>% 
  wrap_plots(ncol = 1)



gstephan30/nexminer documentation built on Jan. 25, 2021, 5:01 a.m.