Examples of Rss


Examples of com.hascode.tutorial.xbeam.projection.Rss

import com.hascode.tutorial.xbeam.projection.Rss;

public class RssFeedParsing {
  public static void main(final String[] args) throws IOException {
    System.out.println("loading rss feed..");
    Rss rss = new XBProjector().io().url("http://www.hascode.com/feed/").read(Rss.class);

    System.out.println("rss feed received - channel: " + rss.channel().title());
    rss.channel().items().forEach(i -> {
      System.out.println("title: " + i.title() + ", link: " + i.link());
    });
  }
View Full Code Here

Examples of com.netflix.recipes.rss.RSS

     */
    public Subscriptions getSubscriptions(String userId) throws Exception {
        List<String> feedUrls = store.getSubscribedUrls(userId);
        List<RSS> feeds = new ArrayList<RSS>(feedUrls.size());
        for (String feedUrl: feedUrls) {
            RSS rss = RSSManager.getInstance().fetchRSSFeed(feedUrl);
            if (rss.getItems() != null && !rss.getItems().isEmpty()) {
                feeds.add(rss);
            }
        }

        return new SubscriptionsImpl(userId, feeds);
View Full Code Here

Examples of com.netflix.recipes.rss.RSS

     */
    private RSS parseRSS(String url, String rss) {
        // Error case
        if (rss == null) return new RSSImpl();
       
        RSS rssItems = null;
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        try {
            DocumentBuilder db = dbf.newDocumentBuilder();
            try {
                InputSource is = new InputSource(new StringReader(rss));
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Rss

public class RssTest {

    @Test
    public void test1() {
  Rss command = new Rss(Orientation.horizontal, new Position(10, 110), 2, 25, 3, 22, RssBarcodeType.RSS_14, "1234567890123", "1234567890");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE RSS 10 110 2 25 3 22 1 1234567890123|1234567890");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Rss

  assertCommand(output, command);
    }

    @Test
    public void test2() {
  Rss command = new Rss(Orientation.horizontal, new Position(10, 110), 2, 25, 3, 22, RssBarcodeType.RSS_14_Stacked, "1234567890123", "");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE RSS 10 110 2 25 3 22 3 1234567890123");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Rss

  assertCommand(output, command);
    }

    @Test
    public void test3() {
  Rss command = new Rss(Orientation.horizontal, new Position(10, 110), 2, 25, 3, 22, RssBarcodeType.RSS_Expanded, "1234567890123", "");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE RSS 10 110 2 25 3 22 6 1234567890123");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Rss

  assertCommand(output, command);
    }

    @Test
    public void test4() {
  Rss command = new Rss(Orientation.horizontal, new Position(10, 110), 2, 25, 3, 22, RssBarcodeType.UCC_128_Composite_A_B, "12345678901234567890",
          "1234567890");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE RSS 10 110 2 25 3 22 11 12345678901234567890|1234567890");
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Rss

  assertCommand(output, command);
    }

    @Test
    public void test5() {
  Rss command = new Rss(Orientation.horizontal, new Position(10, 110), 2, 25, 3, 22, RssBarcodeType.RSS_14, "1011234567890", "");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE RSS 10 110 2 25 3 22 1 1011234567890");

  assertCommand(output, command);
View Full Code Here

Examples of net.dromard.common.rss.feed.RSS

public class RSSFeedReader extends RSSReader {

  public RSS load(final URL url) throws ParserConfigurationException, SAXException, IOException {
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(url.openStream());
    RSS rss = new RSS();
    NodeList feedNodes = doc.getElementsByTagName("rss");
    for (int f = 0; f < feedNodes.getLength(); f++) {
      Element element = (Element) feedNodes.item(f);
      rss.setVersion(element.getAttribute("version"));
      NodeList channelNodes = element.getElementsByTagName("channel");
      if (channelNodes.getLength() >= 1) {
        element = (Element) channelNodes.item(0);
        Channel channel = new Channel();
        channel.setTitle(getElementValue(element, "title"));
        channel.setDescription(getElementValue(element, "description"));
        channel.setLink(getElementValue(element, "link"));
        channel.setAuthor(getElementValue(element, "author"));
       
        NodeList items = element.getElementsByTagName("item");
        for (int i = 0; i < items.getLength(); i++) {
          Element itemElmt = ((Element) items.item(i));
          Item item = new Item();
          item.setAuthor(getElementValue(itemElmt, "author"));
          item.setCategory(getElementValue(itemElmt, "category"));
          item.setDescription(getElementValue(itemElmt, "description"));
          item.setLink(getElementValue(itemElmt, "link"));
          item.setGuid(getElementValue(itemElmt, "guid"));
          item.setPublished(getElementValue(itemElmt, "pubDate"));
          item.setTitle(getElementValue(itemElmt, "title"));
          NodeList enclosureNode = itemElmt.getElementsByTagName(Enclosure.ENCLOSURE);
          if (enclosureNode.getLength() == 1) {
            Enclosure enclosure = new Enclosure();
            Element enclosureElmt = ((Element) enclosureNode.item(0));
            String length = enclosureElmt.getAttribute(Enclosure.LENGTH);
            if (length.length() > 0) {
              try {
                enclosure.setLength(Integer.parseInt(length));
              } catch (NumberFormatException e) {
              }
            }
            enclosure.setType(enclosureElmt.getAttribute(Enclosure.TYPE));
            enclosure.setUrl(enclosureElmt.getAttribute(Enclosure.URL));
            item.setEnclosure(enclosure);
          }
          channel.addItem(item);
        }

        rss.setChannel(channel);
      }
    }
    return rss;
  }
View Full Code Here

Examples of net.dromard.common.rss.feed.RSS

  public static void main(String[] args) throws Exception {
    RSSFeedReader reader = new RSSFeedReader();
    //URL u = new File("C:/Projects/picasamoviecollection/src/main/resources/curiouscreature.xml").toURI().toURL();
    //URL u = new File("C:/Projects/picasamoviecollection/src/main/resources/albums.xml").toURI().toURL();
    URL u = new URL("http://picasaweb.google.fr/data/feed/base/user/laurentetsylvie75/albumid/5264008816855671777?alt=rss&kind=photo&authkey=OJ0rnRRHaLA&hl=fr");
    RSS rss = reader.load(u);
    System.out.println(rss.toXML());
  }
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.