Just a small list of code snippets that might be useful:
Extracting domains from file with tldextract (Python)
Extracting page content with LWP::Simple (Perl)
Sending http Post requests with LWP::UserAgent (Perl)