VoteSmart API Library |
[eluser]matula[/eluser]
Here's a straight-forward library that can be used to access the VoteSmart.org API. Download from GitHub To install, simply put the votesmart.php config file in the config folder, and the votesmart.php library file in the libraries folder. Get an API key from VoteSmart, and put it in the votesmart config file. Load the library in your controller Code: $this->load->library('votesmart'); The call the votesmart query function like this: Code: $this->votesmart->query('CandidateBio.getBio', Array('candidateId' => 9026)); The first parameter is the API method you’re calling. The second parameter is an array of required variables, if needed. All the available methods can be found here. |
Welcome Guest, Not a member yet? Register Sign In |