commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject cvs commit: jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/example HelloFeedParser.java
Date Sun, 04 Jul 2004 05:52:35 GMT
burton      2004/07/03 22:52:35

  Modified:    feedparser TODO build.xml
  Added:       feedparser/src/java/org/apache/commons/feedparser/example
                        HelloFeedParser.java
  Log:
  Start of docs and examples
  
  Revision  Changes    Path
  1.9       +1 -1      jakarta-commons-sandbox/feedparser/TODO
  
  Index: TODO
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/TODO,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TODO	15 Apr 2004 16:57:20 -0000	1.8
  +++ TODO	4 Jul 2004 05:52:35 -0000	1.9
  @@ -16,7 +16,7 @@
       
       - OCS directory support (pending)
       - FOAF support (pending)
  -
  + 
   - Migrate away from JDOM (slower than just using DOM/SAX)
   
   - Don't use libs from the KSA.  
  
  
  
  1.3       +30 -0     jakarta-commons-sandbox/feedparser/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	18 Feb 2004 21:07:23 -0000	1.2
  +++ build.xml	4 Jul 2004 05:52:35 -0000	1.3
  @@ -12,6 +12,14 @@
       <property name="docs.dest" value="./site"/>
       <property name="docs.src" value="./xdocs"/>
   
  +    <property name="jakarta.site2.home" location="../jakarta-site2"/>
  +
  +    <path id="anakia.classpath">
  +        <fileset dir="${jakarta.site2.home}/lib">
  +            <include name="*.jar"/>
  +        </fileset>
  +    </path>
  +
       <path id="project.classpath">
   
           <fileset dir="lib">
  @@ -82,6 +90,28 @@
   
           <echo message="tests done"/>
       
  +    </target>
  +
  +    <target name="docs">
  +        
  +        <!-- anakia config borrowed from Lucene -->
  +
  +        <taskdef name="anakia"
  +                 classname="org.apache.velocity.anakia.AnakiaTask"
  +                 classpathref="anakia.classpath">
  +
  +        </taskdef>
  +
  +        <anakia basedir="xdocs"
  +                destdir="docs/"
  +                extension=".html" 
  +                style="./site.vsl"
  +                projectFile="stylesheets/project.xml"
  +                excludes="**/stylesheets/** empty.xml"
  +                includes="**/*.xml"
  +                lastModifiedCheck="true"
  +                templatePath="${jakarta.site2.home}/xdocs/stylesheets"/>
  +
       </target>
   
   </project>
  
  
  
  1.1                  jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/example/HelloFeedParser.java
  
  Index: HelloFeedParser.java
  ===================================================================
  /*
   * Copyright 1999,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.commons.feedparser.example;
  
  import org.apache.commons.feedparser.*;
  import org.apache.commons.feedparser.impl.*;
  
  import java.io.*;
  import java.net.*;
  import java.util.*;
  
  /**
   * Example use of the FeedParser
   *
   * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a>
   * @version $Id: HelloFeedParser.java,v 1.1 2004/07/04 05:52:35 burton Exp $
   */
  public class HelloFeedParser {
  
      public static void main( String[] args ) throws Exception {
  
          FeedParser parser = FeedParserFactory.newFeedParser();
  
          FeedParserListener listener = new DefaultFeedParserListener() {
  
                  public void onItem( FeedParserState state,
                                      String title,
                                      String link,
                                      String description,
                                      String permalink ) throws FeedParserException {
  
  
                      System.out.println( "Found a new published article: " + permalink );
                      
                  }
  
                  
              };
  
          parser.parse( listener, new URL( "http://peerfear.org/rss/index.rss" ).openStream()
);    
  
      }
  
  }
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message