mwaldstein / edgarWebR

R package for interacting with the SEC's EDGAR filing search and retrieval system
https://mwaldstein.github.io/edgarWebR/
Other
78 stars 16 forks source link

accession number missing from company_filings #15

Open Sbirch556 opened 4 years ago

Sbirch556 commented 4 years ago

I noticed the company search page was down Friday night 7/3/2020. Appears and update has been done to the RSS feeds.

aapl <- company_filings(
  x = "AAPL"
)

Returning the attached screenshot for me.

webedgarR_git

Sbirch556 commented 4 years ago

Looks like they finally updated accession nunber to accession number. Small update to the company filings function is able to fix this issue.

company_filings <- function(x,
                         ownership = FALSE,
                         type = "",
                         before="",
                         count = 40,
                         page = 1) {
  doc <- if (is(x, "xml_node")) {
           x
         } else {
           browse_edgar(x,
                        ownership = ownership,
                        type = type,
                        before = before,
                        count = count,
                        page = page)
         }

  entries_xpath <- "entry"

  info_pieces <- list(
    "accession_number" = "./content/accession-number", # update made, nunber -> number
                                                       # number was previously misspelled until 7/3/2020
    "act" = "./content/act",
    "file_number" = "./content/file-number",
    "filing_date" = "./content/filing-date",
    "accepted_date" = "./updated",           # By inspection, updated = accepted
    "href" = "./content/filing-href",
    "type" = "./content/filing-type",
    "film_number" = "./content/film-number",
    "form_name" = "./content/form-name",
    "description" = "./content/items-desc",
    "size" = "./content/size"
    )

  res <- map_xml(doc, entries_xpath, info_pieces)

  return(res)
}