aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV.Krishn <vkrishn4@gmail.com>2020-02-05 05:14:51 +0530
committerV.Krishn <vkrishn4@gmail.com>2020-02-05 05:14:51 +0530
commitc1df1e448f795eeee319b1a06d97f4d2747eee51 (patch)
treeba9d636d08b8a3444da1d9c0bead7b0c9d1d4fa6
parenta897256cbb6c987be6176ff106a4e351788b929f (diff)
downloadnbreader-c1df1e448f795eeee319b1a06d97f4d2747eee51.tar.bz2
fix minor bug in fetch icon routines
-rw-r--r--scripts/feedicon.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/feedicon.sh b/scripts/feedicon.sh
index de3b2a5..83f3d11 100644
--- a/scripts/feedicon.sh
+++ b/scripts/feedicon.sh
@@ -49,15 +49,16 @@ get_siteurl_from_db() {
local query="SELECT url FROM rss_feed WHERE rssurl LIKE '%$hash%' LIMIT 1;"
rssurl=$(echo "$query" | sqlite3 "$db")
+ parse_url $FEEDSURL; local lhost=$host
parse_url $rssurl
- if [ "$host" = 'localhost' ]; then
+ if [ "$host" = "$lhost" ]; then
rssurl='';
query="SELECT rssurl FROM rss_url WHERE sha1sum='$URLSUM';";
rssurl=$(echo "$query" | sqlite3 "$CONFIGDIR/urls.db");
fi
parse_url $rssurl
- if [ "$host" = 'localhost' ]; then rssurl=''; fi
+ if [ "$host" = "$lhost" ]; then rssurl=''; fi
echo -e "$hash --> $rssurl";
}
@@ -71,9 +72,9 @@ parse_feed_icon_url() {
ICONURL=$(cat "$localHtml" | grep -i "rel\=[\"\']icon" )
fi
ICONURL=$(echo "$ICONURL" |
- grep -i -o "href\=\(.*\)" | tr -d '"' | tr -d "'" | \
+ grep -i -o "href\=\(.*\) " | \
sed -e "s/href//" \
- -e "s/\"//g" \
+ -e 's/\"//g' \
-e "s/'//g" \
-e "s/\=//" \
-e "s/>.*$//g"