Skip to content

Commit 0abf60d

Browse files
author
Isaac G
committed
Changed tumblr url location and fixed tweetread multi-url handling
1 parent c7045db commit 0abf60d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tumblr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
c="${1:- 0}"
44

55
urls=$(
6-
grep 'http.*tumblr' /mnt/sda1/urls.txt \
6+
grep 'http.*tumblr' /mnt/sda1/tumblr.urls \
77
| sed 's/ .*//' | sed "s/^/'/;s/\$/'/" \
88
| tr '\n' ',' | sed 's/,$//'
99
)
@@ -15,6 +15,7 @@ urls=$(
1515
titles+=("$title")
1616
done
1717

18+
unset TMOUT
1819
pause=20
1920
for ((; c < ${#urls[@]}; c++)) ; do
2021
i="${urls[c]}"
@@ -41,4 +42,4 @@ urls=$(
4142
firefox -new-tab "$i"
4243
done
4344
} 3< <( printf ".separator ' |'\nSELECT i.url,f.title,i.title FROM rss_item AS i JOIN rss_feed AS f ON i.feedurl = f.rssurl WHERE unread = 1 AND deleted = 0 AND feedurl IN (%s) ORDER BY pubDate ASC;" "$urls" \
44-
| sqlite3 /mnt/sda1/newsbeuter.cache.db )
45+
| sqlite3 /mnt/sda1/tumblr.cache.db )

tweetread

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ print () {
4747
printf "%s%d/%d %s%s%s\n" "$_red" $((index+1)) $max "$color" "${lines[index]}" "$_def"
4848

4949
# Find all URLs and xclip them
50-
urls=""
50+
urls=()
5151
for word in ${lines[index]} ; do
5252
! [[ $word = http* || $word = www* ]] && continue
53-
[[ $urls ]] && urls="$urls|$word" || urls="$word"
53+
urls+=("$word")
5454
done
5555
[[ $urls ]] && {
56-
xclip -i <<< "$urls"
57-
printf "%s URL copied: %s%s\n" "$_magenta" "$urls" "$_def"
56+
xclip -i <<< "${urls[@]}"
57+
for i in "${urls[@]}" ; do printf "%s URL copied: %s%s\n" "$_magenta" "$i" "$_def" ; done
5858
}
5959

6060
(( ${#save[@]} )) && printf "%d saved items" ${#save[@]}
@@ -94,7 +94,7 @@ while read -sN1 ; do
9494
print
9595
;;
9696
[of]) # Open with ff
97-
firefox "$urls"
97+
for i in "${urls[@]}" ; do firefox "$i" ; done
9898
((index < max - 1 && index++)) # Advance to next item on save
9999
print
100100
;;

0 commit comments

Comments
 (0)