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 #221 gtdadoli 2019-02-13 16:27
what is cymbalta used for cymbalta weight loss
Quote
0 #220 hhialeme 2019-02-13 08:57
cymbalta withdrawal symptoms maximum dose of cymbalta cymbalta generic cymbalta alternatives
Quote
0 #219 fgaiwhile 2019-02-13 02:13
cymbalta lawsuit cymbalta 30 mg reviews cymbalta generic what time of day should i take cymbalta
Quote
0 #218 brswhorm 2019-02-13 01:19
alcohol and lexapro lexapro pros and cons lexapro vs prozac lexapro reviews weight gain
Quote
0 #217 gcsClura 2019-02-12 10:42
does lexapro cause weight gain lexapro anxiety
Quote
0 #216 iikFrize 2019-02-10 17:54
is there generic viagra viagra natural generic for viagra
Quote
0 #215 bbialeme 2019-02-10 02:00
best place to buy viagra online reviews generic viagra reviews get a viagra prescription online
Quote
0 #214 bbiwhile 2019-02-09 21:10
buying cheap cialis online buy tadalafil online buying cialis online safely
Quote
0 #213 ffrwhorm 2019-02-09 19:16
where to buy cialis cialis reviews buying cialis online usa
Quote
0 #212 fefagets 2019-02-08 19:33
buy viagra online with paypal buy viagra online without prescription buy viagra online canadian
Quote
0 #211 ffhBiobe 2019-02-08 14:51
cialis online no prescription cialis 20 mg п»їcialis online
Quote
0 #210 ggoHaurb 2019-02-08 14:41
buying viagra online legally viagra online pharmacy buying viagra online safe
Quote
0 #209 bbsClura 2019-02-08 09:25
can you buy viagra online viagra online where can i buy viagra
Quote
0 #208 jjiFrize 2019-02-07 21:27
where to buy viagra online safely canadian viagra buy viagra online
Quote
0 #207 czzrinty 2019-02-07 17:28
purchase generic viagra viagra uk sales pictures of generic viagra
Quote

Add comment


Security code
Refresh