trump-approval

1.0.4 • Public • Published

Trump Approval Fetcher

Fetches Donald Trump’s latest approval ratings, scraping them from RealClearPolitics.

And that’s all.

Thanks to RCP for the open-ish JSONP API. Or maybe just don’t say anything.

Returns a Promise, which resolves to Object:

{
  date: Date,         // datetime of latest poll average, as reported by RCP)
  favorable: Float,   // percentage Favorable ratings (eg: 40.8% would be .408)
  unfavorable: Float  // percentage Unfavorabel ratings
}

Real example (note that date is being console.log'd but it is indeed a Date:

{
  date: 2019-02-13T06:00:00.000Z, // trust me, it's a Date
  favorable: 0.408,
  unfavorable: 0.554
}

You’ll probably get ECONNRESET errors if you try too much; RCP wasn’t born yesternanosecond.

See also: thetrump.report (trump-dot-report)

Readme

Keywords

Package Sidebar

Install

npm i trump-approval

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

2.97 kB

Total Files

4

Last publish

Collaborators

  • unitof