Visitor counter, Heat Map, Conversion tracking, Search Rank

Punjab Kesari

 

Punjab Kesari 

#!/bin/bash

#Script to download epaper from punjabkesari

#Get user to select edition

 

############################################

# For Testing  purpose only , comment out when not in use

#if false

# then 

#   echo "Start"

#   read x

############################################

cd $HOME/some_directory/scripts/punjabkesari

sleep 1

export TZ=Asia/Calcutta

echo "Punjabkesari NewsPaper script started : $(date)" >> /$HOME/some_directory/mybackup.log

 

#spider the selected edition using wget to estimate number of pages

#define max incremental page limit

max_spider=100

echo "Estimating number of pages"

#start spider for main editon

 for ((  j = 1 ;  j <= $max_spider;  j++  ))

    do

      #prepend zero to single digits

      pageno=`printf "%02d" $j`  

      echo "Searching for Page $pageno"

      I_FILE="http://www.punjabkesari.com/E-Paper/Delhi/lo$j.pdf"

 debug=`wget --spider $I_FILE 2>&1`

 

 echo $debug

      if [[ $debug =~ .*link!!!.* ]]

      then

      break

      fi

done

clear

#decrement counter

(( j = j - 1 ))

npages_A=$j

echo "Estimating number of pages in  supplement"

 

#start spider for newapaper supplement

 for ((  j = 1 ;  j <= $max_spider;  j++  ))

    do

      #prepend zero to single digits

      pageno=`printf "%02d" $j`  

      echo "Searching for Page $pageno"

      I_FILE="http://www.punjabkesari.com/E-Paper/Magzine/adv_$j.pdf"

 debug=`wget --spider $I_FILE 2>&1`

 

 echo $debug

      if [[ $debug =~ .*link!!!.* ]]

      then

      break

      fi

done

clear

#decrement counter

(( j = j - 1 ))

npages_B=$j

 

ty_dir="./punjabkesari_delhi_`date +%d``date +%m``date +%Y`"

#mkdir to store individual pages

mkdir $ty_dir

echo "Please be patient..Bandwidth intensive operation starts..;-)"

echo "Downloading Main Paper .. total $npages_A pages"

    for ((  i = 1 ;  i <= npages_A;  i++  ))

    do

      #prepend zero to single digits

      pageno=`printf "%02d" $i`  

      echo "Downloading Page $pageno"

      O_FILE="$ty_dir/A$pageno.pdf"

      I_FILE="http://www.punjabkesari.com/E-Paper/Delhi/lo$i.pdf"

      wget  -O $O_FILE $I_FILE 

      

    done

    

echo "Downloading Supplement .. total $npages_B pages"

 

  for ((  i = 1 ;  i <= npages_B;  i++  ))

    do

      #prepend zero to single digits

      pageno=`printf "%02d" $i`  

      echo "Downloading Page $pageno"

      O_FILE="$ty_dir/B$pageno.pdf"

      I_FILE="http://www.punjabkesari.com/E-Paper/Magzine/adv_$i.pdf"

      wget  -O $O_FILE $I_FILE 

      

    done

   

#########################

# break

#fi

#echo "End"

#read x

########################

#intialize local variables here for testing only, comment out when not in use

########################

 

 

echo "Combining all pages into a single pdf document"

#combine multiple pdf files

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=punjabkesari_delhi_`date +%d``date +%b``date +%Y`.pdf -dBATCH $ty_dir/*

 

 

mv punjabkesari_delhi_`date +%d``date +%b``date +%Y`.pdf $HOME/some_directory/epapersPDF-ZIP/Hindi

 

 

#empty directory

rm $ty_dir/*.*

#remove directory

rmdir $ty_dir

 

echo "Punjabkesari NewsPaper uploaded : $(date)" >> $HOME/some_directory/mybackup.log

 

#########################

# To hold execution to check a code segment, comment out when not in use

# read x

 

########################

 


 

Comments   

0 #39 Bad Credit 2018-10-19 12:25
poor credit loans payday loans online same day loans com pay day loan bad credit
Quote
0 #38 Money Loan 2018-10-18 20:11
poor credit loans guaranteed approval poor credit loans guaranteed approval compare payday lenders credit loans
Quote
0 #37 Loans 2018-10-12 07:08
cash in minutes credit loans guaranteed approval bad credit loans credit loans
Quote
0 #36 Loans 2018-10-11 03:41
credit loans guaranteed approval bad credit short term loans payday loans work debt consolidation programs
Quote
0 #35 Payday Express 2018-10-09 01:32
credit loans guaranteed approval credit loans guaranteed approval bad credit loans credit loans guaranteed approval
Quote
0 #34 PaulinaJuicy 2018-08-10 19:10
Hello. I see that you don't update your website too often. I know that writing posts is time consuming and boring.
But did you know that there is a tool that allows
you to create new posts using existing content
(from article directories or other pages from your niche)?
And it does it very well. The new posts are high quality and pass the
copyscape test. You should try miftolo's tools
Quote
0 #33 Quick Loan 2018-06-06 15:21
bad credit payday lenders unsecured loan payday loans for poor credit loans
Quote
0 #32 Easy Payday Loan 2018-06-06 12:33
loans unsecured loans for bad credit unsecured loan http://creditloans.cars - secured loans
Quote
0 #31 Loans For Bad Credit 2018-06-06 11:28
36 month loans best funds secured loan http://creditloans.cars - loans unsecured
Quote
0 #30 Direct Lender Loans 2018-06-06 11:02
unsecured personal loan lenders network unsecured personal loans signature loan
Quote

Add comment


Security code
Refresh