Skip to content

Commit 7cb71ad

Browse files
authored
Merge pull request #1 from terenaa/optimal
Removed \t from end of book filename
2 parents 53ec906 + 0de17e9 commit 7cb71ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ rm -f $cookie packt*.html
2323
log "Packt web login"
2424

2525
# web login
26-
curl -s --retry $rtry -m $tout -A "$agent" -b "$cookie" -c "$cookie" -d "email=$userid" -d "password=$pwd" -d "op=Login" -d "form_build_id=form-73ba86bbfb2a50719049129632c84810 " -d "form_token=2f1d586bf7df196b77d0761709d03199" -d "form_id=packt_user_login_form" https://www.packtpub.com
26+
curl -s --retry $rtry -m $tout -A "$agent" -b "$cookie" -c "$cookie" --data-urlencode "email=$userid" -d "password=$pwd" -d "op=Login" -d "form_build_id=form-73ba86bbfb2a50719049129632c84810 " -d "form_token=2f1d586bf7df196b77d0761709d03199" -d "form_id=packt_user_login_form" https://www.packtpub.com
2727
cex=$?; test "$cex" -ne "0" && { log "curl exit error code: $cex"; exit; }
2828

2929
# daily free e-book
3030
curl -s --retry $rtry -m $tout -A "$agent" -b "$cookie" -c "$cookie" https://www.packtpub.com/packt/offers/free-learning > packt_daily.html
3131
cex=$?; test "$cex" -ne "0" && { log "curl exit error code: $cex"; exit; }
3232

33-
title=$(grep "dotd-title" -A 2 packt_daily.html | tail -1 | sed 's/^[^0-9A-Za-z]*//;s/[\t ]*<\/h2>$//')
33+
title=$(grep "dotd-title" -A 2 packt_daily.html | tail -1 | sed 's/^[^0-9A-Za-z]*//;s/[\t ]*<\/h2>$//' | awk '{$1=$1};1')
3434
log "Today's free e-book: $title"
3535

3636
# claim

0 commit comments

Comments
 (0)