Script to find free domains from a txt file.
- PostgreSQL
- Tokio
Add .env file with data for the database as well as the absolute project path:
DATABASE_NAME=[database_name]
DATABASE_USER=[database_user]
DATABASE_PASSWORD=[database_password]
PROJECT_PATH=[/absolute/project/path/domain_analyzer/]
Tip: use Posgresql super user to allow importing files with copy.
create table if not exists "domains" ("id" serial, "domain" text);
create index dd on domains(domain);
cargo run [OPTIONS]
Options:
setup:cargo run setup, stores the data in the database.create_combinations.create_combinations:cargo run create_combinations, creates work combinations, expensive.
If you have a large source file —ICANN .txt file for .com domains is over 24GB—, split it by lines. This will result in several smaller text files. Save the resulting files into icann/ folder:
split -l 20000000 ./com.txt ./icann/
After saving the files, erform cargo run setup: the raw data off each file will be cleaned, saved into the database and removed from icann/ folder.
cargo run setup
When all files are loaded, it is recommended to ensure that ./src/source_files/domains_available.txt is empty.
rm ./src/source_files/domains_available.txt
touch ./src/source_files/domains_available.txt
Provide list of desired words at:
- ./src/source_files/dictionary_glossary.txt.
- ./src/source_files/dictionary_prefixes.txt.
- ./src/source_files/dictionary_suffixes.txt.
Execute with or without options
cargo build
cargo run [OPTIONS]
Results for available domain names will be stored on ./src/source_files/domains_available.txt