simple c# expires example?

Discussion about Schedules Direct grabber code and data formats.

simple c# expires example?

Postby jriker1 » Mon Sep 26, 2016 12:12 pm

I am trying to pull the expiry date of my account from SD so I can create a custom app that will tell me when I am close to renewal. This app will plug into my nagios monitoring app and warn and then alert me when it's close to renewing. I know I may get an email but rather monitor this myself as well. Can someone provide me the base code in C# that would strictly retrieve the date my account will expire from SD?

Thanks.

JR
jriker1
 
Posts: 4
Joined: Mon Sep 26, 2016 11:56 am

Re: simple c# expires example?

Postby rmeden » Mon Sep 26, 2016 9:14 pm

In this forum there's a mention of a C# example to download data. Just request 30 seconds of data to make it fast, and look in the response for the expiration date.

I also think there's a simple Perl example in this forum (as well as the XMLTV distribution in Perl). Since Nagios is mostly Perl, integration should be easy.

Of course it's overkill... probably best to alarm on a failed data load or reduced data in your application.

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

Re: simple c# expires example?

Postby jriker1 » Tue Sep 27, 2016 6:57 am

Thanks I'll give perl a try on the nagios system. Is docs.tms.tribune.com:80 incorrect now? Sample I found makes this call:

my $dd_service='http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl';

I get:

Service description 'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl' can't be loaded: 500 Can't connect to docs.tms.tribune.com:80 (Bad hostname)

Thanks.

JR
jriker1
 
Posts: 4
Joined: Mon Sep 26, 2016 11:56 am

Re: simple c# expires example?

Postby jriker1 » Tue Sep 27, 2016 10:25 am

OK I got it now with a different address however what timezone is the data in? My return value is 2017-09-29T21:18:20Z but when calculating the difference between now, if I include the time need to know the timezone.

Thanks.

JR
jriker1
 
Posts: 4
Joined: Mon Sep 26, 2016 11:56 am

Re: simple c# expires example?

Postby rmeden » Tue Sep 27, 2016 8:09 pm

new hostname is dd.schedulesdirect.org
timezone is always UTC
rmeden
SD Board Member
 
Posts: 1486
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX

Re: simple c# expires example?

Postby jriker1 » Wed Sep 28, 2016 5:42 am

rmeden wrote:new hostname is dd.schedulesdirect.org
timezone is always UTC


Thanks. Got her working and reporting back, just need to convert my local time to UTC before the final calculation for accuracy.

EDIT: Looks like I don't need to change anything. Perl apparently returns localtime in UTC if you just specific you want now.

Thanks.

Steve
jriker1
 
Posts: 4
Joined: Mon Sep 26, 2016 11:56 am


Return to Developers Corner

Who is online

Users browsing this forum: No registered users and 2 guests

cron