New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flea-killer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flea-killer

Fleaflicker Baseball API

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-70.27%
Maintainers
1
Weekly downloads
 
Created
Source

flea-killer

Fleaflicker API through web scraping, since no official API exists.

API

For all examples:

var flea = require('flea-killer');

league.get(leagueType, leagueId, season, function(err, league))

leagueType is the Fleaflicker league ('nhl', 'mlb', etc.). leagueId is the Fleaflicker league ID. Returns all information availabile for the league from a single request. season is the year.

Example
flea.league.get('mlb', 13157, 2014, function(err, league){
  if (err) { return console.log('Handle Errors', err); }
  // See below for returned league object
  console.log(league);
});
Returned
{
  id: number,
  name: string,
  commish: string,
  type: string,
  slots: {
    total: number,
    available: number,
    taken: number
  },
  stats: [string]
  // array of teams scraped from the league
  teams: [{
    name: string
    rank: number
    points: number,
    link: string,
    id: number,
    owner: {
      name: string,
      link: string
    },
    stats: {
        // One key for each stat type in a league
        type: {
          points: number,
          value: number
        },
        ...
    },
  }, ... ]
}

team.get(leagueType, leagueId, teamId, season, function(err, team))

leagueType is the Fleaflicker league ('nhl', 'mlb', etc.). leagueId is the Fleaflicker league ID. teamId is the Fleaflicker league ID. Returns all information availabile for the team from a single request. season is the year.

Example
flea.team.get('nhl', 1800, 10370, 2014, function(err, team){
  if (err) { return console.log('Handle Errors', err); }
  // See below for returned draft object
  console.log(draft);
});
Returned
{
  id: number,
  name: string,
  owner: string,
  points: number,
  players: [{
    name: string,
    totalPoints: number,
    avgPoints: number
  }, ...]
}

draft.get(leagueType, leagueId, season, function(err, draft))

leagueType is the Fleaflicker league ('nhl', 'mlb', etc.). leagueId is the Fleaflicker league ID. Returns all information availabile for the league from a single request. season is the year.

Example
flea.draft.get('mlb', 13157, 2014, function(err, draft){
  if (err) { return console.log('Handle Errors', err); }
  // See below for returned draft object
  console.log(draft);
});
Returned
{
  league: {
    id: number,
    name: string
  },
  // array of picks from the draft
  picks: [{
    round: number,
    pick: {
      // Overall draft number
      overall: number,
      // Round specific draft number
      round: number
    },
    team: {
      id: number,
      name: string
    },
    player: {
      id: number,
      name: string
    }
  }, ...]
}

Keywords

FAQs

Package last updated on 03 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc