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 #300 bfswhile 2019-03-30 13:26
http://canadiansapharmacyvgy.com - canadian pharmacy meds viagra patent canadian drug stores
Quote
0 #299 gerHaurb 2019-03-30 02:46
https://saresltd.com - buy cialis online overnight shipping viagra pill viagra online canadian pharmacy
Quote
0 #298 hhcrinty 2019-03-30 00:40
http://erectionjaen.com - costco online pharmacy real viagra for sale canadian online pharmacy
Quote
0 #297 wgwhorm 2019-03-29 07:21
http://genericcilaken.com/ - buy generic viagra brand name viagra online pharmacy viagra
Quote
0 #296 bdgIncub 2019-03-29 02:08
https://saresltd.com/sildenafil/ - canadian pharmacy king generic viagra sildenafil buy cialis online usa
Quote
0 #295 hsfaleme 2019-03-28 13:55
https://saresltd.com/cialis/ - how to buy cialis viagra story canadian pharmacy review
Quote
0 #294 bhyIncub 2019-03-28 07:52
https://saresltd.com/clomid/ - viagra online canadian pharmacy order viagra online online pharmacy
Quote
0 #293 ggeClura 2019-03-28 01:30
http://menedkkr.com/# - best canadian pharmacy real viagra for sale my canadian pharmacy
Quote
0 #292 hfgBiobe 2019-03-27 23:25
http://viagenericahecv.com - canadian pharmacy online buy generic viagra cvs online pharmacy
Quote
0 #291 bdgadoli 2019-03-27 16:07
http://sexviagen.com/# - cvs online pharmacy viagra soft tablets buy cialis canadian
Quote
0 #290 bgsHaurb 2019-03-27 03:23
http://cialisgretkjss.com/# - canadian pharmacy ratings cialis prescription online pharmacy india
Quote
0 #289 hrsagets 2019-03-27 02:16
http://valcialisns.com/ - canadian pharmacies viagra tablets canadian pharmacy generic viagra
Quote
0 #288 gsfrinty 2019-03-26 13:34
http://viagraveikd.com/# - when will generic viagra be available viagra jelly canadian pharmacy reviews
Quote
0 #287 bbtwhile 2019-03-26 10:30
http://viagraocns.com/# - best canadian pharmacy viagra soft tabs where to buy cialis online
Quote
0 #286 hwfFrize 2019-03-26 00:16
http://hopcialisraj.com/ - canadian pharmacies online mail order viagra canadian pharmacy online
Quote
0 #285 bfhIncub 2019-03-25 18:53
http://onlineviaqer.com/# - how to buy cialis low price viagra online canadian pharmacy
Quote
0 #284 ylmwhorm 2019-03-25 07:02
https://saresltd.com/kamagra/ - canadian pharmacy online viagra women canadian pharmacy
Quote
0 #283 bfgIncub 2019-03-25 00:28
http://viagranerrds.com/# - buy cialis online natural viagra substitutes canada drugs online
Quote
0 #282 bbiBiobe 2019-03-24 15:45
http://cialisserfher.com/# - buy cialis online reddit tadalafil online buy real cialis online
Quote
0 #281 tbjClura 2019-03-24 05:48
http://erectiledysfunctionmedicinesus.com/# - perscription drugs from canada viagra oral buy cialis online safely
Quote

Add comment


Security code
Refresh