Code Monkey home page Code Monkey logo

reverseproxy_nextbus's Introduction

reverseProxy_NextBus

A semantic reverse proxy service for NextBus, the San Francisco’s public transportation information feed. This is a reverse proxy for NextBus (http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf), written in Python. It could redirect the queries to the server, without explosing the information of the server. The reverse proxy service is provided via REST API. Besides, an statistic of slow queries are also provided with an customer configurable time value. It uses semantic knowledge base at the backend, with the support of an ontology and SPARQL.

Software Required:

Requests:

$ sudo pip install requests

rdflib:

$ sudo pip install rdflib

bottle:

$ sudo pip install bottle

Run:

$ sudo sh run.sh

Test:

$ sudo sh test.sh

REST APIs:

To query the list of agencies: http://localhost:3333/listAgency

To obtain a list of routes for an agency: http://localhost:3333/listRouteOf/

To obtain the route information of a specific route for an agency: http://localhost:3333/routeConfig//

To obtain the stop prediction information for a specific stop of a route for an angency: http://localhost:3333/predict///

To obtain the statistic information of queries slower than a customer configurable time value: http://localhost:3333/showStat/ It will show a list of endpoints with query time slower than the specfic value, and the number of requests for each endpoint.

example:

{"slow_queries": {"http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=ecu": "0.523815", "http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=ecu&stopId=chrisgym&routerTag=507": "0.574047", "http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList": "0.434237", "http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=ecu&r=507": "0.593672" }, "queries": { "http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=ecu": "1", "http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=ecu&stopId=chrisgym&routerTag=507": "1", "http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList": "1", "http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=ecu&r=507": "1" } }

Author: Qianru Zhou

reverseproxy_nextbus's People

Contributors

qianruzhou333 avatar

Watchers

 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.