Integrated database check

Put main functionality into separate function that calls after a web
scrape according to a  boolean that switches true/false.