1.0.1 • Published 6 years ago

wahlrecht v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

wahlrecht

Scrapes wahlrecht.de for the latest public opinion polls on the german general election (Bundestagswahl).

npm version Build Status Greenkeeper badge dependency status license chat on gitter

Installation

npm install wahlrecht

Usage

The module provides seperate methods for each institute:

  • allensbach()
  • emnid()
  • forsa()
  • politbarometer() - Forschungsgruppe Wahlen
  • gms()
  • dimap() - Infratest Dimap
  • insa()

and a method that combines all polls:

  • all()

Each method returns a promise that resolves in an array of objects like this:

{
	date: '2017-01-27T00:00:00+01:00',
	results: {
		union: 0.36,
		spd: 0.24,
		'grüne': 0.08,
		fdp: 0.06,
		linke: 0.1,
		afd: 0.11,
		sonstige: 0.05
	},
	sampleSize: 1303,
	period: '24.01.–26.01.',
	institute: 'politbarometer'
}

Simple example:

const wahlrecht = require('wahlrecht')

wahlrecht.all().then(console.log)
wahlrecht.dimap().then(console.log)

See also

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.