Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

search-by-surname

License listed on awesome-spain


An R script that prepares batch lookups in Spanish public telephone directories by surname. It scrapes a list of Bulgarian surnames, adds their feminine forms, scrapes the ABCtelefonos index pages of six regions and writes both to numbered text files that you then search by hand.

Originally written during the early days of COVID-19 (2020) and released publicly in 2025.

Features

  • Two directory services -- builds ABCtelefonos index URLs for each region; the Guiatel/Infobel URL builder is present but commented out, so those files hold only surnames.
  • Gender-aware surname variants -- generates feminine forms for surnames following Slavic naming conventions (appending -a to surnames ending in -v).
  • Batch file generation -- splits the lists into numbered batch files for manual querying.
  • Multi-region coverage -- targets six Spanish provinces/regions in a single run: Zaragoza, Murcia, Granada, Asturias, Almería and Albacete.
  • Web scraping -- extracts the surname list and the directory indexes with rvest.

Quick start

You need R with tidyverse, rvest and stringi. Clone the repo, edit the write_lines() paths in search.R (they point at a Windows Google Drive folder) and create the three setwd() folders (~/Cuarentena/Almeria, ~/Cuarentena/Albacete, ~/Cuarentena/Granada) or edit those lines, then in R:

install.packages(c("tidyverse", "rvest", "stringi"))
source("search.R")

What the script writes and its limits: Usage.

Documentation

  • Usage: dependencies, what the script writes, regions and sources, and its limitations.

Disclaimer

This tool queries publicly available telephone directory services. It is provided strictly for educational and research purposes. Users are responsible for complying with all applicable laws and the terms of service of the queried platforms. The author assumes no liability for misuse.

Automated scraping of directory services may violate their terms of service. Use responsibly and at your own risk.

License

GPL-3.0-or-later

Releases

Sponsor this project

Packages

Used by

Contributors

Languages