Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedInput


            Date timestamp = configDateFormatter.parse(lastchecktimestamp);
            // Turn feed dates into something we can process.
            DateFormat feedDateFormatter = DateFormat.getDateTimeInstance();
           
            // get the feed data from the supplied address           
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(new URL(rssaddress)));
            //System.out.println(feed);
           
            // check all the items to see if we have seen them before
            List entries = feed.getEntries();
            for(Object entry: entries){
View Full Code Here


        WireFeed wireFeed = this.feed.createWireFeed("atom_1.0");
        outputFeed(wireFeed);
    }

    public void testReadRss2() throws FeedException {
        SyndFeedInput input = new SyndFeedInput();

        SyndFeed result = input.build(new InputSource(getClass().getResourceAsStream("/be/hikage/xml/rome/rss_2.0.xml")));

        assertEquals("RSS Veille Techno", result.getTitle());
        assertEquals("http://svn.cyg.be/", result.getLink());
        assertEquals(1, result.getEntries().size());
    }
View Full Code Here

        assertEquals("http://svn.cyg.be/", result.getLink());
        assertEquals(1, result.getEntries().size());
    }

    public void testReadRss1() throws FeedException {
        SyndFeedInput input = new SyndFeedInput();

        SyndFeed result = input.build(new InputSource(getClass().getResourceAsStream("/be/hikage/xml/rome/rss_1_0.xml")));

        assertEquals("RSS Veille Techno", result.getTitle());
        assertEquals("http://svn.cyg.be/", result.getLink());
        assertEquals(1, result.getEntries().size());
    }
View Full Code Here

        assertEquals("http://svn.cyg.be/", result.getLink());
        assertEquals(1, result.getEntries().size());
    }

    public void testReadAtom1() throws FeedException {
        SyndFeedInput input = new SyndFeedInput();

        SyndFeed result = input.build(new InputSource(getClass().getResourceAsStream("/be/hikage/xml/rome/atom_1.0.xml")));

        assertEquals("RSS Veille Techno", result.getTitle());
        assertEquals("http://svn.cyg.be/", result.getLink());
        assertEquals(1, result.getEntries().size());
    }
View Full Code Here

        PortletPreferences prefs = request.getPreferences();
        String url = prefs.getValue("url", "http://www.npr.org/rss/rss.php?topicId=4");
        try
        {
            URL feedUrl = new URL(url);
            SyndFeedInput input = new SyndFeedInput();

            SyndFeed feed = input.build(new XmlReader(feedUrl));

            RssInfo rssInfo = new RssInfo(feed, new Integer(prefs.getValue("itemdisplayed", "15")).intValue(), new Boolean(prefs
                    .getValue("openinpopup", "true")).booleanValue(), new Boolean(prefs.getValue("showdescription", "true"))
                    .booleanValue(), new Boolean(prefs.getValue("showtitle", "true")).booleanValue(), new Boolean(prefs.getValue(
                    "showtextinput", "true")).booleanValue());
View Full Code Here

                WireFeedInput input = new WireFeedInput();
                feed = (Feed)input.build(new XmlReader(new URL(uri)));
            } else {

                // Read an RSS feed and convert it to an Atom feed
                SyndFeedInput input = new SyndFeedInput();
                SyndFeed syndFeed = input.build(new XmlReader(new URL(uri)));
                feed = (Feed)syndFeed.createWireFeed("atom_1.0");
            }
           
            //FIXME Support conversion to data-api entries
           
View Full Code Here

        PortletPreferences prefs = request.getPreferences();
        String url = prefs.getValue("url", "http://www.npr.org/rss/rss.php?topicId=4");
        try
        {
            URL feedUrl = new URL(url);
            SyndFeedInput input = new SyndFeedInput();

            SyndFeed feed = input.build(new XmlReader(feedUrl));

            RssInfo rssInfo = new RssInfo(feed, new Integer(prefs.getValue("itemdisplayed", "15")).intValue(), new Boolean(prefs
                    .getValue("openinpopup", "true")).booleanValue(), new Boolean(prefs.getValue("showdescription", "true"))
                    .booleanValue(), new Boolean(prefs.getValue("showtitle", "true")).booleanValue(), new Boolean(prefs.getValue(
                    "showtextinput", "true")).booleanValue());
View Full Code Here

                WireFeedInput input = new WireFeedInput();
                feed = (Feed)input.build(new XmlReader(new URL(uri)));
            } else {

                // Read an RSS feed and convert it to an Atom feed
                SyndFeedInput input = new SyndFeedInput();
                SyndFeed syndFeed = input.build(new XmlReader(new URL(uri)));
                feed = (Feed)syndFeed.createWireFeed("atom_1.0");
            }
            msg.setBody(feed);

        } catch (MalformedURLException e) {
View Full Code Here

                Logger.getLogger(FeedsFetcher.class.getName()).log(Level.SEVERE, null, ex);
            }
           
            try {
                // All feeds are  stored in it.
                feed = new SyndFeedInput().build(reader);
                latch = new CountDownLatch(feed.getEntries().size());
                thread_pool.registerLatch(latch);
               
            } catch (IllegalArgumentException ex) {
                Logger.getLogger(FeedsFetcher.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

      }
    }
    String feedUrl = sb.toString();
    URLConnection conn = ConnectionUtils.openReadConnection(feedUrl, username, password);
    InputStream is = conn.getInputStream();
    SyndFeedInput input = new SyndFeedInput();
    SyndFeed feed = null;
    try {
      feed = input.build(new XmlReader(is));
    } catch (FeedException f) {
      throw new GitBlitException(f);
    }
    is.close();
    List<FeedEntryModel> entries = new ArrayList<FeedEntryModel>();
View Full Code Here

TOP

Related Classes of com.sun.syndication.io.SyndFeedInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.