?
Solved

feed .rss/.rdf files from a random news web-site

Posted on 2003-02-21
5
Medium Priority
?
232 Views
Last Modified: 2013-11-18
Hi all,
   How do I feed a .rss or .rdf file from a random news web-site, so that I can get the headlines and description for the headlines in my java application?

Any help would be helpful,
Thanks,
mrpatel
0
Comment
Question by:mrpatel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 400 total points
ID: 7997018
i don't know what an .rss or .rdf file is, but i know you can use a URLConnection to read a file from a webserver.

ie (untested code):

BufferedReader in = null;

try {
    URL myURL = new URL("http://www.someserver.com/blah.rss");
    URLConnection conn = myURL.openConnection();
   
    in = new BufferedReader (new InputStreamReader(conn.getInputStream());

    String s;
    String myFile = "";

    while ((s = in.readLine()) != null) {
         myFile += s;
    }

    System.out.println(myFile);
    in.close();
} catch (Exception e) {
    e.printStackTrace();
}
0
 

Expert Comment

by:CleanupPing
ID: 9059153
mrpatel:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 9072051
recommendation: points to bobbit31
0
 
LVL 7

Expert Comment

by:tomboshell
ID: 9582260
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept bobbit31's comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thomas Boshell
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question