npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fut

v0.9.3

Published

fifa 17 web-app api

Downloads

17

Readme

fut - FIFA 17 - unofficial

Usage

Quick start

'use strict'

const readline = require('readline')
const Fut = require('fut')
const Promise = require('bluebird')
const co = require('co')
const storage = require('node-persist')
storage.initSync()

var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})

const email = process.env.EMAIL
const password = process.env.PASSWORD
const platform = process.env.PLATFORM
const secret = process.env.SECRET

var fut = new Fut({
  email,
  password,
  secret,
  platform
  loginType: 'web'
  // this is optional and happens rarely
  captchaHandler: (captcha, resolve) => {
    co(function * () {
      yield fs.writeFileAsync('captcha.jpg', captcha)
      // Do something with the captcha file
      resolve(captchaRes.text)
    })
  },
  tfAuthHandler: (send) => {
    return new Promise((resolve, reject) => {
      rl.question('Enter your two factor code:', function (code) {
        return resolve(code)
      })
    })
  },
  // yo can return a simple sync function to save/loadVariable
  saveVariable: (key, val) => {
    console.log('setting item', key)
    storage.setItem(key, val)
  },
  // or a promise if you do something async
  loadVariable: co.wrap(function * (key) {
    var item = storage.getItem(key)
    return item
  })
})

co(function * () {
  yield fut.login()
  let resp = yield fut.getCredits()
  console.log(resp)
}).catch((e) => console.log(e.stack))

Note: All method returns a promise!

Options

See source: https://github.com/futjs/fut-api/blob/master/src/index.js#L20

Login

See quick start, better docs coming soon...

  • platform: "ps3","ps4","pc","x360","xone"

Credits

  apiClient.getCredits()
  • response: Object
    • credits: number
    • bidTokens: ??
    • currencies: []
      • name: string
      • funds: number
      • finalFunds: number
    • unopenedPacks: Object
      • preOrderPacks: number
      • recoveredPacks: number

Pilesize

  apiClient.getPilesize()
  • response: Object
    • entries: []
      • value: number
      • key: number -> 2 == Tradepile, 4 == Watchlist

Tradepile

  apiClient.getTradepile()
  • response: Object
    • credits: number
    • currencies: []
      • name: string - values "COINS","POINTS","DRAFT_TOKEN"
      • funds: number
      • finalFunds: number
    • duplicateItemIdList: ??
    • errorState: ??
    • auctionInfo: []
      • bidState: string
      • buyNowPrice: number
      • confidenceValue: number
      • currentBid: number
      • expires: number
      • offers: number
      • sellerEstablished: number
      • sellerId: number
      • sellerName: string
      • startingBid: number
      • tradeId: number
      • tradeOwner: boolean
      • tradeState: string
      • watched: boolean
      • itemData: object
        • assetId: number
        • assists: number
        • attributeList: []
          • index: number
          • value: number
        • cardsubtypeid: number
        • contract: number
        • discardValue: number
        • fitness: number
        • formation: string
        • id: number
        • injuryGames: number
        • injuryType: string
        • itemState: string
        • itemType: string
        • lastSalePrice: number
        • leagueId: number
        • lifetimeAssists: number
        • lifetimeStats: []
          • index: number
          • value: number
        • loyaltyBonus: number
        • morale: number
        • nation: number
        • owners: number
        • pile: number
        • playStyle: number
        • preferredPosition: string
        • rareflag: number
        • rating: number
        • resourceId: number
        • statsList: []
          • index: number
          • value: number
        • suspension: number
        • teamid: number
        • timestamp: number
        • training: number
        • untradeable: boolean

Relist tradepile

  apiClient.relist()
  • response: Object
    • tradeIdList: []
      • id: number

Watchlist

  apiClient.getWatchlist()
  • response: -> see tradepile response

Transfermarket

  apiClient.search({type: "player", lev: "gold", maskedDefId: 183907, pos: "CB" })
  • filter
    • searchFilterBase
      • type: string -> player, training, development
      • start: number -> page
      • num: number -> items per page
      • micr: number -> min bid
      • macr: number -> max bid
      • minb: number -> min buy
      • maxb: number -> max buy
      • lev: string -> bronze, silver, gold
    • playerSearchFilter extends searchFilterBase
      • maskedDefId: number -> baseId
      • rare: string -> SP
      • zone: string -> defence, midfield, attacker
      • pos: string -> GK, CB, LB, RB, ...
      • nat: number -> nationId
      • leag: number -> leagueId
      • team: number -> teamId
      • playStyle: number -> playerStyleId
    • consumableFilter extends searchFilterBase
      • cat: string -> playerTraining, GKTraining, position, playStyle, managerLeagueModifier, contract, fitness, healing
    • positionChangeSearchFilter extends consumableFilter
      • pos: string -> LB-LWB (OLD-NEW)
    • playerStyleSearchFilter extends consumableFilter
      • playStyle: number -> playerStyleId
  • response: -> see tradepile response

Place bid

  apiClient.placeBid(tradeId, coins)
  • tradId: number
  • coins: number
  • response: -> see tradepile response

List item

  apiClient.listItem(itemDataId, startingBid, buyNowPrice, duration)
  • itemDataId: number -> itemData.id

  • startingBid: number

  • buyNowPrice: number

  • duration: number -> seconds -> valid values 3600 = 1h, 10800 = 3h, 21600 = 6h, 43200 = 12h, 86400 = 1d, 259200 = 3d

  • response:

    • id: number

Auction status

  apiClient.getStatus([tradeIds])
  • tradeIds: number[] -> tradeId
  • response: -> see tradepile response

Add to watchlist

  apiClient.addToWatchlist(tradeId)
  • tradeId: number -> tradeId

remove from tradepile

  apiClient.removeFromTradepile(tradeId)
  • tradeId: number -> tradeId

remove from watchlist

  apiClient.removeFromWatchlist(tradeId)
  • tradeId: number -> tradeId

send to tradepile

  apiClient.sendToTradepile(itemDataId)
  • itemDataId: number -> itemData.id
  • response: Object
    • itemData: []
      • id: number
      • pile: string
      • success: boolean

send to tradepile

  apiClient.sendToClub(itemDataId)
  • itemDataId: number -> itemData.id
  • response: Object
    • itemData: []
      • id: number
      • pile: string
      • success: boolean

Quick sell

  apiClient.quickSell(itemDataId)
  • itemDataId: number -> itemData.id
  • response: Object
    • items: []
      • id: number
    • totalCredits: number

Functions

Validate price/coins

    futapi.isPriceValid(coins)

returns true or false

Calculate valid price/coins

    futapi.calculateValidPrice(coins)

returns valid coins amount

Calculate next lower price/coins

    futapi.calculateNextLowerPrice(coins)

returns next lower coins after calculating valid price

Calculate next higher price/coins

    futapi.calculateNextHigherPrice(coins)

returns next higher coins after calculating valid price