[mythtv] Zap2It? We don't need no steenkin' Zap2It...

Robert Johnston anaerin at gmail.com
Tue Jul 10 23:53:50 UTC 2007


I've got part of a solution to our listings problem.

If you hit MSN Media's TV Guide
(http://entertainment.msn.com/tv/guide/), and use a Passport account
to log in and set up your local listings, it'll give you a nice grid
of what's coming up. However, the web service they use for this can be
"Leveraged" for other purposes.

Once you're logged in, hit:

http://mediaservices.msn.com/DiscoveryWS/GetGridData.ashx?channels=all&format=XML&observesDST=false&timezoneOffset=-360&start=<date_in_seconds_since_epoch>&duration=<duration_in_seconds>&mkt=en-US

(Note, the ObservesDST and TimezoneOffset are my values here)

This will give you a nice XML(!) document with the following structure:

<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<tvlistings heid="0007340-" heFriendlyName="<Provider name>"
isDefault="False" isValid="True" timezoneOffset="-360"
dstTransition="1/1/1970 12:00:00 AM" dstOffsetCurrent="0"
dstOffsetNext="0" primeTimeStart="1140" primeTimeEnd="1320">
	<defaultDevice friendlyName="" boxMapId="" operatorType="" platformType="" />
	<GridSegments start="<Start time in UTC format>" end="<End time in
UTC format>">
		<GridSegment>
			<Times>
				<Time start="12:00 AM" GridDuration="30" />
				...
			</Times>
			<Channels>
				<Channel ChannelNumber="<number>" Affiliate=""
ChannelId="<channelid>" CallLetters="<callsign>">
					<Shows>
						<Show ProgramId="<progid>" Title="<title>" EpisodeTitle=""
StartTime="<Start Time in UTC format>" Duration="<showdurationinmins>"
GridDuration="60" />
						<Show ProgramId="29173450" Title="Street Legal"
EpisodeTitle="Breakups &amp; Mergers" StartTime="2007-07-16T22:00:00"
Duration="60" GridDuration="60" />
						...
					</Shows>
				</Channel>
				...
			</Channels>
		</GridSegment>
	</GridSegments>
</tvlistings>

I know this is missing some information, but it seems that the program
IDs are unique per episode, and it has all the basic information for
an XMLTV lineup. If you want more information on a program there is
another web service (For the details, though sadly in JSON only) that
can grab those too. All we need is a little XSLT jiggery-pokery and
we've pretty much got ourselves a working feed. And yes, if you set
the "Duration" query parameter to 1123200 you get a full 14 days worth
of guide info.

Does this help anyone? Or am I barking up the wrong tree here?
-- 
Robert "Anaerin" Johnston


More information about the mythtv-dev mailing list