Giter Site home page Giter Site logo

coding-challenge-crawler-a's Introduction

Objective

Write a crawler for National Express that can extract:

  • list of stops
  • list of departures

Step 1: get stops

This process is done once to create a mapping between National Express stops and existing stops, if possible.

From this page, get the list of all bus stops including the address, latitude and longitude. The output should be stored in a stops.json file and the schema should be something like this:

[
  {
    "stop_name": "Dundee, Scotland",
    "stop_location":"Seagate Dundee, Seagate Bus Station, Tayside Scotland",
    "lat":56.46338,
    "long":-2.9657300000000077
  }
]

The step should be invoked like so

python run.py --extract stops --output stops.json

Step 2: get departures

This process is done repeatedly to update our database of departure. As an input, this function should accept an origin, destination and a range of dates for which departures will be returned.

  1. Go to this page
  2. Use the normal view or accessible view from the 'choose your journey' box to get a list of departures for each origin-destination pair of stops obtained in step 1.
  3. For each departure extract the following information:
  • origin_stop
  • destination_stop
  • departure time
  • arrival time
  • duration
  • adult one-way price

The output should be stored in departures.json

The step should be invoked like so

python run.py --extract departures --output departures.json --startdate 2013-11-13 --enddate 2013-11-20

Non-functional requirements

  • the code should be written in Python and compatible with Python 2.7.
  • the code should be hosted on github, and the repo should be shared with Busbud and submitted as a pull request
  • the code should be written in a way that it can easily be extended to become a scheduled process that updates our database of departure
  • any packages required must be installable via pip install -r requirements.txt, see pip

coding-challenge-crawler-a's People

Contributors

cdnbacon avatar lrhache avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.