summaryrefslogtreecommitdiffstats
path: root/shotrss
authorRaghavendra D Prabhu <[email protected]>2011-03-12 18:54:47 (GMT)
committer Raghavendra D Prabhu <[email protected]>2011-03-12 18:54:47 (GMT)
commit5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a (patch) (side-by-side diff)
treedeabb15393558ab3a1a629fc0782d8b0c3124c48 /shotrss
downloadScripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.zip
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.gz
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.bz2
Initial scripts update
Diffstat (limited to 'shotrss') (more/less context) (ignore whitespace changes)
-rwxr-xr-xshotrss18
1 files changed, 18 insertions, 0 deletions
diff --git a/shotrss b/shotrss
new file mode 100755
index 0000000..e304f5b
--- a/dev/null
+++ b/shotrss
@@ -0,0 +1,18 @@
+#!/bin/zsh
+
+file="$HOME/.newsbeuter/urls"
+lines=$(wc -l $file | cut -d " " -f 1)
+linum=$(( $RANDOM%$lines ))
+url=$(sed -n -e ${linum}p $file | awk '{ print $1 }')
+dbfile="$HOME/.local/share/newsbeuter/cache.db"
+
+material=$(sqlite3 -separator ' | ' $dbfile "select title,url from rss_item where feedurl='$url' ORDER BY pubDate DESC LIMIT 5;" |\
+ sed -n -e $(( $RANDOM % 5 + 1 ))p)
+echo "$material"
+exec &>/dev/null
+pidof w3m || exit 0
+winum=$(~/bin/tux tnum w3m)
+#tmux send-keys -t uake:$winum 'C-c' 'o' "${material[(ws:|:)2]}" 'Enter'
+tmux send-keys -t uake:$winum 'C-c' 'T' "${material[(ws:|:)2]}" 'Enter'
+
+