Simple RSS news reader for the terminal

Forum Forums General Tips and Tricks Simple RSS news reader for the terminal

Tagged: 

  • This topic has 1 reply, 2 voices, and was last updated Jan 17-12:07 pm by ile.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #129517
    Member
    PPC

      First: I’m aware that antiX includes a Command Line Rss reader.
      Second: While developing a script to manage Conky, and allow it to display a RSS feed, I noticed that functionality seems broken in antiX 23. So I took a look around the web to get ideas about how to get RSS feeds to be outputed using a simple script, that I could then try to run inside Conky. This lead me to a tiny but efficient script, that works on some (but not all) rss feeds:

      
      #! /bin/bash
      #Script to download and display RSS pages, without using web browsers. Works in the terminal, but the end result file can be shown on the terminal or in a GUI
      #User choices:
      LINES=15 #number of headlines to show
      #URL="https://rtp.pt/noticias/rss" #web page to be used as source (Portuguese news)
      URL="https://antixlinux.com/blog/feed" #web page to be used as source (antiX news)
      #Download RSS web page:
      wget -O /tmp/page.txt $URL
      #Parse result to obtains only titles contained in webpage (adapted from https://how-to.fandom.com/wiki/How_to_add_an_RSS_feed_to_Conky/conky-rss.sh) 
      cat /tmp/page.txt| grep title |\
      sed -e :a -e 's/<[^>]*>//g;/</N' |\
      sed -e 's/[ \t]*//' |\
      sed -e 's/\(.*\)/ \1/' |\
      sed -e 's/\.//' |\
      sed -e 's/\"//' |\
      sed -e 's/\"//' |\
      sed 's/&quot;/"/g'  |\
      sed '/&#8211/d'  |\
      head -n $(($LINES + 2)) |\
      tail -n $(($LINES)) > /tmp/parsed_page.txt
      #Display the file that stores the result:
      cat /tmp/parsed_page.txt
      #129532
      Member
      ile

        it works.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.