formid=$(curl -b cookies -c cookies -s https://www.packtpub.com/ | grep 'form_build_id'| head -n 1| grep -Eo 'value="[^"]*"'| sed -E 's@value="(.*)"@\1@')
curl -b cookies -c cookies -s -F 'email=ChristianLupus@web.de' -F 'form_id=packt_user_login_form' -F 'password=naitsirhc' -F 'op=Login' -F "form_build_id=$formid" https://www.packtpub.com/ > /dev/null
#echo 'Obtaining free book information'
title=$(curl -b cookies -c cookies -s https://www.packtpub.com/packt/offers/free-learning | awk '/<h2>/,/<\/h2>/'| tr -d '\n\r\t'| grep -Po '<h2>.*?</h2>'| head -n 1| sed 's@<h2>\(.*\)</h2>@\1@')