Detecting opportunities
In this chapter, we are presenting a marketing campaign divided into several tasks:
- Detect the best moment to launch the campaign
- Generate individual codes to be sent to potential customers
- Send the codes directly to users over their preferred channel, text message or email
- Collect the results of the campaign
- Generate a sales report with an analysis of the results
This recipe covers task 1.
Our first task is to detect the best time to launch a campaign. To do so, we will monitor a list of news sites, searching for news containing one of our defined keywords. We add any article that matches these keywords to a report and send it in an email.
Getting ready
In this recipe, we will use several external modules previously presented in this book, delorean
, requests
, and BeautifulSoup
. We need to add them to our virtual environment if they're not already there:
$ echo "delorean==1.0.0"...