One of the secondary goals of my MobileTV project has always been to be able to provide all XMLTV users a venue to easily access and conveniently plan/schedule their TV viewing via the web, on a variety devices (i.e. mobiles/tablets/desktop computers).
I found that GET requests are not supported so technically the Tribune Web Service must still be following the SOAP 1.1 not SOAP 1.2 standard which specifies both GET and POST are acceptable as long as the SOAP request enveloppe is passed via URL.
Since that is not supported, you have to use POST and it also has to have the BASIC authentication information included in the header in the exact pattern:
Authorization: BASIC xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx = base64encoded(username:password)
Don’t forget the semicolon as a string in between the username and password (like I did at first)!
Before any programming, try debugging using a SOAP tool… it DEFINITELY helps save sanitiy. I got it working using SOAP UI: http://soapui.org/
You need to do the following in SOAP UI:
- File –> New SoapUI Project
- Name it “SchedulesDirect” or something the like…
- Paste in the WSDL location “http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl”
- Check “Create TestSuite” and “TestCase”
- Expand the project, Under “xtvdBinding” there should be a “download” Web Service call stub, expand that and open Request 1
- Click the little “Auth” tab at the bottom of the Request window (easy to miss… look down next to “Headers” and “Attachments” tabs)
- Enter your SchedulesDirect username and password, then click the little green “Run” arrow at the top left of the Request window
With the initial testing out of the way as a “sanity check” on your SchedulesDirect account, you can now get started on the coding.
TMS Direct Download script
In the meantime, here’s a modified version of “tmsfetch.php” which was initially provided by SchedulesDirect as one of the official examples:
<?php $username='username'; $password='password'; $wsdl_url='http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl'; $start=gmdate("Y-m-dTH:i:sZ",time()); //today $stop =gmdate("Y-m-dTH:i:sZ",time()+3600*24); //tomorrow (now + 24hrs) $client = new SoapClient($wsdl_url, array('exceptions' => 0, 'user_agent' => "php/".$_SERVER[SCRIPT_NAME], 'login' => strtolower($username), 'password' => $password)); $data = $client->download($start,$stop); print_r($data); ?>
This script provides a basic way of downloading TV data in Tribune Media Services (TMS) format. It can even provide a translation into XMLTV format (which is slightly different than TMS, but conveys all the same data); however, it won’t help much with the display of the data on the front-end. For that, I would suggest looking into one of the approved applications for actually viewing your XMLTV listings in the familiar grid/list styled EPG. While most of the software there is designed to run on the desktop, I would highlight XSLTV for web-based applications. There is not yet a mobile-friendly XMLTV application but stay tuned for my new jQuery plugin (not yet available), which should hopefully be compatible with jQuery Mobile.
- Email Reader (dustycodes.wordpress.com)
- I feel the need…the need for JSON parsing correctness and speed! (whereswalden.com)
- Facebook’s Timeline is nothing but a LAZY and BLUNT marketing data parser (gubatron.com)
- Why is JSON so popular? Developers want out of the syntax business (mongolab.com)
- Facebook Graph API with Drupal Feeds (darrenmothersele.com)
- 36 New APIs: Cloud-Based Video Encoding, Fotomoto, RealGravity (programmableweb.com)
BC$ = Behavior, Content, Money
The goal of the BC$ project is to raise awareness and make changes with respect to the three pillars of information freedom - Behavior (pursuit of interests and passions), Content (sharing/exchanging ideas in various formats), Money (fairness and accessibility) - bringing to light the fact that:
1. We regularly hand over our browser histories, search histories and daily online activities to companies that want our money, or, to benefit from our use of their services with lucrative ad deals or sales of personal information.
2. We create and/or consume interesting content on their services, but we aren't adequately rewarded for our creative efforts or loyalty.
3. We pay money to be connected online (and possibly also over mobile), yet we lose both time and money by allowing companies to market to us with unsolicited advertisements, irrelevant product offers and unfairly structured service pricing plans.