Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedInput.build()


     
    public List parse(String url, int size) throws Exception {
        List entries = new ArrayList();
        URL feedSource = new URL(url);
        SyndFeedInput input = new SyndFeedInput();
        SyndFeed feed = input.build(new XmlReader(feedSource));
        int i = 0;
       
        for(Object f : feed.getEntries()) {
            if(i == size)
                break;
View Full Code Here


  {
    SyndFeedInput sfi = new SyndFeedInput();
    SyndFeed feed;
   
    try {
      feed = sfi.build(new XmlReader(feedUrl));
    } catch (IllegalArgumentException e) {
      throw new UpdateException("Unknown type of update feed", e);
    } catch (FeedException e) {
      throw new UpdateException("Error while parsing update feed", e);
    } catch (IOException e) {
View Full Code Here

    private static String load(List<SyndEntry> entries, String url, String watermark, int limit) throws IOException, FeedException {
        String lastWatermark = null;
        SyndFeedInput feedInput = new SyndFeedInput();

        SyndFeed feed = feedInput.build(new XmlReader(new URL(url)));

        int max = limit > 0 ? Math.min(feed.getEntries().size(), limit) : feed.getEntries().size();
        for (int i = 0; i < max; ++i) {
            SyndEntry entry = (SyndEntry) feed.getEntries().get(i);
View Full Code Here

      logger.l4("No such echoarea - " + echoarea);
      return;
    }
    StringBuilder sb = new StringBuilder();
    try {
      SyndFeed feed = feedInput.build(new XmlReader(new URL(URL)));
      if (feed.getPublishedDate() != null && x.after(feed.getPublishedDate())) {
        logger.l4("There's no new entries at " + URL);
        return;
      }
View Full Code Here

        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

    }  
   
    @Converter
    public static SyndFeed xmlToFeed(String xml) throws FeedException {
        SyndFeedInput input = new SyndFeedInput();
        return input.build(new StringReader(xml));
    }
}
View Full Code Here

    }
   
    public static SyndFeed createFeed(String feedUri) throws Exception {
        InputStream in = new URL(feedUri).openStream();
        SyndFeedInput input = new SyndFeedInput();
        return input.build(new XmlReader(in));
    }
}
View Full Code Here

            // 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

    }

    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

    }

    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

TOP
Copyright © 2018 www.massapi.com. 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.