<!-- should be self-explanatory -->
<scraper name="MOVIE-XML" content="movies" thumb="movie-xml.jpg" language="en">
	<!-- 	input: 		$1=query string -->
	<!-- 	returns: 	the url we should use to do the search -->
	<CreateSearchUrl dest="3">
		<RegExp input="$$1" output="http://www.movie-xml.com/interfaces/GetSeries.php?seriesname=\1" dest="3">
			<expression></expression>
		</RegExp>
	</CreateSearchUrl>
	<!-- 	input: $1=html $2=search query -->
	<!-- 	returns: results in xml format <results><movie><title>*</title><url>*</url>*#urls<extra>*</extra></movie>*</results> -->
	<GetSearchResults dest="1">
		<RegExp output="\1" dest="3">
			<expression noclean="1">&lt;Items&gt;(.*)&lt;/Items&gt;</expression>
		</RegExp>
		<RegExp input="$$4" output="&lt;results&gt;\1&lt;/results&gt;" dest="1">
			<RegExp input="$$3" output="&lt;entity&gt;&lt;title&gt;\2&lt;/title&gt;&lt;url&gt;http://www.movie-xml.com/interfaces/SeriesUpdates.php?lasttime=0&amp;amp;idlist=\1&lt;/url&gt;&lt;url&gt;http://www.movie-xml.com/interfaces/GetBanners.php?seriesid=\1&lt;/url&gt;&lt;id&gt;\1&lt;/id&gt;&lt;/entity&gt;" dest="4">
				<expression repeat="yes">&lt;id&gt;([0-9]*)&lt;/id&gt;[^&lt;]*&lt;SeriesName&gt;([^&lt;]*)&lt;/SeriesName&gt;</expression>
			</RegExp>
			<expression noclean="1"></expression>
		</RegExp>
	</GetSearchResults>
	<!-- 	input: $1..#urls=html -->
	<!--	input: $(#urls+1): extra !-->
	<!-- 	returns: results in xml format <details><plot>*</plot><director>*</director><premiered>*</premiered><episodeguide>*</episodeguide></details> -->
	<GetDetails dest="7">
		<RegExp input="$$4" output="&lt;details&gt;\1&lt;/details&gt;" dest="7">
			<RegExp input="$$1" output="\1" dest="5">
				<expression noclean="1">&lt;Item&gt;[^&lt;]*&lt;id&gt;$$3&lt;/id&gt;(.*)</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;outline&gt;\1&lt;/outline&gt;" dest="4+">
				<expression noclean="1">&lt;Shortoverview&gt;([^&lt;]*)&lt;/Shortoverview&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;plot&gt;\1&lt;/plot&gt;" dest="4+">
				<expression noclean="1">&lt;Overview&gt;([^&lt;]*)&lt;/Overview&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;tagline&gt;\1&lt;/tagline&gt;" dest="4+">
				<expression noclean="1">&lt;Tagline&gt;([^&lt;]*)&lt;/Tagline&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;mpaa&gt;\1&lt;/mpaa&gt;" dest="4+">
				<expression noclean="1">&lt;Certification&gt;([^&lt;]*)&lt;/Certification&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;runtime&gt;\1&lt;/runtime&gt;" dest="4+">
				<expression noclean="1">&lt;Runtime&gt;([^&lt;]*)&lt;/Runtime&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;studio&gt;\1&lt;/studio&gt;" dest="4+">
				<expression noclean="1">&lt;Network&gt;([^&lt;]*)&lt;/Network&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;trailerlink&gt;\1&lt;/trailerlink&gt;" dest="4+">
				<expression noclean="1">&lt;Trailerlink&gt;([^&lt;]*)&lt;/Trailerlink&gt;</expression>
			</RegExp>

			<RegExp input="$$5" output="\1" dest="6">
				<expression noclean="1">&lt;Director&gt;([^&lt;]*)&lt;/Director&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;director&gt;\1&lt;/director&gt;" dest="4+">
				<expression repeat="yes">\|?([^\|]*)\|?</expression>
			</RegExp>

			<RegExp input="$$5" output="\1" dest="6">
				<expression noclean="1">&lt;Writer&gt;([^&lt;]*)&lt;/Writer&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;credits&gt;\1&lt;/credits&gt;" dest="4+">
				<expression repeat="yes">\|?([^\|]*)\|?</expression>
			</RegExp>


			<RegExp input="$$5" output="&lt;year&gt;\1&lt;/year&gt;" dest="4+">
				<expression>&lt;Yearmade&gt;([^&lt;]*)&lt;/Yearmade&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;rating&gt;\1&lt;/rating&gt;" dest="4+">
				<expression>&lt;Score&gt;([^&lt;]*)&lt;/Score&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;title&gt;\1&lt;/title&gt;" dest="4+">
				<expression>&lt;SeriesName&gt;([^&lt;]*)&lt;/SeriesName&gt;</expression>
			</RegExp>
			<RegExp input="$$5" output="\1" dest="6">
				<expression noclean="1">&lt;Genre&gt;([^&lt;]*)&lt;/Genre&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;genre&gt;\1&lt;/genre&gt;" dest="4+">
				<expression repeat="yes">([^\|]*)\|</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;genre&gt;\1&lt;/genre&gt;" dest="4+">
				<expression repeat="yes">([^,]*),</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;genre&gt;\1&lt;/genre&gt;" dest="4+">
				<expression>([^\|,]+)$</expression>
			</RegExp>
			<RegExp input="$$5" output="\1" dest="6">
				<expression noclean="1">&lt;Actors&gt;([^&lt;]*)&lt;/Actors&gt;</expression>
			</RegExp>
			<RegExp input="$$6" output="&lt;actor&gt;&lt;name&gt;\1&lt;/name&gt;&lt;/actor&gt;" dest="4+">
				<expression repeat="yes">\|?([^\|]*)\|?</expression>
			</RegExp>
			<RegExp input="$$5" output="&lt;thumbs&gt;\1&lt;/thumbs&gt;" dest="4+">
				<RegExp input="$$2" output="&lt;thumb&gt;http://www.movie-xml.com/banners/\1&lt;/thumb&gt;" dest="5">
					<expression clear="yes" repeat="yes">&lt;Type&gt;series&lt;/Type&gt;[^&lt;]*&lt;BannerType&gt;[^&lt;]*&lt;/BannerType&gt;[^&lt;]*&lt;Season&gt;0&lt;/Season&gt;[^&lt;]*&lt;BannerPath&gt;([^&lt;]*)&lt;/BannerPath&gt;[^&lt;]*</expression>
				</RegExp>
				<RegExp input="$$2" output="&lt;thumb type=&quot;season&quot; season=&quot;\1&quot;&gt;http://www.movie-xml.com/banners/\2&lt;/thumb&gt;" dest="5+">
					<expression repeat="yes">&lt;Type&gt;seasonwide&lt;/Type&gt;[^&lt;]*&lt;BannerType&gt;[^&lt;]*&lt;/BannerType&gt;[^&lt;]*&lt;Season&gt;([0-9]+)&lt;/Season&gt;[^&lt;]*&lt;BannerPath&gt;([^&lt;]*)&lt;/BannerPath&gt;[^&lt;]*</expression>
				</RegExp>
				<RegExp input="$$2" output="&lt;thumb type=&quot;season&quot; season=&quot;\1&quot;&gt;http://www.movie-xml.com/banners/\2&lt;/thumb&gt;" dest="5+">
					<expression repeat="yes">&lt;Type&gt;season&lt;/Type&gt;[^&lt;]*&lt;BannerType&gt;[^&lt;]*&lt;/BannerType&gt;[^&lt;]*&lt;Season&gt;([0-9]+)&lt;/Season&gt;[^&lt;]*&lt;BannerPath&gt;([^&lt;]*)&lt;/BannerPath&gt;[^&lt;]*</expression>
				</RegExp>
				<expression noclean="1"></expression>
			</RegExp>
			<RegExp input="$$3" output="&lt;episodeguide&gt;&lt;url&gt;http://www.movie-xml.com/interfaces/GetEpisodes.php?seriesid=\1&lt;/url&gt;&lt;/episodeguide&gt;" dest="4+">
				<expression></expression>
			</RegExp>
			<expression noclean="1"></expression>
		</RegExp>
	</GetDetails>
</scraper>
