No commit activity in last 3 years
No release in over 3 years
Web scrapes a bus timetable from Lothian Buses website. #edinburgh #scotland
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.3.2, ~> 0.3
 Project Readme

Introducing the lothianbusestimetable gem

require 'lothianbusestimetable'

lbt = LothianBusesTimetable.new
lbt.fetch_timetable '44'
a = lbt.timetable[:weekday][:outbound]["Meadowbank House"]

Time.now #=> 2017-08-22 14:06:26 +0100 

# find the bus times for the 44 (for the next 40 minutes, 20 minutes from now) 
# from the bus stop near to Meadowbank House heading into town

a2 = a.select do |x| 
  t = Time.strptime(x, "%H%M")
  (t > Time.now + 60 * 20) and (t < Time.now + 60 * 60)
end

#=> ["1432", "1442", "1452", "1502"]

Resources

timetable bus lothianbuses edinburgh times