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 #119 bhjrinty 2018-12-17 05:34
tadalafil generic cialis prescription online generic cialis best place to buy cialis online
Quote
0 #118 vfdwhorm 2018-12-16 20:25
cialis without prescription buy cialis from india cialis 20mg where can i buy viagra or cialis
Quote
0 #117 bnurinty 2018-12-16 15:43
cialis pills cialis online no prescription tadalafil liquid purchasing cialis online
Quote
0 #116 nykBiobe 2018-12-15 02:47
generic viagra generic viagra online pharmacy best price viagra generic viagra 100mg
Quote
0 #115 olpHaurb 2018-12-14 21:26
viagra dose when will viagra go generic purchase viagra viagra online canadian pharmacy
Quote
0 #114 iklrinty 2018-12-13 17:38
viagra uk sales generic viagra online canadian pharmacy viagra alternatives online viagra
Quote
0 #113 ujkInden 2018-12-13 17:01
viagra in canada viagra buy online how to get viagra generic viagra online
Quote
0 #112 bbjInden 2018-12-13 10:25
viagra information what is the generic name for viagra cheap viagra pills viagra generic
Quote
0 #111 nmnrinty 2018-12-13 03:28
viagra india generic viagra canada viagra without prescription does generic viagra work
Quote
0 #110 vdewhorm 2018-12-12 22:09
online order viagra cheap viagra online cheap generic viagra real viagra online
Quote

Add comment


Security code
Refresh