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="https://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="https://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="https://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="https://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 #7 otfsmwtpcw 2014-12-02 05:04
elkswgsjfoetdps ofs, rcmtfhsdvk , ynpqtllpjo: https://www.jwwamkbydd.com/, https://www.uqvzgigmwp.com/ rcmtfhsdvk
Quote
0 #6 Cure Plantar 2014-09-30 08:00
Punjab Kesari
Cure Plantar Fasciitis for Beginners: https://www.rebelmouse.com/cureplantarfasciitis/

https://friendscorner.info/index.php?option=com_content&view=article&id=73:e-paper-linux-shell-scripts&catid=79&Itemid=501
Quote
0 #5 https:// 2014-03-07 07:26
Awesome article.
Quote
0 #4 phentermine 2014-03-07 01:09
Increase the amount of cooked vegetables and raw fruits you are daily consuming.
Daily food monitoring will help you make a diet plan that
is more nutritious and has a lower calorific value. In this way you will lower the blood sugar level back to normal.
Quote
0 #3 Deer Antler Spray 2014-03-05 08:40
What's up to every one, the contents existing at this site are genuinely awesome
for people experience, well, keep up the nice work fellows.
Quote
0 #2 melatonin 2014-03-04 19:09
A large number of patients respond very well to what is known
as "cognitive behavioral therapy". It is a condition
in which you face great difficulty in falling asleep.
While many long for a simple cure, such as melatonin for insomnia, unfortunately, not all of the studies at this point do not back up the claims.
Quote
0 #1 Horny Goat Weed 2014-03-04 05:31
We are a gaggle of volunteers and opening a new scheme in our community.
Your site provided us with useful info to work on.
You have performed a formidable activity and our entire group will be grateful to you.
Quote

Add comment


Security code
Refresh