タグ

cliとjsonに関するanimistのブックマーク (2)

  • jq

    jq is a lightweight and flexible command-line JSON processor. jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text. jq is written in portable C, and it has zero runtime dependencies. You can download a single binary, scp it to a far away machine of the same type, and expect

    animist
    animist 2015/06/01
    JSON をパースして sed / awk / grep みたいな事を可能にしてくれるコマンド。くっそ便利そう
  • cloudpackブログ - jqってなんじゃ?(containsで簡単APIテスト)

    jqはsedのjson版のようなコマンドラインツールで、jsonデータをフィルタしたり切り取ったり整形したりが 簡単にできます。 aws界隈ではaws cliがjsonを返すことで話題になったようで、以下の記事などで紹介されています。 suz-lab : EC2の価格のJSONを”jq”でいじってみた jqの1.2では、containsという関数が追加されたようで、jsonに特定の要素が含まれているかどうかの真偽値を 返すようです。 これを使うことで簡単なAPIテストが出来るんじゃないかと思い、試してみました。 こんな感じのJSONがあったとします。 $ curl -s http://aws.amazon.com/jp/ec2/pricing/pricing-on-demand-instances.json | jq '.config.regions[].region' "us-east"

    cloudpackブログ - jqってなんじゃ?(containsで簡単APIテスト)
  • 1