From 7cb9e03365f25c49aaa58f156fa4d5dfa0a1b609 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Tue, 15 Apr 2008 00:14:22 +0200 Subject: [PATCH 1/1] --- vgn.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 vgn.rb diff --git a/vgn.rb b/vgn.rb new file mode 100755 index 0000000..014c21d --- /dev/null +++ b/vgn.rb @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby + +require 'open-uri' + +origin = ARGV[0] +destination = ARGV[1] + +puts origin +puts destination + +#http://http//vgn.de/ib/site/tools/Interface_ASKIT_TRIP.php?origin=flughafen&destination=messe&date=20070615&time=0930 + +timestamp = Time.now + +date = timestamp.strftime('%Y%m%d') +time = timestamp.strftime('%H%M') + +url = "http://www.vgn.de/ib/site/tools/Interface_ASKIT_TRIP.php?origin=#{origin}&destination=#{destination}&date=#{date}&time=#{time}" +puts url + +f = open(url, 'r') + +xml = f.read + +puts xml + -- 2.39.2