LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-15-2012, 05:50 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Rep: Reputation: 88
Basic RSS Feed bash / python code to reformat to text?


Hi

would you have a code to convert with python or feedparser or bash the following rss to text?


add("http://feeds.bbci.co.uk/news/rss.xml?edition=int")
add("http://rss.slashdot.org/slashdot/Slashdot")
add("http://reddit.com/.rss")
add("http://kerneltrap.org/node/feed")
add("http://codezen.org/canto/feeds/latest")


Thank you
 
Old 08-15-2012, 08:32 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
Please use ***[code][/code] tags*** around your code and data, to preserve formatting and to improve readability. Please do not use quote tags, bolding, colors, or other fancy formatting.

You'll also need to be more specific. How are you accessing this text? What command(s) did you use, and how is it supposed to be read? Is this the exact input you get, or does it come wrapped in a larger block? What exactly is the "text" you need to extract? The urls? How should the output be stored/printed/whatever?

Since this appears to come down to simple text parsing, there are any number of ways to go about it. A simple grep, sed, or awk should be able to handle it, as can the shell or any other programming language. But the exact procedure depends on the details.

For example, assuming the above is a uniform example of the input:

Code:
yourrsscommand | awk -F '"' '{ print $2 }'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Shell read out RSS Feed newest Title Tealk144 Programming 4 02-02-2012 02:02 PM
RSS feed in iGoogle anupamsr LQ Suggestions & Feedback 3 04-06-2008 12:49 PM
Looking for RSS & Atom Feed (News Feed)? suse2166 Linux - Software 2 11-16-2006 05:58 PM
Zero Posts RSS Feed Matir LQ Suggestions & Feedback 11 09-09-2005 08:24 AM
RSS feed. paul_dundee Linux - Software 2 03-18-2005 04:46 PM


All times are GMT -5. The time now is 09:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration