Forum rules
General talk about software - if the program is not in the repos, please links to the developer's page or github.
-
wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
-
Contact:
Unread post
by wuxmedia » Wed Mar 02, 2016 9:05 am
Probably could be done better, but an exercise in sed and newlines and shit:
dumped line by line to a tmp file and read by i3 bar.sh, or anything really...
Code: Select all
#!/bin/bash
## BBC RSS ripper, to a file read by /bin/bar.sh
while :
do
RSS=$(curl --silent "http://feeds.bbci.co.uk/news/rss.xml?edition=uk" | grep -E '(title>|description>)' | grep -v "BBC News" | sed -e 's/<\/[^>]*>/\n/g' -e 's/<[^>]*>//g' | sed '/^\s*$/d' | sed -e 's/^[ \t]*//')
IFS=$'\n'
for i in $RSS
do
echo -ne "$i | " > /tmp/rss.feed
sleep 11s
done
sleep 100s
done
for the i3 bar.sh:
Not entirely sure if the nested 'for' loops actually work, I guess if it's the same news all day, it doesn't work :)
-
wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
-
Contact:
Unread post
by wuxmedia » Wed Mar 02, 2016 9:29 am
wow, and a scrot, you guys are LUCKY!
-
wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
-
Contact:
Unread post
by wuxmedia » Wed Mar 02, 2016 3:32 pm
^ thanks, looks like I do get updated news, so that's nice