Skip to content

brasilsincero/brasilsincero-api

Repository files navigation

Brasil Sincero - API

Codeship Status for brasilsincero/brasilsincero-api

Getting Start

  • Clone project
  • Setup the database
$ bin/rails db:setup
  • Install Embulk - instructions here
  • Install Embulk dependencies
$ cd lib/embulk/embulk_bundle && embulk bundle install

Creating the infrastructure

$ bin/rails bolsa_familia:infrastructure

Downloading payments files

$ bin/rails "bolsa_familia:download[month, year]"

Downloading all payments files

$ bin/rails "bolsa_familia:download_all"

Importing 'Bolsa Fam�lia' records

$ bin/rails "bolsa_familia:import[month, year]"

Downloading and Importing payments files

$ bin/rails "bolsa_familia:download_and_import[month, year]"

Crawler

  • Install the httrack
  • Run the command
$ httrack --list public/crawler_urls.txt --depth=0 --max-time=600000000 --sockets=1 --timeout=600000000 --retries=1

Routes

Top 50 "bolsa familia" payments in the current year

/v1/bolsa_familia/people/ranking

Top 50 "bolsa familia" payments in the current year and state

/v1/bolsa_familia/people/ranking?state=sp

Top 50 "bolsa familia" payments in the informed year

/v1/bolsa_familia/people/ranking?year=YYYY

Top 50 "bolsa familia" payments in the informed year and state

/v1/bolsa_familia/people/ranking?year=YYYY&state=sp

Top "bolsa familia" payments grouped by state in the current year

/v1/bolsa_familia/states/ranking

Top "bolsa familia" payments grouped by state in the informed year

/v1/bolsa_familia/states/ranking?year=YYYY

Site

It is generated by Jekyll after each server initialization. The source is in site folder and the generated files are created in public/site folder, so the site is available in http://brasil-sincero-url/site.