- httpie --
easy_install httpie
(probably you want tosudo easy_install httpie
- this script --
curl -o /usr/local/bin/json-to-csv.py https://raw.github.com/gist/4119347/24adb5dcd9c025c272042653a70d25b73b485958/json-to-csv.py
- make that executable --
chmod +x /usr/local/bin/json-to-csv.py
This example calls the Altmetric API, asking for the 2 most cited articles in blogs and news and prints a CSV on standard output containing the altmetric_id and score of each article.
% http http://api.altmetric.com/v1/citations/1d\?num_results\=2\&cited_in\=blogs,news | python json-to-csv.py -o altmetric_id,score -r results
altmetric_id,score
1077374,124.2
1066154,971.274
Save it to a file:
% http http://api.altmetric.com/v1/citations/1d\?num_results\=2\&cited_in\=blogs,news | python json-to-csv.py -o altmetric_id,score -r results > top-cited-news-blogs.csv
thanks for this!