Giter Site home page Giter Site logo

pemiluapi / calon-api-endpoint Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 5.0 818 KB

The Candidate API is a service that provides information about candidates running for office in the 2014 Indonesian elections.

Home Page: http://docs.candidateapi.apiary.io/

Ruby 98.31% JavaScript 0.93% CSS 0.76%

calon-api-endpoint's Introduction

pemiluAPI

Build Status

2014 Pemilu API

Installation

The steps below assume you are working on a Ubuntu machine.

Apache2 and PHP5

  1. Install Apache2

    $ sudo apt-get install -y apache2
  2. Enable mod_rewrite and mod_headers

    $ sudo a2enmod rewrite
    $ sudo a2enmod headers
    $ sudo service apache2 restart
  3. Install PHP5

    $ sudo apt-get install -y php5 libapache2-mod-php5 php5-cli php5-curl

    For Ubuntu Saucy or above (>= 13.10), also install the following package:

    $ sudo apt-get install php5-json

Application

  1. Install Git

    $ sudo apt-get install -y git
  2. Clone this project

    $ git clone https://github.com/pemiluAPI/pemiluAPI.git
  3. Go to the project directory and dowload Composer

    $ cd pemiluAPI
    $ wget http://getcomposer.org/composer.phar
  4. Install the framework's dependencies

    $ php composer.phar install
  5. Set the web directory as the DocumentRoot. Modify the /etc/apache2/sites-available/default file as follow

    DocumentRoot /var/www/pemiluAPI/web
    <Directory /var/www/pemiluAPI/web>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
    </Directory>
    

    Please note that your modification need may vary depending on your Apache2 setup.

  6. Restart Apache2

    $ sudo service apache2 restart
  7. Open up http://127.0.0.1/status and you should see message

    {"error":{"type":"invalid_request_error"}}
    
  8. Open up http://127.0.0.1 and you should see

    {"error":{"message":"Unrecognized request URL (GET: \/).  Please see http:\/\/developer.pemiluapi.org\/.","type":"invalid_request_error"}}
    

calon-api-endpoint's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calon-api-endpoint's Issues

set limit to zero to get around default

As of 661226e there's a default limit of 100 candidates on any call that doesn't explicitly set a limit.

I'd like to be able to defeat that limit by explicitly setting limit to 0 in the query string.

For example, this request will return a list of 100 of the 119 total matching records:

http://api.pemiluapi.org/candidate/api/caleg?apiKey=fea6f7d9ec0b31e256a673114792cb17&dapil=1200-01-0000

I'd like this request to return all 119 matching records:

http://api.pemiluapi.org/candidate/api/caleg?apiKey=fea6f7d9ec0b31e256a673114792cb17&dapil=1200-01-0000&limit=0

pemilu: A beautiful Ruby interface for Pemilu APIs

baru saja merilis gems https://rubygems.org/gems/pemilu , tujuannya sih buat mempermudah Ruby developer mengakses Pemilu APIs.

contoh simple nya, dengan gem ini aku bisa dapet 10 list Candidate dengan mudah.

    require "pemilu"

    pemilu = Pemilu::API.new(key: "06ec082d057daa3d310b27483cc3962e")
    # => #<Pemilu::API:0xb8d8f76c @key="06ec082d057daa3d310b27483cc3962e">

    candidates = pemilu.candidates(limit: 10)
    # => [#<Pemilu::Candidate:0xb8e38204 .... ]

    candidates.each do |candidate|
        puts "Name: #{candidate.name}"
    end 
     # Name: ADNAN N.S
     # Name: Dr. AHMAD FARHAN HAMID, M.S.
     # Name: Drs. H. ANHARUDDIN, S.E., M.M.
     # Name: ANWAR
     # Name: H. ASY'ARI, S.Pd.I.
     # Name: Drs. AZHARI USMAN, M.Si.
     # Name: DASLELIATY
     # Name: ERDARINA, S.P.
     # Name: FACHRUL RAZI, M.I.P.
     # Name: H. FACHRURRAZI, S.E.

lebih lengkapnya https://github.com/pyk/pemilu ,

regards,
Bayu Aldi Yansyah

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.