<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Sixeight</author_name>
  <author_url>https://blog.hatena.ne.jp/Sixeight/</author_url>
  <blog_title>ちなみに</blog_title>
  <blog_url>https://blog.nishimu.land/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>たとえばSlackの Incoming Webhook でメッセージを送るときに、メッセージ部分だけを置き換えてJSONを組み立てたいことがあります。 プログラミング言語が使えるなら簡単なんですが、ちょっと大げさな気もするので jq だけでJSONを組み立てられるとべんりそうです。 {&quot;text&quot;:&quot;hi&quot;} このようなJSONを組み立てて送信したいとして、&quot;hi&quot; の部分を変数にしてみます。 {&quot;text&quot;:$text} この $text の部分を任意の文字列に置き換えるには --arg オプションを使います。(-n / -c) $ jq -n -c --arg text hi '{&quot;tex…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.nishimu.land%2Fentry%2F2021%2F09%2F25%2F171036&quot; title=&quot;jqで簡易テンプレート - ちなみに&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn.blog.st-hatena.com/images/theme/og-image-1500.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-09-25 17:10:36</published>
  <title>jqで簡易テンプレート</title>
  <type>rich</type>
  <url>https://blog.nishimu.land/entry/2021/09/25/171036</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
