Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

influencemapping/whos_got_dirt-json_file_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Who's got dirt? JSON file API

Dependency Status Code Climate

This is a simple API that wraps remote JSON files.

API

get /:url?path=path&q=query

The :url parameter must be a whitelisted URL that returns a JSON array. The required path query string parameter is a JSON Pointer that will be evaluated against each item in the JSON array to produce a values list. The required q query string parameter will be compared and scored against each item in this values list to produce a results list, which will be returned as a JSON response.

Development

bundle
export WHOSGOTDIRT_WHITELIST=http://quienmanda.es/entities.json,https://wdts-dizzib0.rhcloud.com/api/nodes
bundle exec rackup
curl http://localhost:9292/http%3A%2F%2Fquienmanda.es%2Fentities.json?path=/name&q=instituto
curl http://localhost:9292/https%3A%2F%2Fwdts-dizzib0.rhcloud.com%2Fapi%2Fnodes?path=/name&q=mtv

Deployment

heroku apps:create
heroku addons:create memcachier:dev
heroku config:set WHOSGOTDIRT_WHITELIST=http://quienmanda.es/entities.json,https://wdts-dizzib0.rhcloud.com/api/nodes
heroku config:set WHOSGOTDIRT_THRESHOLD=0.2
git push heroku master

Notes

String comparison in other languages:

Copyright (c) 2015 James McKinney, released under the MIT license

About

A simple API to wrap remote JSON files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages