GithubHelp home page GithubHelp logo

seubert / austin-recycles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-austin/austin-recycles

1.0 1.0 1.0 1.84 MB

Application and web service that provides trash and recycling pickup information for the City of Austin.

Home Page: http://austin-recycles.open-austin.org/

austin-recycles's Introduction

Austin Recycles

About

"Austin Recycles" consists of a web application plus a web service that provides trash and recycling pickup information for the City of Austin.

More info here: http://atxhack.wikispaces.com/Austin+Recycles

Demo site: http://austin-recycles.open-austin.org/

Issues and support queue: https://github.com/open-austin/austin-recycles/issues

Usage

First start the web service. For development, run "bin/austin-recycles" from a command line. For production, run via Phusion Passenger.

Then, browse the "index.html" page.

Requirements

At this time, the "findit-support" package must be manually installed into the vendor directory. See: vendor/README

The SPATIALITE path may need to be specifically set when running the service:

SPATIALITE=/usr/local/opt/libspatialite/lib/libspatialite.dylib bin/austin-recycles

For more information, see: vendor/findit-support/README.rdoc

Web Service API:

The web service provides a simple interface to retrieve service information for a given location. The location is specified as degrees latitude and longitude.

Here is an example:

REQUEST:

GET http://localhost:4567/svc?latitude=30.362&longitude=-97.734 

RESPONSE:

{
   "origin" : {
      "longitude" : -97.734,
      "latitude" : 30.362
   }
   "routes" : {
      "bulky" : {
         "route" : "BU30",
         "type" : "BULKY",
         "next_service" : {
            "period" : "WEEK",
            "timestamp" : 1376197200000,
            "status" : "PENDING",
            "date" : "08/11/2013",
            "day" : "Sun",
            "slip" : null
         }
      },
      "brush" : {
         "route" : "BR22",
         "type" : "BRUSH",
         "next_service" : {
            "period" : "WEEK",
            "timestamp" : 1368334800000,
            "status" : "PAST",
            "date" : "05/12/2013",
            "day" : "Sun",
            "slip" : null
         }
      },
      "recycle" : {
         "route" : "RHAU14",
         "type" : "RECYCLE",
         "next_service" : {
            "period" : "DAY",
            "timestamp" : 1371704400000,
            "status" : "PENDING",
            "date" : "06/20/2013",
            "day" : "Thu",
            "slip" : null
         }
      },
      "yard_trimming" : {
         "route" : "HY10",
         "type" : "YARD_TRIMMING",
         "next_service" : {
            "period" : "DAY",
            "timestamp" : 1371099600000,
            "status" : "PENDING",
            "date" : "06/13/2013",
            "day" : "Thu",
            "slip" : null
         }
      },
      "garbage" : {
         "route" : "PAH60",
         "type" : "GARBAGE",
         "next_service" : {
            "period" : "DAY",
            "timestamp" : 1371099600000,
            "status" : "PENDING",
            "date" : "06/13/2013",
            "day" : "Thu",
            "slip" : null
         }
      }
   },
}

For each route, the "next_service" fields indicate:

  • timestamp - The service date, milliseconds since epoch.
  • period - Either DAY (the timestamp indicates the day on which service should occur) or WEEK (the timestamp indicates the start of the week in which service should occur)
  • date - Printable date, from the service date.
  • day - Printable day of week, from the service date.
  • status - ACTIVE (the service is happening now or about to happen), PENDING (the service is in the future), or PAST (the service has already occurred).
  • slip - Number of days the service has slipped due to a holiday, or "null" if no slip.

Helpful notes

Installing findit-support and spatialite

Check the "vendor/README" file for instructions for installing the findit-support package.

Query parameters for debug

You can add query parameters to the application to assist in debugging. Example:

http://localhost/index.html?svc=http://austin-recycles.open-austin.org/svc&delay=5

The supported parameters are:

  • svc -- URL of the web service. By default, the web service URL is calculated from the document URL, i.e. the web service is assumed to be running on the same server as the application. You may want to use this, for instance, if you are debugging the application locally, but want to use an instance of the web service elsewhere.

  • delay -- A delay (in seconds) added for web service responses. The delay value is passed to the web service, which will delay by that amount before responding. I've used this, for instance, when I wanted to verify that the "busy throbber" is displaying correctly.

  • t -- Value to use for current date. Must be a valid Date.parse() value, such as "?t=July+3,+2014".

  • status -- Override calculated status of a service. The format is "id:status[,id:status...]". Example usage: http://stuff?status=recycle:active,bulky:past Valid id values are: garbage, yard_trimming, recycle, brush, bulky. Valid status values are: active, pending, past.

Database browser

If you are working with the web service, you may want a tool to browse the database. The SpatiaLite GUI app is a good tool. You also can use a SQLite tool, even though the geometry columns will just appear as blobs. One option is:

https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/

austin-recycles's People

Contributors

courtney-rosenthal avatar hdaniel avatar khit avatar travishohl avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jchammons

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.