aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV.Krishn <vkrishn4@gmail.com>2021-12-12 15:48:47 +0530
committerV.Krishn <vkrishn4@gmail.com>2021-12-12 15:48:47 +0530
commit3578de6704dd2bee17d1942976060c1a6390c36d (patch)
treeb576842e5297f94749edcba483f99d1f5f062e33
parent6bc52fea8c37b7ee6e9536572244b7f4681ba387 (diff)
downloadnbreader-3578de6704dd2bee17d1942976060c1a6390c36d.tar.bz2
add ability to redo missed/unreachable urls
-rw-r--r--run.sh11
-rw-r--r--scripts/fetch.sh1
-rw-r--r--scripts/update.sh7
3 files changed, 16 insertions, 3 deletions
diff --git a/run.sh b/run.sh
index 2156a51..32bd080 100644
--- a/run.sh
+++ b/run.sh
@@ -39,11 +39,11 @@ if [ "$1" = 'newsbeuter' ]; then
echo ''
fi
echo '---------------------------------'
- db=$2;
+ db=$2
if [ "$db" = '' ]; then
echo "Defaulting to news db"
echo '---------------------------------'
- db='news';
+ db='news'
fi
if [ -f "$DBDIR/$db.loc.db" ]; then
## examples/execs
@@ -55,13 +55,18 @@ fi
#usage: sh run.sh update tag|folder|url|hash <relevant data>
if [ "$1" = 'update' ]; then
source $SCRIPTDIR/update.sh
- rm -f $COOKIEFILE;
+ rm -f $COOKIEFILE
+ missedlst='/tmp/nbreader.missed.lst'
case $2 in
tag) update_by_tag $2 $3;;
folder) update_by_tag $2 $3;;
url) update_by_url $2 $3;;
hash) update_by_hash $2 $3;;
+ missed)
+ update_by_hashlist $@
+ rm -f $missedlst
+ ;;
esac
_when=$2
diff --git a/scripts/fetch.sh b/scripts/fetch.sh
index eb2bab3..3b18910 100644
--- a/scripts/fetch.sh
+++ b/scripts/fetch.sh
@@ -132,6 +132,7 @@ fetch_url() {
echo -e ${cRED}'msg: not a xml/rss document'${cNORMAL};
fi
else
+ echo $URLSUM >> $missedlst
echo -e ${cRED}'msg: url unreachable'${cNORMAL};
fi
else
diff --git a/scripts/update.sh b/scripts/update.sh
index 49a9fb0..5fda980 100644
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -259,6 +259,13 @@ update_by_taglist() {
echo '--'
}
+update_by_hashlist() {
+ if [ -s "$missedlst" ]; then
+ printf "${cBWHITE}update::missed-hash-list ->${cNORMAL} $f\n"
+ cat $missedlst | while read line; do update_by_hash 'hash' $line; done
+ fi
+}
+
update() {
echo '--'
}