Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:56:11+00:00 2026-06-16T02:56:11+00:00

Possible Duplicate: How To Discover RSS Feeds for a given URL Given a URL,

  • 0

Possible Duplicate:
How To Discover RSS Feeds for a given URL

Given a URL, I’d like to know whether it’s a feed or not.

In Zend Framework, it is possible to import a URL as a feed:

try {
    $slashdotRss =
        Zend_Feed::import('http://rss.slashdot.org/Slashdot/slashdot');
} catch (Zend_Feed_Exception $e) {
    // feed import failed
    echo "Exception caught importing feed: {$e->getMessage()}\n";
    exit;
}

And if an exception is thrown, then I know the URL is not a feed.

I would like to do the same algorithm in Java, so my question is: How does Zend know whether a URL is a feed or not ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:56:12+00:00Added an answer on June 16, 2026 at 2:56 am

    What I’d do is get it to rome and try to parse it. If it fails to parse, it will throw a FeedException:

    public boolean tryFeed(String feedUrl) throws IOException,MalformedURLException { 
        SyndFeedInput input = new SyndFeedInput();
        SyndFeed feed = null;
        try {
            feed = input.build(new XmlReader(new URL(feedUrl)));
            return true;
        } catch (FeedException e) {
            // Feed's invalid
            return false;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: check whether internet connection is available with C# I just want to
Possible Duplicate: Can’t create handler inside thread that has not called Looper.prepare() inside AsyncTask
Possible Duplicate: Realloc is not resizing array of pointers Can anyone tell me where
Possible Duplicate: How to convert text to unicode code point like \u0054\u0068\u0069\u0073 using php?
Possible Duplicate: How do you like your primary keys? I'm aware of the benefits
Possible Duplicate: Model.find(1) gives ActiveRecord error when id 1 does not exist If there
Possible Duplicate: discover when the element is inserted to the std::map I track inserting
Possible Duplicate: Detect inside Android Browser or WebView i want to detect whether the
Possible Duplicate: Why do I see a double variable initialized to some value like
Possible Duplicate: Determine Whether Two Date Ranges Overlap I am trying to work out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.