Skip to content

cansadadeserfeliz/sitp_scraper

Repository files navigation

🤖 Telegram Bot

@sitp_bot

🚏 Installation

$ apt-get install postgis
$ createdb  <db name>
$ psql <db name>
> CREATE EXTENSION postgis;

$ cp sitp_scraper/local_settings.example.py sitp_scraper/local_settings.py

$ mkvirtualenv sitp_scraper
$ pip install -r requirements.txt

🚌 Usage

Run scrapy spider to get new SITP stations and routes from www.sitp.gov.co website:

scrapy crawl sitp

or

python manage.py start_scraper

to run it from Django.

Run Django project:

python manage.py runserver

Get coordinates for bus stations from Google maps API:

python manage.py get_station_coordinates_google

Get coordinates for bus stations from Civico:

python manage.py get_station_coordinates_civico

Get pair stations form www.sitp.gov.co website

"Pair stations" are stations that are located really close so we can count them as one.

python manage.py get_pair_stations

🚍 Idea

The idea is to make a map with all bus routes that would be easy to print.

For example:

🚎 Deployment

$ git pull
$ workon sitp_scraper
$ pip install requirements.txt
$ ./manage.py migrate
$ ./manage.py collectstatic
# Restart the uwsgi process

🚒 Links: