<commit_before>'use strict'

var Wreck = require('wreck')
var config = require('../config')

function getPoliticians (request, reply) {
  var skipNum = request.query.skip ? parseInt(request.query.skip, 10) : 0
  var limitNum = request.query.limit ? parseInt(request.query.limit, 10) : 20
  Wreck.get(config.API_URL + '/politicians?skip=' + skipNum + '&limit=' + limitNum, function (error, res, payload) {
    reply(error || payload)
  })
}

function searchPoliticians (request, reply) {
  Wreck.get(config.API_URL + '/politicians/search/request.params.searchText', function (error, res, payload) {
    reply(error || payload)
  })
}

function getPolitician (request, reply) {
  var pID = parseInt(request.params.politicianID, 10)
  Wreck.get(config.API_URL + '/politicians/' + pID, function (error, res, payload) {
    reply(error || payload)
  })
}

function getParties (request, reply) {
  Wreck.get(config.API_URL + '/parties', function (error, res, payload) {
    reply(error || payload)
  })
}

function getParty (request, reply) {
  var pID = parseInt(request.params.partyID, 10)
  Wreck.get(config.API_URL + '/parties/' + pID, function (error, res, payload) {
    reply(error || payload)
  })
}

function getPartyMembers (request, reply) {
  var pID = parseInt(request.params.partyID, 10)
  Wreck.get(config.API_URL + '/parties/' + pID + '/members', function (error, res, payload) {
    reply(error || payload)
  })
}

function getCommittees (request, reply) {
  Wreck.get(config.API_URL + '/committees', function (error, res, payload) {
    reply(error || payload)
  })
}

function getCommittee (request, reply) {
  var cID = parseInt(request.params.committeeID, 10)
  Wreck.get(config.API_URL + '/committees/' + cID, function (error, res, payload) {
    reply(error || payload)
  })
}

function getCommitteeMembers (request, reply) {
  var cID = parseInt(request.params.committeeID, 10)
  Wreck.get(config.API_URL + '/committees/' + cID + '/members', function (error, res, payload) {
    reply(error || payload)
  })
}

module.exports.getPoliticians = getPoliticians

module.exports.searchPoliticians = searchPoliticians

module.exports.getPolitician = getPolitician

module.exports.getParties = getParties

module.exports.getParty = getParty

module.exports.getPartyMembers = getPartyMembers

module.exports.getCommittees = getCommittees

module.exports.getCommittee = getCommittee

module.exports.getCommitteeMembers = getCommitteeMembers
<commit_msg>Adds json: true for api<commit_after>'use strict'

var Wreck = require('wreck')
var config = require('../config')
var wreckOptions = {
  json: true
}

function getPoliticians (request, reply) {
  var skipNum = request.query.skip ? parseInt(request.query.skip, 10) : 0
  var limitNum = request.query.limit ? parseInt(request.query.limit, 10) : 20
  Wreck.get(config.API_URL + '/politicians?skip=' + skipNum + '&limit=' + limitNum, wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function searchPoliticians (request, reply) {
  Wreck.get(config.API_URL + '/politicians/search/request.params.searchText', wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getPolitician (request, reply) {
  var pID = parseInt(request.params.politicianID, 10)
  Wreck.get(config.API_URL + '/politicians/' + pID, wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getParties (request, reply) {
  Wreck.get(config.API_URL + '/parties', wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getParty (request, reply) {
  var pID = parseInt(request.params.partyID, 10)
  Wreck.get(config.API_URL + '/parties/' + pID, wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getPartyMembers (request, reply) {
  var pID = parseInt(request.params.partyID, 10)
  Wreck.get(config.API_URL + '/parties/' + pID + '/members', wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getCommittees (request, reply) {
  Wreck.get(config.API_URL + '/committees', wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getCommittee (request, reply) {
  var cID = parseInt(request.params.committeeID, 10)
  Wreck.get(config.API_URL + '/committees/' + cID, wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

function getCommitteeMembers (request, reply) {
  var cID = parseInt(request.params.committeeID, 10)
  Wreck.get(config.API_URL + '/committees/' + cID + '/members', wreckOptions, function (error, res, payload) {
    reply(error || payload)
  })
}

module.exports.getPoliticians = getPoliticians

module.exports.searchPoliticians = searchPoliticians

module.exports.getPolitician = getPolitician

module.exports.getParties = getParties

module.exports.getParty = getParty

module.exports.getPartyMembers = getPartyMembers

module.exports.getCommittees = getCommittees

module.exports.getCommittee = getCommittee

module.exports.getCommitteeMembers = getCommitteeMembers

{'fraction_non_alphanumeric': 0.1369701726844584, 'fraction_numerical': 0.0066718995290423865, 'mean_word_length': 4.594950603732163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6297485', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1648, 'n_words': 369}