Coder Social home page Coder Social logo

api.mlb-data's Introduction

my name's ryan and I hate programming...

api.mlb-data's People

Contributors

rrickgauer avatar

Watchers

 avatar

api.mlb-data's Issues

Make an SQL Query builder class

  • Separate out the logic that creates the sql statements and executes them in DB-Functions.php
  • Use the values in the constants class to generate the select statements
  • Remove unused columns from sql queries

  • possibly make the class non-static
  • pass in the variables for the initialization
    • then I don't have to use the same exact static function parameters for every function
    • I can just call the individual functions themselves

Create search module

  • links to all the other submodules of the player
  • debut game
  • death date
  • list of teams the player played for
  • first name
  • last name

Add option to sum records

Instead of returning the seasonal stats for each module, add the option to sum all stats

batting?aggregate=true

Add people search module

  • /search/people?q='jon'
  • /search/players?q='jon'
  • /search/managers?q='jon'
  • /search/teams?q='Cubs'

Release timeline

  • finish 1.0 requirements
  • then create a demo page
    • any bugs that are found, make an issue for them
  • wait till demo page is completed to begin work on 2.0
  • once 1.0 is completed, assign all closed issues a label of 1.0
    • or link them to a release

Return all results for /people

  • If a user only loads /people, then return all rows using pagination.
  • Input parameters (?) will be:
    • page
  • To determine the required variables:
    • the constant per_page will be 1,000
    • total = count(DataSet)
    • numPages = floor(total / per_page)
  • the response body will contain a pagination section that gives:
    • first - the first page in the dataset: /people?page=1
    • next - the next page in the dataset: /people?page=13
    • last - the last page in the dataset: /people?page=19

Fix the DB-Functions count statements

  • Need to account for filters.
  • Use the same sql query as its related one, without the limit and offset. Then do a fetch all and return the number of records.
  • use the filters

Code cleanup

  • add comments to each function
  • reindent all files
    • 2 spaces
    • no tabs

Add images module

  • Make a new table in the database called images
  • table columns should be:
    • ID
    • playerID
    • source
  • add images module
  • if playerID is specified, return only the image links for that player

Add all fields to each constant module field array

  • Batting
  • Pitching
  • Appearances
  • Fielding
  • Images
  • People
  • FieldingOF
  • FieldingOFSplit
  • Salaries
  • Search
  • BattingPost
  • PitchingPost
  • FieldingPost
  • Colleges
  • BattingAggregate
  • PitchingAggregate
  • AppearancesAggregate
  • FieldingAggregate
  • FieldingOFAggregate
  • FieldingOFSplitAggregate
  • SalariesAggregate
  • BattingPostAggregate
  • PitchingPostAggregate
  • FieldingPostAggregate

add /playerID submodule

Returns the module stats for only that player.

Filter, sort, and aggregate parameters still work the same here.

Example: /batting/playerID

Create people modules

  • people/playerID - biographical
  • people/playerID/salaries - salary info
  • people/playerID/batting - batting stats
  • people/playerID/pitching - pitching stats
  • people/playerID/appearances - appearances
  • people/playerID/schools - schools attended

Rename files

  • all file names start with a capital letter
  • functions.php renamed to DB-Functions.php
  • api-functions.php renamed to API-Functions.php`

standardize all column names

For instance, sometimes it returns yearID, other times it returns year.

Also, for team names, return teamName

add pagination

  • First page: ?page=1
  • last page = ceil(count(dataSet) / perPage)
  • next page = page + 1
    • if page = lastPage, then next page = null

Make documentation

sort=HR:desc&filter=HR:>:47,SO:=:215

  • sort=columnName:[asc,desc]
  • filter=columnName:conditional:qualifier, columnName:conditional:qualifier

Add sorting

  • people
  • batting
  • pitching
  • fielding
  • fieldingOF
  • fieldingOFSplit
  • salaries
  • appearances

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.