diff options
| author | Teddy Wing | 2013-05-20 23:04:25 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2013-05-20 23:04:25 -0400 | 
| commit | 8f284c4aa109bcc26d6fff2c6e4f41c24abee11e (patch) | |
| tree | ab544eb5df00054345f3545e7a9d0125935eac00 | |
| parent | 02a5e52d982404f03a0e484b14a1565fd2feb2ce (diff) | |
| download | Boston-Food-Truck-Schedule-API-8f284c4aa109bcc26d6fff2c6e4f41c24abee11e.tar.bz2 | |
Add README and LICENSE
| -rw-r--r-- | LICENSE | 19 | ||||
| -rw-r--r-- | README.md | 67 | 
2 files changed, 86 insertions, 0 deletions
| @@ -0,0 +1,19 @@ +Copyright (c) 2013 Teddy Wing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
\ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..cc805de --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +Boston Food Truck Schedule API +============================== + +An API for the Boston food truck schedule. The original food truck schedule from the City of Boston website is available here: http://www.cityofboston.gov/business/mobile/schedule-tabs.asp + +This was written because I wanted to be able to filter food trucks by those within walking distance from downtown. + + +# PHP API usage +An example of PHP API usage is available in the `index.php` file. + +Here's another example of what's needed and how to use the API: + +    require_once('boston_food_trucks.php'); + +    $BostonFoodTrucks = new BostonFoodTrucks; +     +    $schedule = $BostonFoodTrucks->schedule(array( +        'trucks'       => array('CloverDEV'), +    	'days_of_week' => array(date('l')), +    	'times_of_day' => array('Lunch'), +    	'locations'    => array('City Hall Plaza, Fisher Park') +    )); + +You can include multiple filter options for each of `trucks`, `days_of_week`, `times_of_day`, and `locations`. Filters are not required. You can make use of all filters, some filters, or none at all. Querying the schedule with no filters, for example, will return all trucks on all days at all time periods at all locations. + + +# HTTP API usage +The HTTP API uses the PHP API as a backend, providing a thin layer over it for you to get food trucks in JSON over HTTP. The API operates over GET. + +Here's how to get all food trucks for Tuesday and Wednesday at lunch via curl: + +    curl -d "days_of_week[]=Tuesday&days_of_week[]=Wednesday×_of_day[]=Lunch" -G http://example.com/http.php + +Here is the truncated output of that call: + +    { +      "food_trucks": [ +        { +          "company": "Roxy's Gourmet Grilled Cheese 1", +          "company_url": "http:\/\/www.roxysgrilledcheese.com", +          "day_of_week": "Tuesday", +          "time_of_day": "Lunch", +          "location": "Greenway (at High St #1)" +        }, +        { +          "company": "Roxy's Gourmet Grilled Cheese 1", +          "company_url": "http:\/\/www.roxysgrilledcheese.com", +          "day_of_week": "Wednesday", +          "time_of_day": "Lunch", +          "location": "(4) Prudential, on Belvidere Street " +        }, +        { +          "company": "Area Four", +          "company_url": "", +          "day_of_week": "Tuesday", +          "time_of_day": "Lunch", +          "location": "Greenway (at High St #1)" +        }, +     +        ... +      ] +    } + + +# License +Boston Food Truck Schedule API is licensed under the MIT License. See the included LICENSE file. | 
