1.0.0 • Published 7 years ago

trump-cabinet-picks v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

trump-cabinet-picks

NYT cabinet predictions for Trump admin.

Installation

$ npm i trump-cabinet-picks

Example

"use strict";

const trumpCabinetPicks = require("..");

trumpCabinetPicks().then(function (data) {
    console.log(JSON.stringify(data, null, 2));
}).catch(function (e) {
    console.error(e);
});
// {
//   "cabinetPositions": [
//     {
//       "title": "Commerce Secretary",
//       "description": "The Commerce Department ...",
//       "senate_confirmation": "Requires Senate confirmation",
//       "confirmed": false,
//       "predictions": [
//         {
//           "name": "Wilbur Ross",
//           "image": "https://static01.nyt.com/ne...",
//           "description": "Mr. Trump is expected..."
//         }
//       ]
//     },
//     ...
//   ]
// }

Documentation

trumpCabinetPicks(cb)

Scrapes the NYT page and extracts the relevant information.

Params

  • Function cb: An optional callback.

Return

  • Promise A promise object.

How to contribute

Have an idea? Found a bug? See how to contribute.

License

See the LICENSE file.