|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.xml.XMLParser
org.stanwood.media.source.xbmc.XBMCExtension
org.stanwood.media.source.xbmc.XBMCScraper
public class XBMCScraper
This class is used to handle the XML scraper files from XBMC.
Field Summary |
---|
Fields inherited from class org.stanwood.media.xml.XMLParser |
---|
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION |
Constructor Summary | |
---|---|
XBMCScraper(XBMCAddon addon,
java.io.File scraperFile,
java.lang.String point,
Mode mode)
Used to create the class and set the scraper file |
Method Summary | |
---|---|
java.lang.String |
executeXBMCScraperFunction(java.lang.String functionName,
java.util.Map<java.lang.Integer,java.lang.String> params)
Used to execute a scraper function |
org.w3c.dom.Document |
getCreateSearchUrl(java.lang.String searchTerm,
java.lang.String year)
Used to get the URL which should be used to search |
org.w3c.dom.Document |
getEpisodeGuideUrl(java.lang.String rawHtml)
Used to get the episode guide URL |
org.w3c.dom.Document |
getGetDetails(java.io.File file,
java.lang.String... contents)
Used to get the show/film details as a XML document. |
org.w3c.dom.Document |
getGetEpisodeDetails(java.lang.String contents,
java.lang.String episodeId)
Used to get the details of the a episode. |
org.w3c.dom.Document |
getGetEpisodeList(java.lang.String html,
java.net.URL showURL)
Used to get a list of the the episodes in a show |
org.w3c.dom.Document |
getGetSearchResults(java.lang.String rawHtml,
java.lang.String searchTerm)
This function is used to get a XML document of the search results. |
Mode |
getMode()
Get the mode of the scrper |
boolean |
getNfoUrl(java.lang.String contents)
Used to get a Show or film URL from the contents of a NFO file. |
boolean |
supportsURL(java.net.URL url)
This method is used to check if the scraper can be used for the episode details URL |
Methods inherited from class org.stanwood.media.source.xbmc.XBMCExtension |
---|
executeXBMCFunction, getAddon, getDocument, getFile, toString |
Methods inherited from class org.stanwood.media.xml.XMLParser |
---|
createDocBuilder, createFactory, deleteNode, domToStr, encodeAttributeValue, firstChild, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XBMCScraper(XBMCAddon addon, java.io.File scraperFile, java.lang.String point, Mode mode)
addon
- The addon been usedpoint
- The addon extension point for this scrapermode
- The mode this scraper is to be used forscraperFile
- The XML scraper fileMethod Detail |
---|
public Mode getMode()
public org.w3c.dom.Document getCreateSearchUrl(java.lang.String searchTerm, java.lang.String year) throws XBMCException
searchTerm
- The search term to useyear
- The year to search for the result or empty string for any
XBMCException
- Thrown if their are any problems creating the search URLpublic org.w3c.dom.Document getGetSearchResults(java.lang.String rawHtml, java.lang.String searchTerm) throws XBMCException
rawHtml
- The raw search resultssearchTerm
- The term been searched for
XBMCException
- Thrown if their are any problems creating the search urlXMLpublic org.w3c.dom.Document getGetDetails(java.io.File file, java.lang.String... contents) throws XBMCException
file
- the file that the details are been retrieved for, or NULL if this is not knowncontents
- A list of webpage contents
XBMCException
- Thrown if their are any problemspublic org.w3c.dom.Document getEpisodeGuideUrl(java.lang.String rawHtml) throws XBMCException
rawHtml
- The show weppage
XBMCException
- Thrown if their are any problempublic boolean getNfoUrl(java.lang.String contents) throws XBMCException
contents
- The contents of a NFO file
XBMCException
- Thrown if their are any problemspublic org.w3c.dom.Document getGetEpisodeList(java.lang.String html, java.net.URL showURL) throws XBMCException
html
- The contents of the episode listshowURL
- The URL used to fetch show info
XBMCException
- Thrown if their are any problemspublic java.lang.String executeXBMCScraperFunction(java.lang.String functionName, java.util.Map<java.lang.Integer,java.lang.String> params) throws XBMCException, XMLParserException
executeXBMCScraperFunction
in class XBMCExtension
functionName
- The name of the function to executeparams
- Numbered parameters passed to the function
XBMCException
- Thrown if their is a XBMC problem
XMLParserException
- Thrown if their is a XML problempublic boolean supportsURL(java.net.URL url) throws SourceException
url
- The NFO file
SourceException
- Thrown if their are any problemspublic org.w3c.dom.Document getGetEpisodeDetails(java.lang.String contents, java.lang.String episodeId) throws XBMCException
contents
argument contains the downloaded
weppage of the episode details. The episode details URL is obtained by calling getGetEpisodeList(String, URL)
contents
- The downloaded HTML of the episode guideepisodeId
- The ID of the episode to get the details for
XBMCException
- Thrown if their are any problems
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |