Examples of RssItunesFeed


Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

      /* If name changed, need to remove the previous name. */
      if (!m_addForm && !m_editName.equals(name)) {
        m_rssFeeds.remove(m_editName);
      }
     
      final RssItunesFeed bm = new RssItunesFeed(name, url, username, password);
     
      if (m_addForm) {
        m_bookmarkList.insert(m_addBkmrk, bm.getName(), null);
      } else {
        m_bookmarkList.set(m_curBookmark, bm.getName(), null);
      }
      m_rssFeeds.put(bm.getName(), bm);
    }
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

  private void parseHTMLRedirect(boolean updFeed, String url,
                   InputStream is, final boolean convXmlEnts,
                   final int maxItemCount)
  throws IOException, CauseException, Exception {
    String newUrl = super.parseHTMLRedirect(url, is);
    RssItunesFeed svFeed = new RssItunesFeed(m_rssFeed);
    parseRssFeedUrl(newUrl, updFeed, convXmlEnts, maxItemCount);
  }
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

  throws CauseMemoryException, CauseException {
    Object obj = super.get(name);
    if (obj == null) {
      return null;
    }
    RssItunesFeed cfeed = null;
    String cstore = null;
    if (obj instanceof RssItunesFeed) {
      if (getStore) {
        cstore = ((RssItunesFeed)obj).getStoreString(true, true, false);
      } else {
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

  throws CauseMemoryException, CauseException {
    Enumeration keyEnum = super.keys();
    int ic = 1;
    while(keyEnum.hasMoreElements()) {
      final String fname = (String)keyEnum.nextElement();
      RssItunesFeed feed = (RssItunesFeed)get(fname);
      feed.setItems(null);
      feed.setItems(new Vector());
      put(fname, feed);
    }
  }
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

        (name.toLowerCase().indexOf(m_feedNameFilter) < 0)) ||
        (( m_feedURLFilter != null) &&
        (url.toLowerCase().indexOf(m_feedURLFilter) < 0))) {
        continue;
      }
            feeds[lineIndex] = new RssItunesFeed(name, url, "", "");
        }
       
        return feeds;       
    }
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

    }
    //#ifdef DLOGGING
    if (finestLoggable) {logger.finest("m_language=" + m_language);}
    //#endif
    m_hasExt = m_extParser.isHasExt();
    RssItunesFeed feed = cfeed;
        feed.setItems(items);
       
        /** Parse to first entry element */
        while(!parser.getName().equals("entry")) {
      //#ifdef DTEST
      //#ifndef DTESTUI
            System.out.println("Parsing to first entry");
      //#endif
      //#endif
            switch (parser.parse()) {
        case XmlParser.END_DOCUMENT:
          System.out.println("No entries found.");
          return feed;
        case XmlParser.ELEMENT:
          String elementName = parser.getName();
          char elemChar = elementName.charAt(0);
          if (parseCommon(parser, elemChar, elementName)) {
            if ((elemChar == 't') &&
                getTitleOnly && elementName.equals("title") ) {
              feed.setName(m_title);
              return feed;
            }
          }
          if ((elemChar == 's') &&
            elementName.equals("subtitle") ) {
            m_description = parser.getText(m_convXmlEnts);
            if (m_convXmlEnts) {
              m_description = StringUtil.removeHtml(
                  m_description );
            }
            //#ifdef DLOGGING
            if (finestLoggable) {logger.finest("m_description=" + m_description);}
            //#endif
            continue;
          }
          if (m_hasExt) {
            m_extParser.parseExtItem(parser, elemChar,
                         elementName);
          }
          break;
        default:
          break;
            }
        }

    feed.setLink(m_link);
    // Atom has not feed level date.
    feed.setDate(null);
    if (m_extParser.isItunes()) {
      feed = m_extParser.getFeedInstance(feed, m_language,
          m_title, m_description);
    }
       
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

           
      boolean bodyFound = false;
            do {
        if (elementType == HTMLParser.REDIRECT_URL) {
          RssItunesFeed [] feeds = new RssItunesFeed[1];
          feeds[0] = new RssItunesFeed("", parser.getRedirectUrl(),
              "", "");
          return feeds;
        }
        /** RSS item properties */
        String title = "";
        String link = "";
                       
        String tagName = parser.getName();
        //#ifdef DLOGGING
        if (finerLoggable) {logger.finer("tagname: " + tagName);}
        //#endif
        if (tagName.length() == 0) {
          continue;
        }
        switch (tagName.charAt(0)) {
          case 'm':
          case 'M':
            if (bodyFound) {
              break;
            }
            break;
          case 'b':
          case 'B':
            if (!bodyFound) {
              bodyFound = parser.isBodyFound();
            }
            break;
          case 'a':
          case 'A':
            //#ifdef DLOGGING
            if (finerLoggable) {logger.finer("Parsing <a> tag");}
            //#endif
           
            title = parser.getText();
            // Title can be 0 as this is used also for
            // getting
            title = title.trim();
            title = StringUtil.removeHtml( title );

            if (((link = parser.getAttributeValue( "href" ))
                  == null) || ( link.length() == 0 )) {
              continue;
            }
            link = link.trim();
            if ( link.length() == 0 ) {
              continue;
            }
            if (link.indexOf("://") >= 0) {
              if (!link.startsWith("http:") &&
                !link.startsWith("https:") &&
                !link.startsWith("file:") &&
                 !link.startsWith("jar:")) {
                //#ifdef DLOGGING
                if (finerLoggable) {logger.finer("Not support for protocol or no protocol=" + link);}
                //#endif
                continue;
              }
            } else {
              if (link.charAt(0) == '/') {
                int purl = url.indexOf("://");
                if ((purl + 4) >= url.length()) {
                  //#ifdef DLOGGING
                  if (finerLoggable) {logger.finer("Url too short=" + url + "," + purl);}
                  //#endif
                  continue;
                }
                int pslash = url.indexOf("/", purl + 3);
                String burl = url;
                if (pslash >= 0) {
                  burl = url.substring(0, pslash);
                }
                link = burl + link;
              } else {
                link = url + "/" + link;
              }
            }
           
            /** Debugging information */
            //#ifdef DLOGGING
            if (finerLoggable) {logger.finer("Title:       " + title);}
            if (finerLoggable) {logger.finer("Link:        " + link);}
            //#endif
            if (( feedURLFilter != null) &&
              ( link.toLowerCase().indexOf(feedURLFilter) < 0)) {
              continue;
            }
           
            if (( feedNameFilter != null) &&
              ((title != null) &&
              (title.toLowerCase().indexOf(feedNameFilter) < 0))) {
              continue;
            }
            RssItunesFeed feed = new RssItunesFeed(title, link, "", "");
            rssFeeds.addElement( feed );
            break;
          default:
        }
            }
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

          }
          if (( m_feedURLFilter != null) &&
            ( link.toLowerCase().indexOf(m_feedURLFilter) < 0)) {
            continue;
          }
          RssItunesFeed feed = new RssItunesFeed(title, link, "", "");
          rssFeeds.addElement( feed );
        }
       
      }
            while( parser.parse() != XmlParser.END_DOCUMENT );
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

             * collection.  Account for wrong OPML which is an
             * OPML composed of other OPML.  These have url attribute
             * instead of link attribute.
             */
            if (!needRss || needFirstRss) {
              RssItunesFeed feed = new RssItunesFeed(title, link, "", "");
              rssFeeds.addElement( feed );
              process = false;
              break;
            }
            if (( feedURLFilter != null) &&
              ( link.toLowerCase().indexOf(feedURLFilter) < 0)) {
              continue;
            }
            if (( feedNameFilter != null) &&
              ((title != null) &&
              (title.toLowerCase().indexOf(feedNameFilter) < 0))) {
              continue;
            }
            RssItunesFeed feed = new RssItunesFeed(title, link, "", "");
            rssFeeds.addElement( feed );
            break;
          default:
        }
      }
