Giter Club home page Giter Club logo

foodtrucks's Introduction

San Francisco Food Trucks

This is a command line program that displays all of the food trucks in San Francisco that are open right now (when the program is run) as well as their locations. It is written in Ruby.

What to install to run this program

  • You will need the ruby gem 'soda-ruby'

    • To install:
    • gem install soda-ruby

    Note: In order to use this gem, you need Ruby 2.0.0 or above. Check which version you are running by typing ruby -v

  • Clone this repository

  • Once you've cloned this repository, navigate into the foodtrucks folder in your directory.

  • Run your program from the command line by typing ruby show_open_food_trucks.rb

  • You do not need an app token to use this program, but if you plan to make heavy use of it, you should grab one here: https://dev.socrata.com/docs/app-tokens.html

    Follow these steps IF you need to use an app token:

    1. Install the ruby gem 'dot-env' gem install dotenv

    2. Make your own .env file and save your token as APP_TOKEN=REPLACEWITHYOURSECRETTOKEN

    3. Use your app token to identify your application. Replace SODA::Client.new({:domain => "data.sfgov.org"}) with SODA::Client.new({:domain => "data.sfgov.org", :app_token => APP_TOKEN})

What I'd do differently if building a full-scale application

  • I'd start with OOP design. I'd prefer to abstract the API call away to its own wrapper class and create food truck objects from the results of the API call.
  • I'd imagine that a future user might not want to just query what food trucks were open right now, but also make queries based on other factors such as location or another day of the week if they're planning ahead. Keeping that in mind, I'd construct the API wrapper functions to allow for not just one type of query but many and different combinations. This may or may not be a feature that gets implemented, but OOP design will help with supporting future features that are yet unknown.
  • Currently, my API call retrieves all trucks open today and there is an additional step to filter the results. This isn't very efficient, but I chose not to focus my time on fixing this. For a full-scale application, I would spend more time constructing the query to return only trucks that are open currently.

foodtrucks's People

Contributors

yasminor avatar

Watchers

 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.