How to start?

Discussion about Schedules Direct grabber code and data formats.

How to start?

Postby rgeddes » Fri Jan 09, 2009 2:21 pm

Hi,
I'm interested in getting tv programming schedule info via a php web application and I have a few questions:

1. Can I "try before I buy" to see the quality of the information that is delivered by SD? What's the easiest way to check out the SD service?

2. I looked at the sample php code and see the following
Code: Select all
$client = new SoapClient
$client->download(...)

and looking up the SoapClient class on the PHP website, it only shows the new method for the constructor
Code: Select all
SoapClient->__construct()

and no "download" method.

Does the sample php code work with PHP 5.x?

Thanks
Richard
rgeddes
 
Posts: 2
Joined: Fri Jan 09, 2009 1:47 pm

Re: How to start?

Postby rmeden » Fri Jan 09, 2009 7:15 pm

I believe the PHP SOAP libraries requires PHP 5.2 or greater.

We offer a 7 day trial.

BTW.. your PHP app cannot be publicly accessible on the internet, as that would be considered "redistribution". Redistribution is not allowed by our contract with Tribune Media Services, and hence a violation of our subscriber agreement.

Robert
rmeden
SD Board Member
 
Posts: 1497
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX

Re: How to start?

Postby rgeddes » Sat Jan 10, 2009 1:21 pm

The code I posted came from the file called ẗmsfetch.php in the "Official Documentation and Sample Programs" topic of this forum. I will keep this restriction in mind for future posts... thanx for that.

I was merely pointing out that in PHP 5.x, constructing class objects should be done with the __construct() function and not the 'new' keyword... the documentation over at php.net reflects this... the sample (tmsfetch.php) from this forum uses the 'new' keyword and it left me guessing.

I guess I could just run the code and see what happens. Thanks for the advise on 7 day trial.

Richard
rgeddes
 
Posts: 2
Joined: Fri Jan 09, 2009 1:47 pm

Re: How to start?

Postby xris » Sun Jan 11, 2009 11:39 pm

Functions like __construct() and __destruct() should never be called directly by other parts of the code. Use of an underscore prefix to a method name is a convention many developers use to indicate "private" methods.. PHP took this one step further and used double-underscore to denote special private functions.

Please see the following:

http://www.php.net/manual/en/language.oop5.decon.php

As for the SOAP stuff, the official PHP SOAP libraries do require 5.2.x. I believe there were some older libraries that worked in earlier versions, but the 5.2.x versions are much more reliable and I would recommend upgrading if you can.

As for the example, I apologize -- we didn't write it. If it helps I can tell you that the SD website SOAP code (in PHP) looks something like this:

Code: Select all
$soap = new SoapClient(
    $wsdl_url,
    array('trace'     => 0,    // Set to 1 to use __getLastRequest, etc...
        'exceptions'  => 0,
        'login'       => $username,
        'password'    => $password
        )
    );
xris
SD Board Member
 
Posts: 127
Joined: Fri Aug 17, 2007 10:22 am


Return to Developers Corner

Who is online

Users browsing this forum: No registered users and 3 guests