(no commit message)
[duncan/vgncli.git] / vgn.rb
1 #!/usr/bin/env ruby
2
3 require 'open-uri'
4
5 origin = ARGV[0]
6 destination = ARGV[1]
7
8 puts origin
9 puts destination
10
11 #http://http//vgn.de/ib/site/tools/Interface_ASKIT_TRIP.php?origin=flughafen&destination=messe&date=20070615&time=0930
12
13 timestamp = Time.now
14
15 date = timestamp.strftime('%Y%m%d')
16 time = timestamp.strftime('%H%M')
17
18 url = "http://www.vgn.de/ib/site/tools/Interface_ASKIT_TRIP.php?origin=#{origin}&destination=#{destination}&date=#{date}&time=#{time}"
19 puts url
20
21 f = open(url, 'r')
22
23 xml = f.read
24
25 puts xml
26