LF: example in Ruby.

Discussion about Schedules Direct grabber code and data formats.
Post Reply
bernardb
Posts: 3
Joined: Tue Mar 25, 2008 11:25 am

LF: example in Ruby.

Post by bernardb »

Hello,

I was wondering if anyone could provide an example for fetching data in Ruby?

Thanks.


Bernard.

bernardb
Posts: 3
Joined: Tue Mar 25, 2008 11:25 am

Re: LF: example in Ruby.

Post by bernardb »

Wow, support is great on this forum...

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

Re: LF: example in Ruby.

Post by rmeden »

I wouldn't say that... I would assume that no one has a grabber written in Ruby.

Would you have preferred to get a large umber of "no" replies?

wensail
Posts: 17
Joined: Wed Aug 22, 2007 4:17 pm

Re: LF: example in Ruby.

Post by wensail »

Sorry, bernardb, can't help you with that Ruby stuff you asked about. I should have replied to tell you I can't help you much sooner. Hoping many MANY others will reply too, if they can't help you, so you will know just how many can't help you, not refusing to help you.

One other way to get attention if you think your post is "ignored" or failing to get "good" support, is to bump it so people see it again sooner. Since you are a guy who first posted in March and waited till August to complain about the poor support, I can't say I admire your initiative or your assumptions about this board. Or your logic.

bernardb
Posts: 3
Joined: Tue Mar 25, 2008 11:25 am

Re: LF: example in Ruby.

Post by bernardb »

Actually, bumping a thread that is only the 9 one on the list isn't going to help much. Anyway, never mind, I've moved away from Schedules Direct.

Thanks.

chet
Posts: 1
Joined: Wed Dec 31, 2008 11:28 pm

Re: LF: example in Ruby.

Post by chet »

i know this is kind of late. but here's some simple code that works for me. (i must say i didn't know about soap before yesterday, so i might not be doing it the right way)
If you're running debian, make sure to install the latest soap4r gem. The version provided by debian is buggy and doesn't support basic or digest auth.

Code: Select all

#!/usr/bin/ruby

require 'rubygems'
gem 'soap4r', '>=1.5.8'

require 'soap/wsdlDriver'
require 'soap/marshal'

USERNAME = "username"
PASSWORD = "password"

soap = SOAP::WSDLDriverFactory.new('http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl').create_rpc_driver
soap.options["protocol.http.auth"] << [soap.proxy.endpoint_url, USERNAME, PASSWORD]

#result = File.open('abigdump', 'rb') {|f| SOAP::Marshal.load(f)}

result = soap.download(DateTime.now.new_offset.to_s.sub('+00:00', 'Z'), (DateTime.now + 1).new_offset.to_s.sub('+00:00', 'Z'))

#File.open('abigdump', 'wb') {|f| SOAP::Marshal.dump(result, f) }

result.xtvd.stations.station.each do |station|
  puts "xmltvid: #{station.__xmlattr.first[1]}, callsign: #{station.callSign.ljust(8)}, name: #{station.name}"
end


Post Reply