A smooth sea never made a skilled sailor. - Franklin D. Roosevelt
Hi Pythonistas, a new week, a new 'bite' of Python coding :)
This week we will do some web scraping. As you might know Packt gives away a free ebook every (!) single day. In this challenge you will scrape that page and send out a notification to never miss an interesting title.
But it gets better: the guys from Pybonacci (great Spanish Python science blog) partnered up with Packt:
@Pybonacci Inviting you to participate in our free eBook initiative next week, including a donation to a tech charity of your choice.— Packt (@PacktPub) June 1, 2017
So taking this challenge you get to promote the awesome Python community, isn't that cool?
The challenge is to make a script that scrapes the free learning link every day for meta data about the book (title, description, cover, promo time left).
Then have the script share this info together with this affiliation link: https://www.packtpub.com/packt/offers/free-learning?utm_source=Pybonacci&utm_medium=referral&utm_campaign=FreeLearning2017CharityReferrals to your favorite channel: email, Twitter, Facebook, reddit, slack, etc.
That's it for the basic requirements. You probably want to put this in OS cron or you can use Dan Bader's schedule package.
If you really want to challenge yourself, you could have the script login to your Packt account and click the 'Claim Your Free eBook', making it fully automated. It might not be easy because they use a CAPTCHA, but hey we like a good challenge, right? It would definitely be a useful tool and a good skill to add.
This doc also provides you with instructions how you can submit your code to our community branch via a Pull Request (PR). We will feature your PRs in our end-of-the-week challenge review (previous editions).
Last but not least: there is no best solution, only learning more and better Python. Good luck!
Keep Calm and Code in Python!
-- Bob and Julian
Do you want to get 250+ concise and applicable Python tips in an ebook that will cost you less than 10 bucks (future updates included), check it out here.
"The discussions are succinct yet thorough enough to give you a solid grasp of the particular problem. I just wish I would have had this book when I started learning Python." - Daniel H
"Bob and Julian are the masters at aggregating these small snippets of code that can really make certain aspects of coding easier." - Jesse B
"This is now my favourite first Python go-to reference." - Anthony L
"Do you ever go on one of those cooking websites for a recipe and have to scroll for what feels like an eternity to get to the ingredients and the 4 steps the recipe actually takes? This is the opposite of that." - Sergio S