選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
Garrick Aden-Buie 83b9d4d169
udpate gitignore
3年前
R getting report sections, fixed getting document list 3年前
_targets getting report sections, fixed getting document list 3年前
.Rbuildignore getting report sections, fixed getting document list 3年前
.gitignore udpate gitignore 3年前
DESCRIPTION getting report sections, fixed getting document list 3年前
README.Rmd getting report sections, fixed getting document list 3年前
_targets.R getting report sections, fixed getting document list 3年前
nc-campaign-finance.Rproj getting report sections, fixed getting document list 3年前
run.R getting report sections, fixed getting document list 3年前

README.Rmd



https://cf.ncsbe.gov/CFDocLkup/DocumentResult/?year=2022&reports=%27RPQTR4%27

On election years: 2008, 2012, 2016, 2020
`https://cf.ncsbe.gov/CFDocLkup/DocumentResult/?year={year}&reports='RPQTR{quarter}'`

On non-election years:
```
https://cf.ncsbe.gov/CFDocLkup/DocumentResult/?year=2023&reports=%27RPMYSA%27%2C%20%27RPYESA%27
https://cf.ncsbe.gov/CFDocLkup/DocumentResult/?year=2023&reports=%27RPQTR1%27%2C%20%27RPQTR4%27%2C%20%27RPQTR2%27%2C%20%27RPQTR3%27
```


- `RPMYSA` - Mid-Year Semi-Annual Report
- `RPYESA` - Year-End Semi-Annual Report
- `RPQTR1` - 1st Quarter Report
- `RPQTR2` - 2nd Quarter Report
- `RPQTR3` - 3rd Quarter Report
- `RPQTR4` - 4th Quarter Report

```{r}
year <- 2022
reports <- "'RPQTR1', 'RPQTR4', 'RPQTR2', 'RPQTR3'"
url <- glue::glue("https://cf.ncsbe.gov/CFDocLkup/DocumentResult/?year={year}&reports={reports}")
```


## All documents by SBOE ID

Having all of the documents, we need the report ID for the reports listed above.

```
v--------v
https://cf.ncsbe.gov/CFOrgLkup/ReportSection/?RID=197247&SID=STA-8S285O-C-001
```

That links to the sections of the report, where you can click the "HTML View" of "All report sections":

```
https://cf.ncsbe.gov/CFOrgLkup/ReportDetail/?RID=197247&TP=ALL
```

At the top of that page is a link to the reports csv:

```
# all reports
https://cf.ncsbe.gov/CFOrgLkup/ExportDetailResults/?ReportID=197247&Type=ALL
# report cover
https://cf.ncsbe.gov/CFOrgLkup/ExportDetailResults/?ReportID=197247&Type=CVR
# detailed receipts
https://cf.ncsbe.gov/CFOrgLkup/ExportDetailResults/?ReportID=197247&Type=REC
# detailed expenditures
https://cf.ncsbe.gov/CFOrgLkup/ReportDetail/?RID=197247&TP=EXP
```