ターミナルでJSONを見やすく表示する方法

しょっちゅう忘れるのでblogにして検索しやすくする。

% curl -q 'http://search.twitter.com/search.json?q=json&rpp=5&include_entities=true' | python -mjson.tool

結果。

{
    "completed_in": 0.008,
    "max_id": 329106124915744768,
    "max_id_str": "329106124915744768",
    "next_page": "?page=2&max_id=329106124915744768&q=json&rpp=5&include_entities=1",
    "page": 1,
    "query": "json",
    "refresh_url": "?since_id=329106124915744768&q=json&include_entities=1",
    "results": [
        {
            "created_at": "Tue, 30 Apr 2013 05:33:09 +0000",
            "entities": {
                "hashtags": [],
                "urls": [],
                "user_mentions": []
            },
            "from_user": "tetlazotlaliztl",
            "from_user_id": 90439302,
            "from_user_id_str": "90439302",
            "from_user_name": "\u30ab\u30b7\u30cf\u30e9",
            "geo": null,
            "id": 329106124915744768,

残念ながらutf8にはしてくれないけどお手軽。

Comments

comments powered by Disqus