This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
library(jsonlite) | |
library(xml2) | |
library(rvest) | |
library(stringr) | |
library(dplyr) | |
pages <- c( | |
"ASApedia/Glosario", | |
"ASApedia/Agua Verde", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("2024/gig") | |
library(readxl) | |
require(tidyverse) | |
require(rvest) | |
# https://www.un.org/development/desa/dpad/least-developed-country-category/ldc-data-retrieval.html | |
countries <- read_xlsx(path = "LDC_data.xlsx", sheet = 2, skip = 1) %>% select(3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(bibtex) | |
library(rvest) | |
library(dplyr) | |
require(stringr) | |
require(RefManageR) | |
require(lubridate) | |
bib <- read.bib(file = "items.bib") | |
bib_csv <- read.csv("items.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("C:/Users/rudes/Documents/2023/appropedia/data dump") | |
require(jsonlite) | |
require(data.table) | |
require(tidyverse) | |
base_url <- "https://www.appropedia.org/w/api.php?action=query&list=allpages&aplimit=500&format=json&apfrom=" | |
to_df <- function(apfrom="\"Backpack\"_Snap-fit_Clips"){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(httr) | |
require(jsonlite) | |
require(dplyr) | |
query_titles <- function(apfrom = ""){ | |
api_url <- paste0("https://www.appropedia.org/w/api.php?action=query&list=allpages&aplimit=500&format=json&apfrom=", apfrom) | |
res <- GET(api_url) | |
data = fromJSON(rawToChar(res$content)) | |
data_tibble = tibble(data$query$allpages) %>% filter(ns == 0) %>% select(title) | |
return(data_tibble) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(dplyr) | |
require(stringr) | |
require(xml2) | |
require(lubridate) | |
rss_feed = "" | |
## Script created with help from ChatGPT | |
find_all_mp3 <- function(rss_feed){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Wikimedia Commons Attribution | |
// @namespace http://emiliovelis.com | |
// @version 0.1 | |
// @description This script forms the markup code to use Wikimedia Commons images including attribution information. | |
// @require https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js | |
// @match https://*.wikimedia.org/* | |
// ==/UserScript== | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(tidyverse) | |
require(lubridate) | |
setwd("") # | |
files <- (Sys.glob("*.csv")) | |
topics <- lapply(files, read.csv, nrows=2, header=T, encoding="UTF-8") | |
topics <- lapply(topics, function(x) x["Topic"][1,]) %>% unlist() | |
ldf <- lapply(files, read.csv, skip=3, header=T, encoding="UTF-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit(0); | |
$pages = $_POST["the_text"]; | |
$pages_separated = explode(PHP_EOL,$pages); | |
$pages_separated = preg_replace("/\s/", "_", $pages_separated); | |
$pages_separated = preg_replace("/^_/", "", $pages_separated); | |
$pages_separated = preg_replace("/_$/", "", $pages_separated); | |
//echo json_encode($pages_separated)."\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(xml2, quietly=T) | |
require(tidyverse, quietly=T) | |
require(lubridate, quietly=T) | |
require(tidytext, quietly=T) | |
require(stringr, quietly=T) | |
pages <- read_xml("Appropedia-20210409194434.xml") | |
pages_list <- as_list(pages) | |
pages_tibble <- as_tibble( |
NewerOlder