Finding companies that no longer exist

dsperling
Member

After importing our contacts into HubSpot, we realized that we had a number of created companies that no longer existed.  Finding them manually in 2000 total companies tedious.  Also, we could not rely on the lack of a company icon to identify these as not all companies receive a logo on import.

In talking with our onboarding specialist we realized that a quick Bash script would do the work.

 

Here is the process:

1. Go to HubSpot Companies and export all companies to a Excel file (XLSX).

2. Open the file and delete all columns except for the "Company domain"

3. Save it to a new domains.csv file via "Save as..."

4. (required on Mac/Linux) Open the file with an editor and change all CRLF line endings to LF

5. Run the following script:  "./dead-companies.sh"

Contents of dead-companies.sh:

#!/bin/bash
while read domain; do
  URL="http://$domain"
  curl --silent --output /dev/null --max-time 15 "$URL"
  if [ $? -ne 0 ]; then
    URL="https://$domain"
    curl --silent --output /dev/null --max-time 15 "$URL"
    if [ $? -ne 0 ]; then
      echo "$domain"
    fi
  fi
done < domains.csv
 
This scans each domain and prints out the dead domains that fail both an HTTP and HTTPS request.
Improvements could be made to call the HubSpot API to get the list of domains.
2 Replies 2
kvlschaefer
Community Manager
Community Manager

This is great! Thanks for sharing this time-saving tip with the Community, @dsperling


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Upvotes
danmoyle
Most Valuable Member | Platinum Partner
Most Valuable Member | Platinum Partner

Nice! I'll have to keep this in mind when others ask for this! 

 

Did my answer help? Please "mark as a solution" to help others find answers. Plus I really appreciate it!

I use all tools available to help answer questions. This may include other Community posts, search engines, and generative AI search tools. But I always use my experience and my own brain to make it human.


linkedininstagram

Dan Moyle

Solutions Consultant

Digital Reach Online Solutions
emailAddress
daniel@digitalreachopm.com
website
https://www.digitalreachos.com/