项目作者: s8sachin

项目描述 :
Mysore city bus info API
高级语言: Ruby
项目地址: git://github.com/s8sachin/mysore_city_bus.git
创建时间: 2017-03-23T03:36:51Z
项目社区:https://github.com/s8sachin/mysore_city_bus

开源协议:MIT License

下载





Stories in Ready

README

This is just an open source API repo for Mysore City Bus. Created using webscrapping techniques.
Original link to KSRTC ITS
We have just extracted data and saved in different format to serve our purpose.

Android App:

Get it on Google Play

This api is used in making an android app. Get it on playstore(click on above image).


The web scrapping logic used can be found in /lib/tasks directory containing rake files.

Usage:

  1. Clone the repo using git clone https://github.com/s8sachin/mysore_city_bus.git or git clone git@github.com:s8sachin/mysore_city_bus.git

  2. Setup your database.yml

  3. bundle install

  4. bundle exec rake db:create db:migrate

  5. Initially the bus routes details are stored in /db/master_data/bus_routes.csv. You can directly import them by running bundle exec rake import:bus_routes

  6. Or you can scrap data from web by running bundle exec rake scrap:bus_routes, This creates CSV file in /db/master_data. Then run ‘bundle exec rake import:bus_routes’

  7. Check routes.rb for list of API paths.

Heroku API

This app is deployed on Heroku and the api can be used from heroku.

Examples (Heroku)

  1. Get list of all bus numbers API Path /get_all_bus_numbers

eg: https://mcb-api.herokuapp.com/get_all_bus_numbers

  1. Get list of all bus stops API Path /get_all_bus_stops

eg: https://mcb-api.herokuapp.com/get_all_bus_stops

  1. Get list of routes from a bus number /get_routes_by_bus_num?bus_num=

request params : “bus_num”

eg: https://mcb-api.herokuapp.com/get_routes_by_bus_num?bus_num=119%20Up

  1. Get list of bus numbers by “source” and “destination” /get_bus_numbers_by_source_and_destination?source=&destination=

request params : “source” , “destination”

eg: https://mcb-api.herokuapp.com/get_bus_numbers_by_source_and_destination?source=Dasappa%20Circle&destination=Infosys

  1. Get list of buses going on a perticular “bus stop” /list_of_bus_on_bus_stop?bus_stop=

request params : “bus_stop”

eg: http://mcb-api.herokuapp.com/list_of_bus_on_bus_stop?bus_stop=Dasappa%20Circle

Fork and help us improve ### :)