Package 'aznyan'

Title: An 'Utanet' Scraper and Utilities
Description: Scrape lyrics from 'Utanet' website.
Authors: Akiru Kato [aut, cre], Saurabh Shrivastava [ctb]
Maintainer: Akiru Kato <[email protected]>
License: MIT + file LICENSE
Version: 0.5.0
Built: 2024-11-20 05:36:03 UTC
Source: https://github.com/paithiov909/aznyan

Help Index


Log execution time of an expression

Description

An operator to evaluate an expression while logging its execution time.

Usage

lhs %timer% rhs

Arguments

lhs

An expression.

rhs

An expression.

Details

lhs %timer% rhs evaluates rhs inside a system.time call, assigns the execution time to the variable time, and tries to evaluate lhs in an environment where time exists. In doing so, failure to evaluate the left-hand side does not result in an error.

Value

Values from evaluated rhs is returned invisibly.

Examples

print(time) %timer% {
 rnorm(10) ^2
}

Scrape lyrics from list

Description

Scrape lyrics from list

Usage

get_lyrics(df, file, links = "link")

Arguments

df

A tibble that comes of get_lyrics_list.

file

String; file name to append lyrircs.

links

String; column name of lyrics links.

Value

file is returned invisibly.

Examples

## Not run: 
csv_file <-
 aznyan::get_lyrics_list("23729") |>
 aznyan::get_lyrics("23729.csv")
tbl <-
 readr::read_csv(csv_file, col_names = F, col_types = "cccc___cDn") |>
 dplyr::rename(
   title = X1,
   artist = X2,
   lyricist = X3,
   composer = X4,
   text = X8,
   released = X9,
   page_view = X10
 )

## End(Not run)

Scrape table of lyrics list

Description

Scrape table of lyrics list

Usage

get_lyrics_list(id, type = c("artist", "lyricist", "composer"))

Arguments

id

String; substring xxx of 'https://www.uta-net.com/:type:/xxx/'.

type

String; one of "artist", "lyricist", or "composer".

Value

tibble.


Read srt file

Description

Read srt file

Usage

read_srt(path, collapse = "\n")

Arguments

path

Path to srt file.

collapse

String.

Value

A tibble.


Search lyrics list by keyword

Description

Search lyrics list by keyword

Usage

search_lyrics_list(keyword, sort = c("new", "popular", "title", "artist"))

Arguments

keyword

String; search phrase.

sort

String; one of "new", "popular", "title", or "artist".

Value

tibble