Examples of SyndFeedInput


Examples of com.sun.syndication.io.SyndFeedInput

    public Message invoke(Message msg) {
        try {
            logger.fine("invoke " + uri);

            // Read an RSS feed into a Synd feed
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(new URL(uri)));
           
            //FIXME Support conversion to data-api entries
           
            msg.setBody(feed);
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedInput

import es.java.otro.model.Entry;
import es.java.otro.model.Feed;

public class RssUtil {
  public static Feed createFeed(String feedUrl) throws OtroException {
    SyndFeedInput input = new SyndFeedInput();
    SyndFeed feed = null;
    try {
      feed = input.build(new XmlReader(new URL(feedUrl)));
    } catch (Exception e) {
      MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Load Error", "Unable to load "
          +feedUrl+" ("+e.getMessage()+")");
     
    }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedInput

    protected SyndFeed loadOrCreateFeed() throws IllegalArgumentException, FeedException, IOException {
        if (isLoadOnStartup()) {
            File file = getFeedFile();
            if (file.exists() && file.isFile()) {
                SyndFeedInput input = new SyndFeedInput();
                XmlReader xmlReader = new XmlReader(file);
                return input.build(xmlReader);
            }
        }
        return createFeed();
    }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedInput

        }
    }

    protected List getLastesEntries() {
        List result = new ArrayList();
        SyndFeedInput input = new SyndFeedInput();
        for (int i = 0;i < urls.size();i++) {
            URL inputUrl = (URL) urls.get(i);
            SyndFeed inFeed;
            try {
                inFeed = input.build(new XmlReader(inputUrl));
                List entries = inFeed.getEntries();
                for (int k = 0;k < entries.size();k++) {
                    SyndEntry entry = (SyndEntry) entries.get(k);
                    if (entry.getPublishedDate().after(getLastPolledDate())) {
                        result.add(entry);
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedInput

public class FeedInput {
     
    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

Examples of com.sun.syndication.io.SyndFeedInput

    return operations;
  }
 
  protected SyndFeed fetchFeedFromURL(URL feedUrl) throws UpdateException
  {
    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

Examples of com.sun.syndication.io.SyndFeedInput

        return sb;
    }

    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

Examples of com.sun.syndication.io.SyndFeedInput

    postNewsToEchoareaSinceX(title, echoarea, URL, new Date(date));
  }

  private void postNewsToEchoareaSinceX(String title, String echoarea,
      String URL, Date x) {
    SyndFeedInput feedInput = new SyndFeedInput();
    Echoarea area = FtnTools.getAreaByName(echoarea, null);
    if (area == null) {
      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

Examples of com.sun.syndication.io.SyndFeedInput

        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

Examples of com.sun.syndication.io.SyndFeedInput

        return out.outputString(feed);
    }  
   
    @Converter
    public static SyndFeed xmlToFeed(String xml) throws FeedException {
        SyndFeedInput input = new SyndFeedInput();
        return input.build(new StringReader(xml));
    }
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.