-
Notifications
You must be signed in to change notification settings - Fork 122
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
icon metadata access #429
Comments
+1 |
Perhaps I could do something about this. Where is the metadata stored now? |
I just scraped all the tags and descriptions for all icons. Here's the tsv file. It won't remain up to date for long but here's the R code that did it if you want a version for yourself. Also helpful for #539 library(rvest)
library(glue)
library(dplyr)
library(magrittr)
iconNames = list.files('icons/',recursive = TRUE) %>%
tools::file_path_sans_ext() %>%
stringr::str_replace('/svg/','/')
iconNames = iconNames[!grepl('license',iconNames)]
allTags = list()
allDescriptions = list()
for(icon in iconNames[1:length(iconNames)]){
print(icon)
page = read_html(glue('https://game-icons.net/{icon}.html'))
tags =page %>%
html_nodes('a[rel="tag"]') %>%
html_text()
allTags[[icon]] = tags
description = page %>% html_node('.description') %>% html_text(trim=TRUE)
allDescriptions[[icon]] = description
}
allTags %>%
sapply(function(x){paste(x,collapse = '|')}) ->
mergedTags
data.frame(name = names(mergedTags),
tags = mergedTags,stringsAsFactors = FALSE,
description = allDescriptions %>% unlist) ->
tagFrame
readr::write_tsv(tagFrame,'iconTags.txt') |
Open
Here is a cleaned up JSON file of the metadata organm linked above: game-icons-metadata.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it'd be nice to have a file that lists icon names and their tags for out of website querying.
The text was updated successfully, but these errors were encountered: