Coder Social home page Coder Social logo

chrome_data_7c's Introduction

ChromeData

Provides a simple ruby interface for Chrome Data's API. Read more about it here: http://www.chromedata.com/

The wonderful lolsoap gem does most of the heavy lifting.

Installation

Add this gem to your application's Gemfile:

gem 'chrome_data'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chrome_data

Usage

Configuration

Valid options:

  • account_number (required)
  • account_secret (required)
  • country (default: 'US')
  • language (default: 'en')
  • cache_store

Configuration:

ChromeData.config.merge! { account_number: 1234, account_secret: '5678' }

Requests

Data Collection

Makes (Divisions)

Fields:

  • id (Integer)
  • name (String)

Request a set of divisions:

ChromeData::Division.find_all_by_year(1999)

Request models for a division (same as ChromeData::Model.find_all_by_year_and_division_id)

mazda = ChromeData::Division.new(id: 26, name: "Mazda")
mazda_models = mazda.models_for_year(1999)

Models

Fields:

  • id (Integer)
  • name (String)

Find models for year and division

mazda_models = ChromeData::Model.find_all_by_year_and_division_id(1999, 26)

Find styles for a specific model (same as ChromeData::Style.find_all_by_model_id)

miata = ChromeData::Model.new(id: 4768, name: "MX-5 Miata") # 1999 Mazda MX-5 Miata
miata_styles = miata.styles

Styles

Fields:

  • id (Integer)
  • name (String)

Only loaded through a Vehicle:

  • trim (String)
  • name_without_trim (String)

Find styles for a model by model id

miata_styles = ChromeData::Style.find_all_by_model_id(4768)

Vehicle

Fields:

  • division (String)
  • engines (Array of Engine)
  • model (String)
  • model_year (Integer)
  • styles (Array of Style)

Find a vehicle by VIN

vehicle = ChromeData::Vehicle.find_by_vin('JM1NB3536X0131402')

Engine

Engines are only loaded through a find_by_vin request

Fields:

  • type (String)

Model Years

Years start at 1981 due to VIN standardization

ChromeData::ModelYears.all

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

chrome_data_7c's People

Contributors

aevin1387 avatar bclubb avatar hsm3 avatar jaredmdobson avatar jimryan avatar nlindley avatar patrickae avatar thegrubbsian avatar theotherzach avatar tiwatson avatar tonycoco 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.