Skip to content

Instantly share code, notes, and snippets.

View perezp44's full-sized avatar

Pedro J. Pérez perezp44

View GitHub Profile
@perezp44
perezp44 / find_lyrics.R
Last active March 28, 2017 10:01
function that find lyrics in chartlyrics API
library(httr)
library(RCurl)
library(XML)
df <- data.frame(artist = c('Led Zeppellin', 'Adele'), song = c('Rock´n roll', 'Hello'), stringsAsFactors = F)
make.querrye <- function(xx) {
names_ok <- gsub(" ", "&", xx)
names_ok2 <- paste("\'", names_ok, "\'", sep = '')
querrye <- paste("http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=", names_ok[1],"&song=", names_ok[2], sep='')
@perezp44
perezp44 / prueba_0
Last active February 3, 2020 16:34
una prueba
my_fun <- function(aa, bb){
aa + bb
}
@perezp44
perezp44 / resize_thumbnails.R
Created November 16, 2022 12:35
script to resize thumbnails for a Quarto blog
#- script para hacer un resize de las imagenes de los posts
my_thumbnail <- here::here("posts", "thumbnails", "thumbnail_01.png")
img <- magick::image_read(my_thumbnail)
img_resized <- img |> magick::image_scale("740x426!")
#- guardo la foto reescalada a 640x427
magick::image_write(img_resized, my_thumbnail)