Skip to content

Instantly share code, notes, and snippets.

@DGZN
Last active December 3, 2023 15:44
Show Gist options
  • Save DGZN/11588c0ead968a1bdb0f0de37badefac to your computer and use it in GitHub Desktop.
Save DGZN/11588c0ead968a1bdb0f0de37badefac to your computer and use it in GitHub Desktop.
Find person by name in public datasets
# Simple bash script to search fastpeoplesearch
#
# SETUP
# curl -sL https://bit.ly/3PFCGWh -o ~/records-search.sh && chmod +x records-search.sh && ~/records-search.sh
#
# https://bit.ly/3PFCGWh redirects to https://gist.githubusercontent.com/DGZN/11588c0ead968a1bdb0f0de37badefac/raw/
#
#!/bin/bash
name=""
function find_name_combined {
echo Searching Public Records for [$name]
dir="~/.local/share/recordsearch/$name-RECORDS"
if [ -d "$dir" ];
then
rm -rf $dir
fi
mkdir -p ~/.local/share/recordsearch/$name-RECORDS
echo "Searching FastPeopleSearch.com"
curl -s https://www.fastpeoplesearch.com/name/$name | html2text > ~/.local/share/recordsearch/$name-RECORDS/$name-fastpeoplesearch.com.txt
echo "---- FINISHED SEARCHING PUBLIC DATA SOURCES -----"
cat ~/.local/share/recordsearch/$name-RECORDS/$name* > ~/.local/share/recordsearch/$name-RECORDS/$name-combined-data.txt
cat ~/.local/share/recordsearch/$name-RECORDS/$name-combined-data.txt | sed -e "s/(\/.*/)/#/" | sed -e 's/\[//g; s/\]//g; s/)//g; s/(//g; s/*.*//g' | less
}
function find_name {
name=`echo $name | sed -e 's/ /-/g' | tr [a-z] [A-Z]`
find_name_combined $name
}
function get_name {
echo Hello, who would you like to find?
read varname
echo Ok, lets find $varname
name=$varname
}
function find_from_file {
cat $name | while read line
do
name=`echo $line | sed -e 's/ /-/g' | tr [a-z] [A-Z]`
find_name $name
done
}
if ! grep -Fxq recordsearch ~/.bashrc; then
echo "Creating recordsearch alias"
echo alias recordsearch="bash ~/records-search.sh" >> ~/.bashrc && source ~/.bashrc
fi
if [ "$#" -lt 1 ]; then
get_name
else
for i
do
name+=" $i"
done
fi
if [[ "$name" == *".txt" ]]; then
find_from_file $name
else
echo "FINDING $name"
find_name $name
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment