Grab Packt With Groovy
Automatically claim Packt's free e-books with a Groovy program. Introduction Packt Publishing has launched a new programme called " free learning offer "; each day they put an e-book for free on their website to download: one only needs to login to Packt's website and click on the "claim your free book" link. Following Grab Packt with Racket, here is the Groovy version, to automatically add the e-book to your Packt account for later downloads. The Code The code is in public domain. You can get it directly from is.gd/isbviw or from my github gist . For this to work you need to replace YOUR-EMAIL-ADDRESS (line 26) and YOUR-PASSWORD (line 27) with reasonable values. If you wish to run this from shell/cron remember to add #! /usr/bin/env groovy to the top of the file. The script is completely self-contained as @Grab annotation on line 4 fetches the dependencies it requires. /** * @author Bahman Movaqar */ @Grab('org.jsoup:jsoup:1.8.2') i...