<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mosmos_21</author_name>
  <author_url>https://blog.hatena.ne.jp/mosmos_21/</author_url>
  <blog_title>notepad.exe</blog_title>
  <blog_url>https://mosmos21.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>javascriptとスクレイピングの練習のためにbotを作りました。 botはこちら ばちゃこんお知らせbot ロジックはrequestで拾ってきたhtmlをcheerio使って解析しているだけ。 作っていて引っかかったのは配列の中に含まれるすべてのURLに対してリクエストをかけるところ。 Promiseチェーンで作るのはいいですが、全部の非同期通信が終わったら次のthenに行くのどうすればいいんだよと悩んでいたところで見つけたのがこれ Promise.all() 要はPromiseの配列を用意して渡してあげるとすべての評価が終わるまで待ってくれる便利な関数でした。 実際に使用している部分は…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmosmos21.hatenablog.com%2Fentry%2F2018%2F08%2F09%2F192904&quot; title=&quot;twitterのbotを作りました - notepad.exe&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-08-09 19:29:04</published>
  <title>twitterのbotを作りました</title>
  <type>rich</type>
  <url>https://mosmos21.hatenablog.com/entry/2018/08/09/192904</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