View Full Code Here

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed

        Vector items = new Vector();
    m_extParser = new ExtParser(convXmlEnts);
    m_extParser.parseNamespaces(parser);
    m_hasExt = m_extParser.isHasExt();
    m_convXmlEnts = convXmlEnts;
    RssItunesFeed feed = cfeed;
        feed.setItems(items);
       
        /** Parse to first entry element */
        while(!parser.getName().equals("item")) {
            switch (parser.parse()) {
        case XmlParser.END_DOCUMENT:
          System.out.println("No entries found.");
          return feed;
        case XmlParser.ELEMENT:
          String elementName = parser.getName();
          if (elementName.length() == 0) {
            continue;
          }
          char elemChar = elementName.charAt(0);
          if (parseCommon(parser, elemChar, elementName)) {
            if ((elemChar == 't') &&
                getTitleOnly && elementName.equals("title") ) {
              feed.setName(m_title);
              return feed;
            }
            continue;
          }
          switch (elemChar) {
            //#ifdef DITUNES
            case 'l':
               if (elementName.equals("language")) {
                 m_language = parser.getText();
                 //#ifdef DLOGGING
                 if (finestLoggable) {logger.finest("m_language=" + m_language);}
                 //#endif
                 continue;
               }
               break;
            //#endif
            case 'i':
               if (elementName.equals("image")) {
                 // Skip image text as it includes link
                 // and title.
                 String itext = parser.getText(false);
                 //#ifdef DLOGGING
                 if (finestLoggable) {logger.finest("image=" + itext);}
                 //#endif
                 continue;
               }
               break;
            default:
               break;
          }
          if (m_hasExt) {
            m_extParser.parseExtItem(parser, elemChar, elementName);
          }
          break;
        default:
          break;
            }
        }
    feed.setLink(m_link);
    if (m_date.length() > 0) {
      Date pubDate = parseRssDate(m_date);
      feed.setDate(pubDate);
    } else {
      feed.setDate(null);
    }
    if (m_extParser.isItunes()) {
      feed = m_extParser.getFeedInstance(feed, m_language, m_title,
          m_description);
    }
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.