Skip to content

Fixed errors #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Imports:
dplyr,
magrittr,
purrr,
spotifyr
RoxygenNote: 7.3.1
Suggests:
Expand Down
2 changes: 1 addition & 1 deletion R/search_tracks_by_term.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ search_tracks_by_term <- function(search_term, wasAssociatedWith) {
#Selecting year of reference
all_tracks_df$isrc_year <- substr(all_tracks_df$isrc, 6, 7)

prov <- provenance_statement(startedAtTime = startedAtTime, endedAtTime = Sys.time(), wasAssociatedWith = )
prov <- provenance_statement(startedAtTime = startedAtTime, endedAtTime = Sys.time(), wasAssociatedWith = wasAssociatedWith)

attr(all_tracks_df, "provenance") <- prov

Expand Down
51 changes: 51 additions & 0 deletions vignettes/search_tracks_by_term.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "search_track_by_term"
author: "Fabio Vieira"
date: "2024-09-12"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## The function

The function search_track_by_terms is supposed to search Spotify API for tracks that contain the term being search. The function only takes on two parameters

- **search_term**: a string containing the term being search (ex: "Olho")
- **wasAssociatedWith**: the ORCID of the person performing the query.

## Example

# Loading packages

```{r}
library(here)
library(spotifyr)
library(openmusesampling)
if (file.exists(here("_not_included", "myenviron.R"))) {
source(here("_not_included", "myenviron.R"))
}
```

Running a query (this might take several minutes to run)

```{r}
df <- search_tracks_by_term(search_term = "Olho",
wasAssociatedWith = "https://orcid.org/0000-0003-4253-1953")
```

## Output

Checking the results

```{r}
head(df)
```

Additional information about the query (i.e. who perform the query, at what time, and so on)

```{r}
attr(df, "prov")
```
Loading