org.apache.commons.feedparser.locate.blogservice
Class Xanga

java.lang.Object
  extended by org.apache.commons.feedparser.locate.blogservice.BlogService
      extended by org.apache.commons.feedparser.locate.blogservice.Xanga

public class Xanga
extends BlogService

Models the Xanga blog service, encapsulating whether a given weblog is this type of service and where it usually keeps its feeds.

Author:
Brad Neuberg, bkn3@columbia.edu

Field Summary
 
Fields inherited from class org.apache.commons.feedparser.locate.blogservice.BlogService
blogServices, metaTagsPattern, patternToStrip
 
Constructor Summary
Xanga()
           
 
Method Summary
 boolean followRedirects()
          Returns whether we should follow HTTP redirects for this blog service.
 FeedReference[] getFeedLocations(String resource, String content)
          Returns an array of FeedReferences that contains information on the usual locations this blog service contains its feed.
protected  String getXangaUser(String resource)
          Xanga's feed locations are dependent on the 'user' attribute in a Xanga URI.
 boolean hasValidAutoDiscovery()
          Returns whether we can trust the results of this blog service's autodiscovery links.
 boolean isThisService(String resource, String content)
          Determines if the weblog at the given resource and with the given content is this blog service.
 
Methods inherited from class org.apache.commons.feedparser.locate.blogservice.BlogService
containsDomain, equals, getBaseFeedPath, getBlogServices, hasGenerator, hashCode, initializeBlogServices, isThisService, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Xanga

public Xanga()
Method Detail

hasValidAutoDiscovery

public boolean hasValidAutoDiscovery()
Returns whether we can trust the results of this blog service's autodiscovery links. For example, TextAmerica returns invalid autodiscovery results.

Specified by:
hasValidAutoDiscovery in class BlogService

followRedirects

public boolean followRedirects()
Returns whether we should follow HTTP redirects for this blog service. Some services don't implement HTTP redirects correctly, while others, like Xanga, require it.

Specified by:
followRedirects in class BlogService

isThisService

public boolean isThisService(String resource,
                             String content)
                      throws FeedParserException
Determines if the weblog at the given resource and with the given content is this blog service.

Specified by:
isThisService in class BlogService
Parameters:
resource - A full URI to this resource, such as "http://www.codinginparadise.org".
content - The full HTML content at the resource's URL.
Throws:
FeedParserException - Thrown if an error occurs while determining the type of this weblog.

getFeedLocations

public FeedReference[] getFeedLocations(String resource,
                                        String content)
                                 throws FeedParserException
Returns an array of FeedReferences that contains information on the usual locations this blog service contains its feed. The feeds should be ordered by quality, so that higher quality feeds come before lower quality ones (i.e. you would want to have an Atom FeedReference object come before an RSS 0.91 FeedReference object in this list).

Specified by:
getFeedLocations in class BlogService
Parameters:
resource - A URL to the given weblog that might be used to build up where feeds are usually located.
content - The full content of the resource URL, which might be useful to determine where feeds are usually located. This can be null.
Throws:
FeedParserException - Thrown if an error occurs while trying to determine the usual locations of feeds for this service.

getXangaUser

protected String getXangaUser(String resource)
Xanga's feed locations are dependent on the 'user' attribute in a Xanga URI. This method helps extract the user element from an existing URI, such as http://www.xanga.com/home.aspx?user=wdfphillz.



Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.