<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:cc="http://web.resource.org/cc/"
  xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://seppina.cocolog-nifty.com/blog/">
<title>セッピーナの趣味の天文計算</title>
<link>http://seppina.cocolog-nifty.com/blog/</link>
<description>Excelでできる天文計算とデジカメと小型望遠鏡による天体観測のブログです。

記事内容に関する変更履歴や正誤表は
「このブログの変更履歴・正誤表など」
http://seppina.cocolog-nifty.com/blog/version.html
にありますのでExcelファイルを使われる方は必ずごらんください。
このブログにあるコンテンツは文章、画像、グラフ、Excelファイル、プログラムソース等すべて自由に引用あるいは再利用していただいてかまいません。
ただしお互いのオリジナリティーはたいせつにしていただきますようお願いします。
なおプロフィールにある画像は駒田京伽さん（https://pychanxx.wixsite.com/mysitexx1234）が提供されているものです。</description>
<dc:language>ja-JP</dc:language>
<dc:creator></dc:creator>
<dc:date>2021-04-19T22:01:33+09:00</dc:date>


<items>
<rdf:Seq><rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2021/04/post-c75481.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2020/06/post-ca6757.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/10/post-1c4dba.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/10/post-7df814.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/09/post-7f617a.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/08/post-740e26.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/08/post-a2dbbc.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/08/post-9b442d.html" />
<rdf:li rdf:resource="http://seppina.cocolog-nifty.com/blog/2019/07/post-fec00d.html" />
</rdf:Seq>
</items>

</channel>

<item rdf:about="http://seppina.cocolog-nifty.com/blog/2021/04/post-c75481.html">
<title>さくらインターネットのレンタルサーバーでGOで書いたCGIを動かした(苦労)話</title>
<link>http://seppina.cocolog-nifty.com/blog/2021/04/post-c75481.html</link>
<description>作っているCGIは一言で言えば、データベースから利用者の指定した条件で引っ張って...</description>
<content:encoded><![CDATA[<p>作っているCGIは一言で言えば、データベースから利用者の指定した条件で引っ張ってきたデータを表やグラフにして提供する、というようなものです。<br /><br />自分でサーバーを立てて、みたいなことをやる機材も気力もないのでレンタルサーバーを使うことにします。<br />・GOのコンパイラーが使えて<br />・GOで書いたCGIを動作させてることができる（許されている）<br />レンタルサーバーということになるのですが、今契約しているさくらインターネットのレンタルサーバーがこれに該当します。<br /><br />ただ残念なことに私が契約しているサーバーはOSが「FreeBSD 9.1-RELEASE-p24 #0: Thu Feb 5 10:03:29 JST 2015」ということで、これにはGOのコンパイラーは入っていません。何年か前からOSは徐々に新しいバージョンへ移行しているようですが、私のサーバーのOSの更新がいつになるのかよくわかりません。そこで新しいサーバーを借りてみました。こちらは「FreeBSD 11.2-RELEASE-p14 #0: Mon Aug 19 22:38:50 UTC 2019」とGOが使えるやつでした（お試し期間があるので、その間にチェックが可能です）<br />GOは「go version go1.15.5 freebsd/amd64」でした。<br />レンタルサーバーはMySQLとSSHが使える中でいちばんお安いスタンダードプランで月524円でした。<br /><br />ところでFreeBSD 9.1の方にGOのコンパイラーを入れてはどうかとも考えるのですが、これはやめた方がよさそうです。<br />FreeBSD 9.1ではコンパイラのバイナリは古いバージョンのものしか動かないのですが、ググると「<span>Go 1.4.3 バイナリで Go 1.7.4 ソースをビルドする</span> 」みたいな話がありました。実際1.4.3のコンパイラは動くのを確かめたのですが...<br /><br />・MySQLのアクセスのために<span>"github.com/go-sql-driver/mysql"を使っていて<br />・このSQL Driverは「</span>Go 1.10 or higher. We aim to support the 3 latest versions of Go.」<br />・一方「Go 1.10 now requires FreeBSD 10.3 or later」<br /><br />ということでFreeBSD 9.1でどうにかしようというのはムリみたいです。11.2で作ったモジュールを9.1に持っていっても動かないのは確認済みですし w<br /><br />--------------<br /><br />GOコンパイラーが使える環境は整ったのでCGIのコーディングなのですが、今回は次のようなパッケージを使用しました。<br /><span> <br /></span><span>1.　"net/http"<br />2.　"html/template"<br /><br />3.　"github.com/PuerkitoBio/goquery" <br />4.　"database/sql"<br />5.　"github.com/go-sql-driver/mysql"<br /><br />6.　"github.com/ajstarks/svgo/float"<br /><br />7.　"github.com/dustin/go-humanize" <br /><br />--------------<br /><br />3.、4.、5.はMySQLのアクセス用です。<br /><br />これについてはいろんな記事があるのでそういうのを参照すればいいのですが、次の問題には手間取りました。<br /><br />　　「<a href="https://tech-up.hatenablog.com/about">技術向上</a>　- <a href="https://tech-up.hatenablog.com/entry/2019/01/05/212630">MySQL - invalid memory address or nil pointer dereference【Go】</a>」<br /><br />私と同じところではまる人もいそうな気がするので紹介しておきます。<br /><br /></span><span>--------------<br /><br />6.はグラフを作るのに使っています。まあ、グラフができさえすればいいということであれば、それなりのパッケージがあるのですが、（SVG大好き人間なので）自前で作っています。これからSVGの特色を生かしていければと思っています。<br />なお"github.com/ajstarks/svgo/"というのもあり、これだと座標をint型で与えることになるのでグラフを作るというような目的</span><span>であればfloatのついた方（座標はfloat64で与えます）がいいでしょう。intの方で作って拡大・縮小の機能を利用したほうがいのかもとも思いますが。<br /><br />これについても一点だけ書いておくと、SVGを書き出すファイルはClose()する前にFlush()する必要があります。これをしないとSVGが途中でぶった切れてしまいます。<br /><br />--------------<br /><br />7.は表に数値を表示するとき3桁ごとにカンマを入れるという目的で使っています。 <br /><br />--------------<br /><br />ド素人で、最初は簡単なCGIなのでstdoutにhtmlを出力すればいいんだろうくらいに考えていたのですが、あさはかな考えでちゃんと1.とか2.を使うべきです。<br /><br />"net/http"はおもしろくて、CGIとして作ったプログラムがソースを一行書き換えるだけでWebサーバーのように動きます。<br /></span></p>
<pre><code>	if OS == "windows" {<br />		// Webサーバーとして起動<br />		http.ListenAndServe(":8080", nil)<br />	} else {	//	"freebsd"<br />		// CGIとして起動<br />		cgi.Serve(nil)<br />	}<br />
</code></pre>
<p><span><br />このおかげで<br /><br />・Windowsでプログラムを作り、Windows10上でテストする。<br />・テストが完了したらレンタルサーバーにftpで上げてコンパイルする。<br /><br />というときWindowsでWebサーバーを用意する必要がありません。もっともWindowsとFreeBSDでまったく同じソースが動くわけでもないです。</span><span>パスがからむところは注意した方がいいようです（要するにWebサーバーから見える景色とCGIから見える景色は異なる）<br />一例を上げると<br /></span></p>
<pre><code>	if OS == "windows" {  //  SVGファイルの置き場所<br />		http.Handle("/", http.FileServer(http.Dir("public")))<br />	}<br /></code><code></code></pre>
<pre><code>	rootPath := ""<br />	if OS == "freebsd" {<br />		rootPath = os.Getenv("SCRIPT_NAME")<br />	}<br />	http.HandleFunc(rootPath+"/top", HandlerTopForm)<br />	.<br />	.<br /></code></pre>
<p>上の方はSVGファイルを表示させるhtmlを</p>
<pre><code><span>　　&lt;img </span><span class="html-attribute-name">src</span><span>="</span><a class="html-attribute-value html-resource-link" href="http://21.matrix.jp/TEST/public/46.svg" target="_blank" rel="noreferrer noopener">/TEST/public/46.svg</a><span>" </span><span class="html-attribute-name">alt</span><span>="</span><span>" </span><span class="html-attribute-name">width</span><span>="</span><span class="html-attribute-value">100%</span><span>"&gt;</span>
<br /></code></pre>
<p>のようにして、表示できるようにするためです。<br /><br />下の方はURLがWindowsの場合<br />　　http://localhost/top<br />になるのに対しレンタルサーバーでは<br />　　http://xxx.sakura.ne.jp/CGI.cgi/top<br />みたいになることへの対応です。<br /><br />以上、コーディングはWindowsだったら/FreeBSDだったらとなっていますが、意味的にはWebサーバーだったら/CGIだったらということです。これらはもっと簡単な対策があるのかもしれませんが...<br /><br />--------------<br /><br />ところで、実際のところソースをレンタルサーバーに持っていってコンパイルすると頻繁に強制終了が発生してコンパイルできないことがあります。このとき動いているプロセスをkillするとコンパイルできるので、どうやら何かのリソースの制限みたいなのにひっかかっているようです（同じような現象として「go get」を行ったときの強制終了というのもあります）<br /><br />この対策は簡単で、Windowsでテストが終わったら、そのままクロスコンパイルしてロードモジュールを作りこれをアップロードすればOKです。<br /><br />書き忘れましたが Windows側は<br />　　go version go1.15.5 windows/amd64<br />です。IDEはliteideを使っています。<br /><br />--------------<br /><br /><span>"html/template"は、面倒くさそうだなあと思って使い始めたのですが、こんなに便利なものはないです。コーディング量が画期的に減るということもあるのですが、ちょっとした変更がソースではなくテンプレートの方で済ませられるのでらくちんです。<br /><br /></span>ちょっと複雑なhtmlになると最初どうしたらいいかよくわからなかったのですが、<br /><br />1.　htmlを複数に分割して、それぞれにデータを与える。<br />2.　htmlの構造に合わせた構造体を作る（構造体を作るときどのようなhtmlで使うかを意識しておく）<br /><br />のどちらかで（あるいは両方を組み合わせれば）対応できるようです。2.の方がすっきりしているようですが、実際はかなり泥臭い構造体になってしまうので、まあどっちもどっちみたいな気がします。<br /><br />1.の方はこんな感じです。</p>
<pre><code>	tpl := template.Must(template.ParseFiles(<br />		"templates/top1.gtpl",<br />		"templates/top2.gtpl",<br />	))<br /></code><code>	...<br /></code><code> 	...<br />	if err := tpl.ExecuteTemplate(w, "top1.gtpl", eventlist); err != nil {<br />	... <br />	... <br />	}<br />	...<br /></code><code> 	... <br />
	if err := tpl.ExecuteTemplate(w, "top2.gtpl", eventinf); err != nil {<br />	... <br />	... <br />
	}<br />
</code></pre>
<p><br />それからHTML5だとinputをformとは別に書いたり、formの中に（formactionを使って）複数のsubmitをおいたりできるので、このあたりを利用するとレイアウトの自由度が格段に大きくなります。<br /><br />以上、雑然としていますが、私がつまずいたポイントを思い出しながら書いてみました。<br /><br />他にもviでUTF-8が表示できないとか、Windows側のMySQLでUTF-8が使えない、と言ったこともあったのですが、これはCGIに限ったことではないので省略します。<br /><br />ここまで来るのにずいぶんググったのですが、なかなか自分が必要とする情報に行き着きませんでした。そういうとき少しは参考になるのではと思います。</p>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2021-04-19T22:01:33+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2020/06/post-ca6757.html">
<title>SHOWROOM - イベントでの配信者の獲得ポイント数を取得する - スマホ版(android版)</title>
<link>http://seppina.cocolog-nifty.com/blog/2020/06/post-ca6757.html</link>
<description>Playストアのレビューに「これぞ神アプリ！」という声が多いandroidのアプ...</description>
<content:encoded><![CDATA[<p><span style="font-size: 12pt;">Playストアのレビューに「これぞ神アプリ！」という声が多いandroidのアプリ termux を利用して、<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/06/post-231815.html">SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版）</a>」</em>にあるソースをスマホに移植してみました。<br /><br /></span><span style="font-size: 12pt;">具体的な手順を以下に記しますが、迷うところは何もない"一本道"で簡単に環境構築から実行までできました。<br /></span><span style="font-size: 12pt;">しいて言えばハードウェア関連（OTG、bluetoothで接続するキーボード、マウスとそれに関連する設定）がいろいろやっかいです。ググるとキーボード入力が思うように行かないという話もいろいろあります。これについては環境が落ち着いたところで記事にまとめたいと思っています。<br /><br />今回の環境<br />android 7.0<br />termux v0.95<br /></span><span style="font-size: 12pt;">go1.14.4 android/arm64<br /><br />ZTE BLADE V0800　3GB/32GB　Qualcomm Snapdragon 435 8コア 1.4G<br />USBキーボード （OTG+セルフパワータイプのUSBハブ）<br />USBマウス（ 〃 ）<br />Chromecast Charcoal<br />REGZA 19RE2　<br /><br /><span>-------<br /></span> <br />ずっとPC中心の生活をしていたのですが、去年の11月にPCが壊れてしまいそのままスマホ中心の生活になってしまいました。<br />スマホがあればPCがなくてもけっこういろいろなことができるものだと再認識している今日このごろです。<br />termux を使ったり、この記事を書くときは スマホにキーボードとマウスを接続し、Chromecastで画面をテレビにミラーリングしています。<br />ちなみにテレビにミラーリングするときはいわゆるドットバイドットにして左端が切れないようにしておくのと、termuxのフォントを小さくしておく（Ctrl+Alt+"-"、大きくするのはとうぜん<span>Ctrl+Alt+"+"</span> ）のがポイントです。<br /></span><span style="font-size: 12pt;"><a href="https://seppina.cocolog-nifty.com/photos/uncategorized/screenshot_20200628091354.jpg" target="_blank" rel="noopener"><img style="margin: 3px;" title="Screenshot_20200628091354" src="https://seppina.cocolog-nifty.com/blog/images/screenshot_20200628091354.jpg" alt="Screenshot_20200628091354" width="300" height="168" border="0" /></a> <br />viでソースを編集しているところ。termuxのフォントを小さくしてあるのでステータスバーやボトムナビゲーション(?)がやたら大きく見えます w<br /><br /></span><span style="font-size: 12pt;">-------<br /><br /></span><span style="font-size: 12pt;">ソースは<span><em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/06/post-231815.html">SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版）</a>」</em></span> にあるものがそのまま使えます。ただ（最大）1分ウェイトするところがあり、これは無反応とみなされて待ってるあいだにダイアログが表示されるようなので、6秒ごとに何か出力するとかした方がいいと思います。この対応でバックグラウンドでも動くと思います。<br /><br /></span><span style="font-size: 12pt;">ウェイトをしている<br /><br /></span><span style="font-size: 12pt;">　　time.Sleep(time.Duration(60-ss) * time.Second)<br /></span></p>
<p><span style="font-size: 12pt;">のところを<span>例えば</span><br /></span><span style="font-size: 12pt;"><br />　　 for et := 0; et &lt; 60-ss; et += 5 {<br /></span><span style="font-size: 12pt;">　　　　fmt.Print(".")<br /></span><span style="font-size: 12pt;">　　　　time.Sleep(5 * time.Second)<br /></span><span style="font-size: 12pt;">　　}<br /><br /></span><span style="font-size: 12pt;">とします（上と下は処理内容が少々(最大4秒ですし、この差が累積することもないです）違います。私は気になりませんが、数分に一度データを取得するので気になるという方は、ここだけでなく全体的にタイミングを見直してください）<br /><br />--------<br /><br />具体的な手順<br /><br />termuxをplayストアからダウンロード、インストールして実行するとシェルのプロンプトが表示されますので、コマンドを以下のように実行して行きます。<br /><br />補足<br /><br />"termux-setup-storage"　を実行すると内部ストレージへのシンボリックリンクが　~/storage　の下にできます。どこでも参照できるわけでもないようで、今のところ私は ~/storage/dowloads でデータのやりとりをしています。<br />なお SDカードは /mnt/sdcard で参照できます。<br /><br />"apt install vim" は vi を使うためです。"apt install git"は今回は必要ないのですが、"go get ....." で必要になることがあるので....<br /><br />"apt install termux-elf-cleaner" はロードモジュールを実行したときの warning が表示されないようにするために必要です。ビルドと実行のあいだで使っています。<br /><br /><span>実行時にデータファイルとして RoomList.txt とRoomList.txtでファイル名を指定した一つ以上のファイル（この例では mikakunin_showroomer.txt ）が必要です。<br />ファイルの内容は（タブがスペースになっていますが）下記に表示させていますが、このファイルでのテストは "mikakunin_showroomer" のイベントが終了するまでしかできません。それ以後は実行中のイベントで同じように作ってください。念のため。<br /><br /></span>----------</span></p>
<pre><code></code></pre>
<pre><code></code></pre>
<p>$ apt update<br />..........................</p>
<pre><code></code></pre>
<pre><code></code></pre>
<pre><code></code></pre>
<p>$ apt upgrade<br />..........................</p>
<pre><code></code></pre>
<pre><code></code></pre>
<p>$ termux-setup-storage</p>
<pre><code></code></pre>
<p>$ ls<br />storage</p>
<pre><code></code></pre>
<p>$ apt install vim<br />..........................</p>
<pre><code></code></pre>
<p>$ apt install git<br />..........................</p>
<pre><code></code></pre>
<p>$ apt install termux-elf-cleaner<br />..........................</p>
<pre><code></code></pre>
<p>$ apt install golang<br />..........................</p>
<pre><code></code></pre>
<p>$ go env<br />..........................</p>
<pre><code></code></pre>
<p>$ mkdir go</p>
<pre><code></code></pre>
<p>$ cd go</p>
<pre><code></code></pre>
<p>$ cp -r ~/storage/downloads/EvalPoint2 .</p>
<pre><code></code></pre>
<p>$ cd EvalPoint2</p>
<pre><code></code></pre>
<p>$ ls<br />EvalPoint2-a.go RoomList.txt<br />EvalPoint2.go mikakunin_showroomer.txt</p>
<pre><code></code></pre>
<p>$ cat RoomList.txt<br />mikakunin_showroomer.txt</p>
<pre><code></code></pre>
<p>$ cat mikakunin_showroomer.txt<br />0 0 0<br />Room00 e50cf1039407 mikakunin_showroomer 96747 false 1 2<br />Room01 61a5e3199543 mikakunin_showroomer 243565 false 1 2<br />Room02 norichan mikakunin_showroomer 192641 false 1 2<br />Room03 kogachan mikakunin_showroomer 198346 false 1 2<br />Room04 c8f783773817 mikakunin_showroomer 291006 false 1 2</p>
<pre><code></code></pre>
<p>$ ./EvalPoint2-a 6 5 2 0 0 0<br />Interval= 5 Mod= 2 HH_Detail= 0<br />skip mm=37..........<br />0 0 0<br />Room00 e50cf1039407 mikakunin_showroomer 96747 false 1<br />Room01 61a5e3199543 mikakunin_showroomer 243565 false 1<br />Room02 norichan mikakunin_showroomer 192641 false 1<br />Room03 kogachan mikakunin_showroomer 198346 false 1<br />Room04 c8f783773817 mikakunin_showroomer 291006 false 1<br />5<br />1 1867385 90882 e50cf1039407<br />2 1776503 90882 61a5e3199543<br />3 1354703 421800 norichan<br />4 729289 625414 kogachan<br />5 699805 29484 c8f783773817<br />2020/6/27 8:38:2 1867385 1776503 1354703729289 699805<br />.......^C<br />$</p>
<pre><code></code></pre>
<p> </p>
<pre><code>
<br /></code></pre>]]></content:encoded>


<dc:subject>SHOWROOM</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2020-06-28T17:40:31+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/10/post-1c4dba.html">
<title>SHOWROOMのAPI - 「ライブ情報」の取得..JSONのもう一つの扱い方</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/10/post-1c4dba.html</link>
<description>前記事 「SHOWROOMのAPI - 「ライブ情報」の取得（GO言語のソースつ...</description>
<content:encoded><![CDATA[<p>前記事 <em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/10/post-7df814.html">SHOWROOMのAPI - 「ライブ情報」の取得（GO言語のソースつき）</a>」</em>にSHOWROOMのAPIから返されるJSONからデータを取得する方法があります。これは複雑な（大きな）JSONからひとつ、ぶたつのデータを取り出すやり方としてはいいのですが、JSONから取り出すデータが多いとき（特にほとんどのデータがほしいとき）には面倒になるので、JSONに対応する構造体を作ってそこに代入させる方が手間がかかりません。<br /><br />前記事とほとんど同じ機能をもつサンプルプログラムを作成しましたので紹介しておきます。この程度だったらどっちでも同じようなものですが....<br />（参考にしたサイトなども前記事にあります）<br /><br />---------------------<br /><br />恥ずかしくて書きたくないのですが、このプログラムはちょっとはまりました。「パッケージ外から参照できるのは最初の文字が大文字の変数だけ」というのを忘れてました。忘れてたというか、どういう場合このルールが適用されるのかよく理解できていませんでした w<br />（逆に言うと大文字だと外部から参照できるわけで、変数名の付け方はちゃんと考えるようにします。いまさらですが...）<br /><br />=======================================</p>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Room_IDで指定したルームの配信状況を確認するためのAPI</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">live_info</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">のテストプログラムです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Live_Live_info</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">Room_ID</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">Room_ID</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">配信ルームのID、アカウントっぽい方じゃなくて（ふつう）数字6桁くらいのやつです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">参考</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">SHOWROOMのAPI</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">「ライブ情報」の取得（GO言語のソースつき）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">http://seppina.cocolog-nifty.com/blog/2019/10/post-7df814.html</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>main</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"fmt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"os"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"encoding/json"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"net/http"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">Live_Live_info2(</span>id<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span>live_status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is_enquete<span style="color: #c0c0c0;"> </span><span style="color: #000080;">bool</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>bg_image<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームの配信状況を確認するためのURL（このURLについては記事参照）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>URL<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"https://www.showroom-live.com/api/live/live_info?room_id="</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>id</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>resp<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>http<span style="color: #000000;">.</span>Get<span style="color: #000000;">(</span>URL<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">一時的にデータが取得できない。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>resp<span style="color: #000000;">.</span>Body<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">panic(err)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>resp<span style="color: #000000;">.</span>Body<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">JSONをデコードする。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>result<span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">struct</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Age_verification_status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Video_type<span style="color: #c0c0c0;">              </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Enquete_gift_num<span style="color: #c0c0c0;">        </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Is_enquete<span style="color: #c0c0c0;">              </span><span style="color: #000080;">bool</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Bcsvr_port<span style="color: #c0c0c0;">              </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Live_type<span style="color: #c0c0c0;">               </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Is_free_gift_only<span style="color: #c0c0c0;">       </span><span style="color: #000080;">bool</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Bcsvr_host<span style="color: #c0c0c0;">              </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Live_id<span style="color: #c0c0c0;">                 </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Is_enquete_result<span style="color: #c0c0c0;">       </span><span style="color: #000080;">bool</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Live_status<span style="color: #c0c0c0;">             </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Room_name<span style="color: #c0c0c0;">               </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Room_id<span style="color: #c0c0c0;">                 </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Bscvr_key<span style="color: #c0c0c0;">               </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Background_image_url<span style="color: #c0c0c0;">    </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>json<span style="color: #000000;">.</span>NewDecoder<span style="color: #000000;">(</span>resp<span style="color: #000000;">.</span>Body<span style="color: #000000;">).</span>Decode<span style="color: #000000;">(&amp;</span>result<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000080;">panic</span><span style="color: #000000;">(</span>err<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>live_status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>result<span style="color: #000000;">.</span>Live_status</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>is_enquete<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>result<span style="color: #000000;">.</span>Is_enquete</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>bg_image<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>result<span style="color: #000000;">.</span>Background_image_url</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">main()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">パラメータの数をチェックします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"usage:"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">0</span><span style="color: #000000;">],</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"room_id"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>live_status<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is_enquete<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>bg_image<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>Live_Live_info2<span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">1</span><span style="color: #000000;">])</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Error</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">in</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">intLive_Live_info()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"live_status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>live_status<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"is_enquete="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is_enquete<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"bg_image=&lt;"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>bg_image<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"&gt;"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>]]></content:encoded>



<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-10-28T11:14:54+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/10/post-7df814.html">
<title>SHOWROOMのAPI - 「ライブ情報」の取得（GO言語のソースつき）</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/10/post-7df814.html</link>
<description>先日「SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版...</description>
<content:encoded><![CDATA[<p>先日「<a href="http://seppina.cocolog-nifty.com/blog/2019/06/post-231815.html">SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版）</a>」という記事を書き、使っているAPIのURLは某巨大掲示板にころがってたやつです、って書いたのですが、SHOWROOMのAPIをきちんとまとめられている方がいらっしゃいました。<br /><br />　　「<a href="https://qiita.com/takeru7584">たける</a> - <a href="https://qiita.com/takeru7584/items/f4ba4c31551204279ed2">SHOWROOMのAPIについて（現在26個公開。引き続き調査中）</a>」<br /><br />---------<br /><br />「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</a>」に書いたように今"自動三周ツール"の改良版を作成しています。その中で応援しているルーム（星投げ・種投げの対象ルーム）が配信中か否かのチェックを視聴者数が0でないかということでやっていたのですが、ちょっとタイムラグがあるようです。<br /><br />どうしようか考えていたのですが、上の記事を見ると、ちゃんと配信状況を知るAPIがあるみたいです。これを使わない手はないと思いAPIの機能チェックのプログラムを書いてみました（ソースは記事の最後にあります）<br /><br />Live_statusが具体的にどういう値になるのかわからなかったのですが、テストプログラムを実行してみると、配信中でないとき 1、配信中のとき 2、となるようです。<br /><br /><a href="https://seppina.cocolog-nifty.com/photos/uncategorized/result.png" target="_blank" rel="noopener"><img style="margin: 3px;" title="Result" src="https://seppina.cocolog-nifty.com/blog/images/result.png" alt="Result" width="300" height="200" border="0" /></a><br /><br />最初の実行結果は配信中のもので、Live_statusは2となっています。次の実行結果は配信終了後のものでLive_statusは1になっています。<br /><br />これ以外の値をとるのかとらないのか？は今後の課題です。<br /><br />なお、JSONのデコードは<br /><br /><em>　　「<a href="https://qiita.com/msh5">qiita @msh5</a> - <a href="https://qiita.com/msh5/items/dc524e38073ed8e3831b">Go言語でJSONに泣かないためのコーディングパターン</a>」</em> <br /><br />の記事を参考にさせていただきました。<br /><br />-----------------------------</p>
<p>main()<br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</a>」</em></p>
<p>　　SetEnvironment() 環境やポリシーに依存するパラメータを設定します。</p>
<p>　　SetBlackList() 星集め/種集めの対象としないルームのリストを作ります。</p>
<p>　　GetCategoryList() 公式枠/アマチュア枠に該当するジャンル（の位置）をオンライブ画面から検出します。</p>
<p>　　BreakDownSchedule() 配信スケジュールから星集め/種集め、星投げ/種投げ、カウントの<br />　　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-7f617a.html">SHOWROOM 星集め・星投げツール スケジュールの詳細化 BreakDownSchedule() （三周のやり方を例に）</a>」</em></p>
<p>　　Scheduler() タスクリストにしたがって星集め/種集め、星投げ/種投げ、カウントを行います。</p>
<p>　　　　MakeTaskList() タスクリストから現在時（時分）に実行すべきタスクの集まり（タスクグループ）を抜き出します。</p>
<p>　　　　GetRoomList() 星集め/種集めの対象とするルームのリストを作ります。</p>
<p>　　　　CollectStarts() 星集め/種集めを行います。</p>
<p>　　　　ThrowStars() 星投げ/種投げを行います。</p>
<p>　　　　Count50() カウントを行います。</p>
<p>共通して使用する主な関数</p>
<p>　　MakeNewPage() ブラウザ画面を開きます。<br />　　ClosePage() ブラウザ画面を閉じます。<br /><br /><br />=================================================<br /><br /></p>]]><![CDATA[<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Room_IDで指定したルームの配信状況を確認するためのAPI</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">live_info</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">のテストプログラムです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Live_Live_info</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">Room_ID</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">Room_ID</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">配信ルームのID、アカウントっぽい方じゃなくて（ふつう）数字6桁くらいのやつです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">参考</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">SHOWROOMのAPI</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">「ライブ情報」の取得（GO言語のソースつき）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">http://seppina.cocolog-nifty.com/blog/2019/10/post-7df814.html</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>main</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"fmt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"os"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"encoding/json"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"net/http"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">Live_Live_info(</span>id<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span>live_status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is_enquete<span style="color: #c0c0c0;"> </span><span style="color: #000080;">bool</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームの配信状況を確認するためのURL（このURLについては記事参照）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>URL<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"https://www.showroom-live.com/api/live/live_info?room_id="</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>id</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>resp<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>http<span style="color: #000000;">.</span>Get<span style="color: #000000;">(</span>URL<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">一時的にデータが取得できない。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>resp<span style="color: #000000;">.</span>Body<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">panic(err)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>resp<span style="color: #000000;">.</span>Body<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">JSONをデコードする。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>result<span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">interface</span><span style="color: #000000;">{}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>decoder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>json<span style="color: #000000;">.</span>NewDecoder<span style="color: #000000;">(</span>resp<span style="color: #000000;">.</span>Body<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>decoder<span style="color: #000000;">.</span>Decode<span style="color: #000000;">(&amp;</span>result<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000080;">panic</span><span style="color: #000000;">(</span>err<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SHOWROOMをやめた、などの対応</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>result<span style="color: #000000;">.(</span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">]</span><span style="font-weight: 600; color: #000080;">interface</span><span style="color: #000000;">{})[</span><span style="color: #008000;">"live_status"</span><span style="color: #000000;">]</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>lstatus<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>result<span style="color: #000000;">.(</span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">]</span><span style="font-weight: 600; color: #000080;">interface</span><span style="color: #000000;">{})[</span><span style="color: #008000;">"live_status"</span><span style="color: #000000;">].(</span><span style="color: #000080;">float64</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>live_status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">(</span>lstatus<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>is_enquete<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>result<span style="color: #000000;">.(</span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">]</span><span style="font-weight: 600; color: #000080;">interface</span><span style="color: #000000;">{})[</span><span style="color: #008000;">"is_enquete"</span><span style="color: #000000;">].(</span><span style="color: #000080;">bool</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">main()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">パラメータの数をチェックします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"usage:"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">0</span><span style="color: #000000;">],</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"room_id"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>live_status<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is_enquete<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>Live_Live_info<span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">1</span><span style="color: #000000;">])</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Error</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">in</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">intLive_Live_info()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"live_status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>live_status<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"is_enquete="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is_enquete<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-10-26T23:43:40+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/09/post-7f617a.html">
<title>SHOWROOM 星集め・星投げツール スケジュールの詳細化 BreakDownSchedule() （三周のやり方を例に）</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/09/post-7f617a.html</link>
<description>例えば「15時00分からの公式枠・○○さんの配信で3周する」という目標を立てます...</description>
<content:encoded><![CDATA[<p>例えば「15時00分からの公式枠・○○さんの配信で3周する」という目標を立てます。そうするとそれを実現するために配信開始前・開始後にいろんな"作業"が必要になります。</p>
<p><img style="margin: 3px;" title="Photo_20190924234901" src="https://seppina.cocolog-nifty.com/photos/uncategorized/photo_20190924234901.png" alt="Photo_20190924234901" width="552" height="490" border="0" /><br /><br /><br /><br />(1)～(15)が必要な"作業"です。このブログの記事（とソース中のコメント）では、次のような"用語"を使うことにします。<br /><br />・スケジュール<br />配信予定とそれに対する対応の計画をいいます。<br />「公式枠・○○さんの15時00分から90分の配信で最初3周+50カウントし、次の解除で1周+50カウントする。解除は15時15分」<br />みたいなやつです。スケジュールはスケジュールファイルとしてプログラムの入力となります。スケジュールファイルには複数のスケジュールを書くことができます。<br /><br />・タスク<br />スケジュールを実現するために必要な作業の一つ一つを言います。星・種を集める、星・種を投げる、カウントするがそれに相当します。<br />上の図で(1)から(15)で示したものがそれです。<br /><br />・タスクリスト<br />一日のすべてのタスクの集まりです。タスクリストファイルに書き込まれています。<br /><br />・タスクグループ<br />指定した時刻に始めるべきタスクとそれに継続して実行する一連のタスクを言います。<br />上の図で配信開始時に行われる「(3) 1周目分の星投げ、(4) 2周目分の星集め、(5) 星投げ」の三つのタスクの集合がそれです。<br /><br />-------------------------------------<br /><br />このプログラムではプログラム実行開始時（と任意の時刻に）スケジュールをファイルから読み込み、タスクリストを作成してファイルに書き込みます。<br /><br />その後、毎分0秒にタスクリストファイルを読み込み、もしタスク実行時間が現在時に一致するものが見つかれば、実行時間が一致するタスクから開始されるタスクグループを抽出します。<br />そして抽出したタスクグループにしたがって個々のタスクを実行していきます。<br /><br />今回はスケジュールからタスクリストを作成しファイルに書き込む関数 BreakDownSchedule()のソースを紹介します。<br />なお、このソースはShowroomLibパッケージから該当部分を抜粋したものであり、このままではコンパイルできませんので念の為。<br />ShowroomLibパッケージのソース全体は後日公開します。<br /><br />※ main()については <em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</a>」</em>の記事にあります。<br /><br />=========================================<br /><br />スケジュールファイルの例<br />（15:30配信開始、配信時間は60分、解除は開始900秒後、3周、公式枠、アカウントはnamexxxx）<br /><br /># 1. 配信開始時刻 HH:MM<br />#<br /># 2. 予定配信時間(分) 1時間配信＋カウント枠のケースは（たとえば）90とします。<br />#<br /># 3. 配信開始から解除までの時間(秒) 配信開始が15時、解除が15時15分であれば900とします。<br />#<br /># 4. カテゴリー Official:公式枠、Amateur:アマチュア枠<br />#<br /># 5. 対象配信ルームのURLの最後のフィールド（アカウント）<br />#<br /># 6. 備考<br />#<br />15:30 60 900 3 Official namexxxx test<br /><br />=========================================<br /><br />タスクファイルの例<br /><br /># 1. タスク種別　C:星(種)集め、T:星(種)投げ、N:50カウント<br />#<br /># 2. タスク開始時刻 HH:MM:SS<br /># ただし、99:99:99 は直前のタスクに引き続き実行する。<br />#<br /># 3. カテゴリー 0:公式枠、1:アマチュア枠<br />#<br /># 4. タスクが"C"のとき、集めるべき各色ごとの星(種)の数<br /># タスクが"T"のとき、星(種)投げの回数<br /># すべての色で10個（あるいは9個）投げるのを1回とします。<br /># タスクが"N"のとき、カウントの回数（通常50）<br />#<br /># 5. タスクが"C"のとき、1:配信ルームリストで昇順に集める<br /># -1:配信ルームリストで降順に集める<br /># （通常は昇順で、降順にするのは3周の2周目分のときです）<br />#<br /># 6 タスクが"C"のとき、true：現在の星数にかかわらずかならず一回星を集める<br /># false：目標星数があれば星集めはしない<br /># （通常はfalseで、trueにするのはいわゆる"捨て星"のときです）<br />#<br /># 7 タスクが"C"のとき、true：配信ルームリストを作り直さない<br /># false：配信ルームリストを作り直す。<br /># （通常はfalseで、trueにするのは星集め・星投げを2分割するときの2回目です）<br />#<br /># 8. タスクが"T"のとき、対象配信ルームのURLの最後のフィールド（アカウント）<br />#<br /><br />C 13:44:20 0 99 1 false false n/a<br />C 14:44:20 0 99 1 true false n/a<br />T 15:30:00 0 10 0 false false namexxxx<br />C 99:99:99 0 90 -1 false false n/a<br />T 99:99:99 0 9 0 false false namexxxx<br />C 15:44:20 0 50 1 false false n/a<br />T 99:99:99 0 5 0 false false namexxxx<br />C 99:99:99 0 50 1 false true n/a<br />T 99:99:99 0 5 0 false false namexxxx<br />N 99:99:99 0 50 1 false false namexxxx<br /><br />開始時刻が99時99分99秒となっているのは、直前のタスクに継続して順次実行することを意味しています。<br />したがってこのタスクファイルには4つのタスクグループがあります。<br />解除は開始900秒後ですから、3周目分の星集め開始時刻は15時45分となるわけですが、その前に配信ルームリストを作らなければならないので星集めのタスクの開始時刻は15時44分20秒となっています。実際に星を集め始めるのは15時45分00秒となります。<br /><br />=========================================<br /><br />main()<br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</a>」</em></p>
<p>　　SetEnvironment() 環境やポリシーに依存するパラメータを設定します。</p>
<p>　　SetBlackList() 星集め/種集めの対象としないルームのリストを作ります。</p>
<p>　　GetCategoryList() 公式枠/アマチュア枠に該当するジャンル（の位置）をオンライブ画面から検出します。</p>
<p>　　BreakDownSchedule() 配信スケジュールから星集め/種集め、星投げ/種投げ、カウントの<br />　　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-7f617a.html">SHOWROOM 星集め・星投げツール スケジュールの詳細化 BreakDownSchedule() （三周のやり方を例に）</a>」</em></p>
<p>　　Scheduler() タスクリストにしたがって星集め/種集め、星投げ/種投げ、カウントを行います。</p>
<p>　　　　MakeTaskList() タスクリストから現在時（時分）に実行すべきタスクの集まり（タスクグループ）を抜き出します。</p>
<p>　　　　GetRoomList() 星集め/種集めの対象とするルームのリストを作ります。</p>
<p>　　　　CollectStarts() 星集め/種集めを行います。</p>
<p>　　　　ThrowStars() 星投げ/種投げを行います。</p>
<p>　　　　Count50() カウントを行います。</p>
<p>共通して使用する主な関数</p>
<p>　　MakeNewPage() ブラウザ画面を開きます。<br />　　ClosePage() ブラウザ画面を閉じます。<br /><br />=========================================<br />=========================================<br /><br /><br /><br /><br /></p>]]><![CDATA[<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>ShowroomLib</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"bufio"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"log"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"os"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"time"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"fmt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"math/rand"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"strconv"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"strings"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"github.com/sclevine/agouti"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームの情報</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">type</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">RoomInf</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">struct</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>URL<span style="color: #c0c0c0;">   </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームのURL</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>name<span style="color: #c0c0c0;">  </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームのタイトル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>start<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">    </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信開始時刻は分で表したもの</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">例</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">現在時刻が08:20のとき</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">500</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">(</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">8*60</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">+</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">20</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">プログラム実行に必要な環境や実行時の状態を保存している構造体です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">重要</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">最初の星を21時30分00秒に集め始めると星がもらえるのは21時30分30秒となります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">この場合次の星集めができるのは22時00分00秒で、その星は22時30分30秒にもらえます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">このプログラムのコメントでは、上の例の場合解除時刻は（22時00分30秒ではなく）22時00分00秒であるとしています。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">人によって"解除"という言葉の使い方が違うようなので念のため書いておきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">type</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">Environment</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">struct</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>AgoutiDriver<span style="color: #c0c0c0;">    </span><span style="color: #000000;">[</span><span style="color: #800080;">2</span><span style="color: #000000;">]*</span>agouti<span style="color: #000000;">.</span>WebDriver<span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Webドライバーへのポインタ(0:</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">星集め用あるいは星集め・星投げ兼用ブラウザ、</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">1:</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">星投げ・視聴用ブラウザ）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>Page<span style="color: #c0c0c0;">            </span><span style="color: #000000;">[</span><span style="color: #800080;">2</span><span style="color: #000000;">]*</span>agouti<span style="color: #000000;">.</span>Page<span style="color: #c0c0c0;">      </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ブラウザ画面へのポインタ（〃）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>ChromeTmpFolder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">[</span><span style="color: #800080;">2</span><span style="color: #000000;">]</span><span style="color: #000080;">string</span><span style="color: #c0c0c0;">            </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Chrome作業用フォルダ、事前にSHOWROOMを視聴できる環境を作っておきます（〃）</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileNameOfCatName<span style="color: #c0c0c0;">   </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンル名とタイプ（公式枠/アマチュア枠）の対応リストのファイル名を指定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileNameOfBlackList<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め/種集めの対象としないルームのURLのリストのファイル名です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileNameOfLog<span style="color: #c0c0c0;">       </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ログファイルの名称</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileNameOfSchedule<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">誰のいつの配信で何周するかを記述したファイルの名称です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileNameOfTaskList<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め・種集めや星投げ・種投げの時刻と方法を記述したファイルの名称です。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>MaxNoOfRoom<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ルーム情報を取得するルーム（星・種を集めるルームの数）の数（上限）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これも星集めを目的としたときのためにあります。星集めは10ルーム分集めればいいので</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームのリストは（データを収集した直後に配信をやめたルームがあるを考えたり</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">投票モードになっているルームを除外したりしても20個もあれば十分ですから。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">なお実際の取得数(</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">配信ルーム数)がここで指定したルーム数より少ないこともありえます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>ApplicableTime<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め/種集めの対象となるルームの配信開始時刻の範囲を分で示したものです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">現在の時刻が12:00でApplicableTimeが50であれば配信開始時刻が11:11以後のルームが</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め/種集めの対象となります。更新をしていないルームに複数回星集めに行くことを避けるためです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>Margin<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めの指示を受け取ってから実際に星を集めはじめるまでの時間（秒）です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めはその前に配信ルームリストを作る必要があり、それに要する時間は正確には予測できません。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めの開始時間を正確にコントロールするためにタスクリストに示された時刻からMarginで定められた時間が</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">経過したのちに星を集め始めます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">したがってタスクリスト上の星集め開始時刻は、配信開始時刻と解除時間から計算される時刻より</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Marginで示された秒数を減じた時刻にする必要がありますが、この操作はMakeTaskList()で自動的に</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">行われます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>NoColFirst<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星を前半・後半と2分割して投げるとき、前半に投げる各色の星の数です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">種が各色100個集められる場合は全部集めてから投げると1個損することになります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">そこで種を途中まで集めて、いったんこれを投げ、残りをあらためて集めて投げるようにするとムダがなくなります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これが前半・後半と2分割して投げる理由です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これはあくまで星が100個集められるときの設定です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">三周する場合の1周目分を投げるときは星は各色99個しかありませんのでこの設定にかかわらず一回で投げてしまいます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">また1個ムダにしてもいいので分割せずひとまとめに投げたいときは設定値を99とします。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>Thtime<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">いわゆるカウント枠の時間がこの設定（分）を越えたときは星投げを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">例えば</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Thtime</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">20</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">であれば配信時間が80分（あるいは140分、200分、...）以上であればカウント枠での</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星投げを行い、79分（139分、199分、...）以下であれば行いません。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これはあくまでスケジュールに設定された配信予定に基づいて行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信が伸びた、短くなった、というのに対応できるわけではありません。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>WaitDst<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信開始が遅れた場合、開始を待つ時間（秒）</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ここからは設定値ではなく実行状況を示す変数です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>RoomCollectedLast<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">最後に星を集めたルームの配信ルームリスト上の位置（星集めを2回に分けておこなうときのため）</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>Delay<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め対象のルームの配信が星集め中に終了したなどで、解除の時間が想定より遅くなった場合</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">遅れた時間（の累積）を設定します。初期値は0で</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タスク情報、タスクリスト・タスクグループはタスク情報の配列（スライス）になります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">type</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">Task</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">struct</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>command<span style="color: #c0c0c0;">     </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タスクの種別</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">C:星集め、T:星投げ、N:カウント</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>hh<span style="color: #c0c0c0;">          </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タスクの開始時刻(時)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>mm<span style="color: #c0c0c0;">          </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タスクの開始時刻(分)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>ss<span style="color: #c0c0c0;">          </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タスクの開始時刻(秒)</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">スケジュールは分単位ですが、タスクは秒単位で管理されます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>category<span style="color: #c0c0c0;">    </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリー</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">Amateur:アマチュア枠、Official:公式枠</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>noofstars<span style="color: #c0c0c0;">   </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">集める各色の星の数（10,20,...,90,99）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星投げのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">各色星10個を単位とした回数（1,2,...,9,10）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カウントのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カウントの数（1～50）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>order<span style="color: #c0c0c0;">       </span><span style="color: #000080;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームリストを使う順番</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">InOrder:</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">昇順（通常）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">InReverseOrder:</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">降順（2周目目分の星を集めるとき）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>atleastonce<span style="color: #c0c0c0;"> </span><span style="color: #000080;">bool</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">現状手持ちの星の数に関わらず星集めをするか？</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">true:</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">する（いわゆる捨て星のとき）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">false:</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">しない（通常）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>continued<span style="color: #c0c0c0;">   </span><span style="color: #000080;">bool</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集めのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームリストを更新しないで星集めを行うか？</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">true:</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">更新しない（2分割した星集めの2回め）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">false:</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">更新する（通常）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>shorturl<span style="color: #c0c0c0;">    </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星投げのとき</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星投げ対象の配信ルームのURLの最後のフィールド（アカウント）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームのリストを作るときの順番</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">InOrder</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">昇順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">公式はアイドル、タレント・モデル、ミュージック、...と進み</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">毎日○○、ONLIVEの順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">アマチュアは初配信、ONLIVEの順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">InReverseOreder</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">降順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">公式はお笑い・トーク、声優・アニメ、ミュージック、...と進み</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ONLIVE、毎日○○の順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">アマチュアはONLIVE、初配信の順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>InReversOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">公式枠・アマチュア枠</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>Official<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>Amateur<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">集めるべき数の星・種があっても一回だけは星・種を集める（３周の2周目（いわゆる捨て星）のとき）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>ATLEASTONCE<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">true</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め/種集めで配信ルームリストを更新せず、直前の星集め/種集めの配信ルームリストを使う</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">3周するときの3周目のように星/種をを集め、投げる操作を2回に分けて行うときの2回めで使います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>CONTINUED<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">true</span></pre>
<p><span style="color: #000080;"><br />------ 中略<br /><br /></span></p>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">スケジュールをブレイク・ダウンします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">つまり、たとえば</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">15時00分から始まる○○さんのルームで3周する</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">という指示から</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">13時10分に星を10回集める</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">14時10分に1回だけ星を集める（いわゆる捨て星）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">15時00分に配信が始まったら10回分の星を投げ、1回分の星を受け取る</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星を投げ終わったら星を8回分集める</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星を集め終わったら9回分の星を投げる</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">15時10分になったら星を5回集める</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星を集め終わったら5回分の星を投げる</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星を投げ終わったら星を5回分集める</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星を集め終わったら5回分の星を投げる</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">という具体的な操作を作ります</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">作った操作はいったんファイルに書き出され、後続の処理はこのファイルを参照して進めます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">このファイルは（スケジュール変更が発生したときなど）プログラム実行中に作り直したり、手作業で修正したりできます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">BreakDownSchedule(</span>environment<span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span>Environment<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>hh<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>dmm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>dss<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>times<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>category<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>remark<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">あとで配信開始時刻等はtime.Time形式にするために使用します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>t0<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Now<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span>t0<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>year<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>month<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>day<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>t0<span style="color: #000000;">.</span>Date<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">hour,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">min,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">sec</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">t0.Clock()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>loc<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>t0<span style="color: #000000;">.</span>Location<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">t1</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">time.Date(year,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">month,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">day,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">hour,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">min,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">sec,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">0,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">loc)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">log.Println(t1)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信スケジュールファイルを開きます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">このファイルに書いてあるのは配信開始時刻、配信継続時間、配信開始から解除までの時間などです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>file<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>OpenFile<span style="color: #000000;">((*</span>environment<span style="color: #000000;">).</span>FileNameOfSchedule<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>O_RDONLY<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0644</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Can't</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">open</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">file.</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">["</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(*</span>environment<span style="color: #000000;">).</span>FileNameOfSchedule<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"]"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め、星投げ等の個々の操作（ここではタスクとします）を格納する変数です。これをタスクリストとしています。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">make</span><span style="color: #000000;">([]</span>Task<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信スケジュールファイルのすべての行について</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>s<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>bufio<span style="color: #000000;">.</span>NewScanner<span style="color: #000000;">(</span>file<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>s<span style="color: #000000;">.</span>Scan<span style="color: #000000;">()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>istr<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>s<span style="color: #000000;">.</span>Text<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"#"ではじまる行はコメント行として無視します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>strings<span style="color: #000000;">.</span>HasPrefix<span style="color: #000000;">(</span>istr<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"#"</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"comment</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>istr<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">continue</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>NoOfItem<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sscanf<span style="color: #000000;">(</span>istr<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"%d:%d%d%d%d%s%s%s"</span><span style="color: #000000;">,</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">&amp;</span>hh<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>mm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>dmm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>dss<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>times<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>category<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>shorturl<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>remark<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span>hh<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>dmm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>dss<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>times<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>category<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>remark<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリーの記述を内部形式に変化します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">switch</span><span style="color: #c0c0c0;"> </span>category<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"Amateur"</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>icategory<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>Amateur</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"Official"</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>icategory<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>Official</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">default</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"category</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">must</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">be</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Amateur</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">or</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Official."</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">形式があっていない行がある場合は実行を打ち切ります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>NoOfItem<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">8</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Number</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">of</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">item</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>NoOfItem<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Input</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">data</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">must</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">be</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">\"hh:mm</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">dmm</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">dss</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">0|1|2|3</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Amateur|Official</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">shortURL</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">remark\""</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信開始時刻（配信開始時刻は時分で指定されます）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>t1<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Date<span style="color: #000000;">(</span>year<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>month<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>day<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hh<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">00</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>loc<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タイミング設定</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">解除の時刻</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">配信開始時刻</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">配信開始から解除までの時間（設定値）</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">マージン</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">+</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">解除時刻の遅延</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">マージンは星集めの前に必要な配信ルームリストを作るための時間的余裕のことを言います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>dr_cA<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Duration<span style="color: #000000;">(</span>dss<span style="color: #000000;">-(*</span>environment<span style="color: #000000;">).</span>Margin<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Second</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">上記時間から60分を引いたもの</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これを配信開始時刻にプラスすると３周の２周目用の種集め（いわゆる捨て星）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">あるいは２周目の１周目用の星集めの時刻となります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>dr_cB<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>dr_cA<span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">60</span><span style="color: #000000;">*</span>time<span style="color: #000000;">.</span>Minute</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">さらに60分前</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これを配信開始時刻にプラスすると3周の一回目の星集めの時刻になります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>dr_cC<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>dr_cA<span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">120</span><span style="color: #000000;">*</span>time<span style="color: #000000;">.</span>Minute</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星を100個集めて投げるとき、全部集めて投げると1個ムダになるので、集める/投げるの操作を2回繰り返します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">最初に集める星の数（投げる回数の10倍）</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">colfirst、2回めに集める星の数</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">colsecond</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">最初に投げる回数（集める数の1/10）</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">thrfirst、2回めに投げる回数</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">ｔｈｒsecond</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>colfirst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(*</span>environment<span style="color: #000000;">).</span>NoColFirst</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>thrsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>thrfirst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>colfirst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">/</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">10</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>colfirst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">100</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>colfirst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">100</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #c0c0c0;"> </span>colfirst</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>thrsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">/</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">10</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">switch</span><span style="color: #c0c0c0;"> </span>times<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">指定時刻に星・種を投げます</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">気分で特定のルームに星を投げるようなケースですね。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">この場合は星は予定通り行われなかった配信で余ったものとか</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">times=0</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">で集めたものを使います。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">1周分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">10</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">指定時刻に星・種を集めます</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">配信時刻がはっきりしない配信者さん用に事前に星・種を集めておく</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">すてきな配信者さんがいたら投げるために用意しておく</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">みたいなケースで使います。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">1周分星・種を集め、投げます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">前半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cA<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">前半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">後半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CONTINUED<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">後半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">2周分星・種を集め、投げます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">1周目分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cB<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">90</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">1周目分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">9</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cA<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目前半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目前半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目後半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CONTINUED<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目後半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">3</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">3周分星・種を集め、投げます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">1周目分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cC<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目分の星・種を集める準備（いわゆる捨て星）のタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cB<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ATLEASTONCE<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">1周目分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">10</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">90</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InReversOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2周目分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">9</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">3周目前半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cA<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">3周目前半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">3周目後半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CONTINUED<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">3周目後半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">default</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"times</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">must</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">be</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-1,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">0,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">1,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">or</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">3."</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>times<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カウント</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"N"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">50</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信が（1時間＋Thtimeで設定された時間）以上ある場合は（更新されていれば）1時間ごとに星集め/種集め、星投げ/種投げを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">たいていの配信者さんの配信終了時刻はたいてい伸びるので、Thtimeは適当に設定してください。デフォルトは20分です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span>dmm<span style="color: #000000;">-(*</span>environment<span style="color: #000000;">).</span>Thtime<span style="color: #000000;">)/</span><span style="color: #800080;">60</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>t1<span style="color: #000000;">.</span>Add<span style="color: #000000;">(</span>dr_cA<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Duration<span style="color: #000000;">(</span>i<span style="color: #000000;">+</span><span style="color: #800080;">1</span><span style="color: #000000;">)*</span>time<span style="color: #000000;">.</span>Hour<span style="color: #000000;">).</span>Clock<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			/</span><span style="color: #008000;">/</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;"><span style="color: #c0c0c0;">4(5,6,...)</span>周目前半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">                        </span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>hht<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>mmt<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>sst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	4(5,6,...)</span><span style="color: #008000;">周目前半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrfirst<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;"><span style="color: #c0c0c0;">4(5,6,...)</span>周目後半分の星・種を集めるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"C"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>colsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CONTINUED<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"n/a"</span><span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;"><span style="color: #c0c0c0;">4(5,6,...)</span>周目後半分の星・種を投げるタスク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"T"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>thrsecond<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カウント</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>tasklist<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>Task<span style="color: #000000;">{</span><span style="color: #008000;">"N"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">99</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>icategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">50</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">false</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>shorturl<span style="color: #000000;">})</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>file<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">作成したタスクリストをファイルに書き出します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>TaskListFile<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>OpenFile<span style="color: #000000;">((*</span>environment<span style="color: #000000;">).</span>FileNameOfTaskList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>O_CREATE<span style="color: #000000;">|</span>os<span style="color: #000000;">.</span>O_TRUNC<span style="color: #000000;">|</span>os<span style="color: #000000;">.</span>O_WRONLY<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0666</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000080;">panic</span><span style="color: #000000;">(</span><span style="color: #008000;">"cannnot</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">open</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">logfile:</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>environment<span style="color: #000000;">.</span>FileNameOfLog<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>err<span style="color: #000000;">.</span>Error<span style="color: #000000;">())</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>TaskListFile<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>_<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">range</span><span style="color: #c0c0c0;"> </span>tasklist<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Fprintf<span style="color: #000000;">(</span>TaskListFile<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"%s\t%02d:%02d:%02d\t%d\t%d\t%d\t%t\t%t\t%s\n"</span><span style="color: #000000;">,</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>task<span style="color: #000000;">.</span>command<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>hh<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>mm<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>ss<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>category<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>noofstars<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>order<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>atleastonce<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>continued<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>task<span style="color: #000000;">.</span>shorturl<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<p><span style="color: #000080;">------ 後略<br /><br /></span><span style="color: #000080;"></span></p>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-09-25T00:30:14+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">
<title>SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html</link>
<description>これまで、なんでもいいから三周できればいいや、みたいな気持ちでプログラムを書いて...</description>
<content:encoded><![CDATA[<p>これまで、なんでもいいから三周できればいいや、みたいな気持ちでプログラムを書いていたのですが、心をいれかえて少しは役にたつようなプログラムになればという気持ちで作りました。<br /><br />特徴（というか目標）<br /><br />・全体の構造や処理の内容がわかりやすく、再利用・改修が容易なプログラム。<br /><br />今回のプログラムは<em>「<a href="http://seppina.cocolog-nifty.com/blog/2018/06/showroom---9bd2.html">Showroom - 自動星集め・星投げ・カウントツール）</a>」 </em>にあるソースを改修したのものではなく、その反省をもとに新たに作成したものです。<br /><br />・GO言語らしいプログラム、GO言語のプログラミングの参考になるようなプログラム<br />　（そういう気持ちで作っているという意味で、じっさいそうなってるかどうかはわかりません。<br />　　もちろん他の言語に移植しにくいようなものにはしません）<br /><br />・環境に依存しないように作る（要するにハードコーディングはしない。と言ってもSHOWROOMのシステムを相手にしてるわけで...）<br /><br />・特に公式枠・アマチュア枠のジャンルの変更にはできるだけ影響を受けないようにする（これまでさんざん泣かされたところです）<br /><br />・Goroutineは使わない。<br />　　Goroutineを使えば処理の時間を短縮できるのですが、プログラムの可読性がおちるので今回はやめました。<br />　　（今後Goroutineを使うバージョンも作る予定はあります）<br /><br />※ 誤解を招きそうなので補足しておきます。Goroutineを使ったからプログラムがわかりにくくなるということはないのですが、Goroutineを完全に非同期で動かすことはできず、ある程度お互いの動作を意識する必要があり、その部分があるためにわかりにくくなる、という意味です。<br /><br />--------<br /><br />・配信者さんに合わせたスケジュール（タスクリスト）が作れる（要するに時間にルーズな配信者さんにもある程度対応できる）<br /><br />・可能な限り星集めの"解除"の時刻を正確にコントロールする（PCのRTCが正確という条件で不確かさを1秒以下に抑える）<br />　これによって3時間おき一日7配信みたいなのにも対応できるかと思います（まだ実際にやってみていないですけど）<br /><br />・PCの過負荷やムリな設定条件などで三周できそうにないときも最大の星数種数が投げられるように最適化する。<br /><br />--------<br /><br />今回はmain()のソースを紹介します。これから順次各関数の紹介・説明をしていきます。<br /><br /></p>
<p>main()<br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</a>」</em></p>
<p>　　SetEnvironment() 環境やポリシーに依存するパラメータを設定します。</p>
<p>　　SetBlackList() 星集め/種集めの対象としないルームのリストを作ります。</p>
<p>　　GetCategoryList() 公式枠/アマチュア枠に該当するジャンル（の位置）をオンライブ画面から検出します。</p>
<p>　　BreakDownSchedule() 配信スケジュールから星集め/種集め、星投げ/種投げ、カウントの<br />　　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-7f617a.html">SHOWROOM 星集め・星投げツール スケジュールの詳細化 BreakDownSchedule() （三周のやり方を例に）</a>」</em></p>
<p>　　Scheduler() タスクリストにしたがって星集め/種集め、星投げ/種投げ、カウントを行います。</p>
<p>　　　　MakeTaskList() タスクリストから現在時（時分）に実行すべきタスクの集まり（タスクグループ）を抜き出します。</p>
<p>　　　　GetRoomList() 星集め/種集めの対象とするルームのリストを作ります。</p>
<p>　　　　CollectStarts() 星集め/種集めを行います。</p>
<p>　　　　ThrowStars() 星投げ/種投げを行います。</p>
<p>　　　　Count50() カウントを行います。</p>
<p>共通して使用する主な関数</p>
<p>　　MakeNewPage() ブラウザ画面を開きます。<br />　　ClosePage() ブラウザ画面を閉じます。</p>]]><![CDATA[<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>main</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"io"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"log"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"os"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"ShowroomLib"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">このプログラムの実行に必要な関数をおさめたパッケージです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">SHOWROOMでの星集め/種集め、星投げ/種投げ、カウントを配信開始時刻を指定することによって自動的に行うツールです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">起動方法</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Scheduler.exe</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">EnvironmentFileName</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">[Option]</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">1.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">EnvironmentFileName</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">環境設定ファイルのファイル名</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">2.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Option</span><span style="color: #c0c0c0;">					</span><span style="color: #008000;">星投げ・星集めのツールとして使う場合は</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"GO"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">を指定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">									</span><span style="color: #008000;">指定しない場合、あるいは"GO"以外を指定した場合は配信開始時刻から</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">									</span><span style="color: #008000;">タスクリストを作る処理のみを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">									</span><span style="color: #008000;">これはプログラムを起動したまま、スケジュールを変更するために使います。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">プログラムのだいたいの構造</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">main()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SetEnvironment()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">環境やポリシーに依存するパラメータを設定します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SetBlackList()</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">星集め/種集めの対象としないルームのリストを作ります。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetCategoryList()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">公式枠/アマチュア枠に該当するジャンル（の位置）をオンライブ画面から検出します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">BreakDownSchedule()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">配信スケジュールから星集め/種集め、星投げ/種投げ、カウントの</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">詳細スケジュール（タスクリスト）を作成します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Scheduler()</span><span style="color: #c0c0c0;">				</span><span style="color: #008000;">タスクリストにしたがって星集め/種集め、星投げ/種投げ、カウントを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">MakeTaskList()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">タスクリストから現在時（時分）に実行すべきタスクの集まり（タスクグループ）を抜き出します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">GetRoomList()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星集め/種集めの対象とするルームのリストを作ります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">CollectStarts()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星集め/種集めを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">ThrowStars()</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星投げ/種投げを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">Count50()</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">カウントを行います。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">共通して使用する主な関数</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">MakeNewPage()</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ブラウザ画面を開きます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ClosePage()</span><span style="color: #c0c0c0;">				</span><span style="color: #008000;">ブラウザ画面を閉じます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">実行に必要なファイル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">詳細はそれぞれのファイルを扱う関数にあります。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"Environment.txt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">実行環境の設定を記したファイル</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">プログラムの引数として渡します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">詳細は</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">ShowroomLib.SetEnvironment()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">を御覧ください。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">environment.FileNameOfCatName</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">(例</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"CategoryName.txt")</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">"CategoryName.txt"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">の内容はGetCategoryList()の説明にあります。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">environment.FileNameOfBlackList</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">(例</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"BlackList.txt")</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">星集め/種集めの対象としないルームの一覧です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">一行にルームURLとルーム名や対象としない理由をタブ区切りで記述したもので構成されます。行数の制限はありません。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">ルーム名や理由は処理には無関係です。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">environment.FileNameOfSchedule</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">(例</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"Schedule.txt")</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">応援している配信者さんの配信スケジュールとそれに付随するデータ</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">environment.FileNameOfTaskList</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">(例</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"TasList.txt")</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">配信スケジュールから星集め/種集め、星投げ/種投げのスケジュールに詳細化したもの</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">このプログラムではこれをタスク、一連の処理に対応するタスクの集まりをタスクグループ、</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">すべてのタスクグループを集めたものをタスクリストと称しています。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">environment.FileNameOfLog</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">(例</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"log.txt")</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">ログの出力先</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">main()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>log<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"\n\n\n********************</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">test</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">of</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Scheduler</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">********************\n"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"********************</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">end</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">of</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">test</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">********************"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">||</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">3</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">実行時パラメータが正しくセットされていないとき</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"usage:"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">0</span><span style="color: #000000;">],</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"FileNameOfEnvironmentFile</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">[GO]"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">環境設定ファイル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileNameOfEnvironmentFile<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">1</span><span style="color: #000000;">]</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">環境設定ファイルを読み込んで実行環境を設定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>environment<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>SetEnvironment<span style="color: #000000;">(</span>FileNameOfEnvironmentFile<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Error</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">in</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">SetEnvironment()"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ログファイル出力先の指定があれば変更します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>environment<span style="color: #000000;">.</span>FileNameOfLog<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">""</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>logfile<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>OpenFile<span style="color: #000000;">(</span>environment<span style="color: #000000;">.</span>FileNameOfLog<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>O_APPEND<span style="color: #000000;">|</span>os<span style="color: #000000;">.</span>O_CREATE<span style="color: #000000;">|</span>os<span style="color: #000000;">.</span>O_WRONLY<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0666</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000080;">panic</span><span style="color: #000000;">(</span><span style="color: #008000;">"cannnot</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">open</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">logfile:</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>environment<span style="color: #000000;">.</span>FileNameOfLog<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>err<span style="color: #000000;">.</span>Error<span style="color: #000000;">())</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>logfile<span style="color: #000000;">.</span>Close<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">log.SetOutput(logfile)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>SetOutput<span style="color: #000000;">(</span>io<span style="color: #000000;">.</span>MultiWriter<span style="color: #000000;">(</span>logfile<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Stdout<span style="color: #000000;">))</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">後続の処理（星集め、星投げ）を実行するためには実行時パラメータの2番めが"GO"である必要があります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">うっかりプログラムを二重に起動しないようにこうしてあります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GOがなければスケジュールの再作成のみ行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">||</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">3</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;&amp;</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">2</span><span style="color: #000000;">]</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"GO"</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ブラウザを起動します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>MakeNewPage<span style="color: #000000;">(&amp;</span>environment<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>ClosePage<span style="color: #000000;">(&amp;</span>environment<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">オンライブ画面上の各カテゴリーの位置（ジャンルリスト）を調べます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">起動時に一回のみ調べていますが、1時間に一回くらいにした方がいいかも。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>IdxCategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>GetCategoryList<span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">&amp;</span>environment<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">実行環境</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"status</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">of</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">GetCategoryList</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ブラウザを閉じます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>ShowroomLib<span style="color: #000000;">.</span>ClosePage<span style="color: #000000;">(&amp;</span>environment<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">星集め・種集めの対象としないルームのリストを作ります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>BlackList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>SetBlackList<span style="color: #000000;">(&amp;</span>environment<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Error</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">in</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">SetBlackList()"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">スケジュールをブレイク・ダウンします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">つまり</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">15時00分から始まる○○さんのルームで3周する</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">という指示から例えば</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">13時10分に星を10回集める</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">14時10分に1回だけ星を集める（いわゆる捨て星）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">...</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">というような具体的な操作を作ります（詳細は関数のコメントにあります）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">Scheduler()との間のスケジュール（タスクリスト）の受け渡しはファイルを介して行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">これはタスクリストを可視化し、かつプログラム実行中の修正を可能にするためです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">*/</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>BreakDownSchedule<span style="color: #000000;">(&amp;</span>environment<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"List</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">of</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Task</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">created!"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Error</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">in</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">BreakDownSchedule()"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">できあがったスケジュール（タスクリスト）にしたがって、星・種集め、星・種投げを行います。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>Scheduler<span style="color: #000000;">(&amp;</span>environment<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxCategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>BlackList<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>log<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Error</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">in</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Scheduler()"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-09-17T23:18:54+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/08/post-740e26.html">
<title>SHOWROOM - 自動三周ツール（視聴ボーナス版）（もう一つの自動星集め・星投げ・カウントツール</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/08/post-740e26.html</link>
<description>以前書いた記事「SHOWROOM - 自動三周ツール（もう一つの自動星集め・星投...</description>
<content:encoded><![CDATA[<p>以前書いた記事<em>「<a href="http://seppina.cocolog-nifty.com/blog/2018/08/showroom---3-11.html">SHOWROOM - 自動三周ツール（もう一つの自動星集め・星投げ・カウントツール</a>」</em>にあるツールは星集め（種集め）がいわゆる「ツイボ」で行われていました。7月からツイボによる星集めはできず、「視聴ボーナス」だけが星集めの手段となりました。<br /><br />あしかっぴ（@pf_ashika）さんから「視聴ボーナス」対応のGO/agouti版ソースをいただきましたので、公開することにします。じつはこのソースはツイボで星集めができなくなる前にいただいたのですが、いろいろやりとりをしてるうちに一ヶ月以上経ってしまいました。大半は私の怠慢です。すみません。<br /><br />以下からダウンロード可能です。内容は ソース sh880_20190801.go と 入力データ StartTime1.txt です。<br /><br />　　　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/files/sh880_20190801.zip" target="_blank" rel="noopener">ダウンロード - sh880_20190801.zip</a> 」</em><br /><br />ソースの使い方はプログラム冒頭のコメントを御覧ください。特に</p>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Sep.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">環境に依存するするものはプログラム冒頭のconstで定義しました。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Sep.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Log_Dir</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">と</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">User_Data_Dir</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">がそれです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Seo.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ご自身の環境に合わせて変更してお使いください</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">&lt;=============</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">**重要**</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Sep.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">特にUser_Data_Dirについてはプログラムを起動する前に--user-data-dirオプションで指定して</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Sep.</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Chromeを起動して、SHOWROOMにログインしてSHOWROOMにの視聴環境を整えておくことが必要です。</span></pre>
<p>のところに注意していただければと思います。<br /><br />---------<br /><br />ところで私の作った <em>「<a href="http://seppina.cocolog-nifty.com/blog/2018/06/showroom---9bd2.html">Showroom - 自動星集め・星投げ・カウントツール）</a>」 </em> の方はその後大幅に改良を行ってリス活に活用中ですが、現在「初心に戻って」一から書き直しているところです。<br /><br />　　<em>2019.09.18 記事を書き始めました！ =&gt;</em> <em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/09/post-b03b5b.html">SHOWROOM 新・自動三周ツール -- GO言語によるブラウザ制御 (1) main()</a>」</em><br /><br />最近書いている一連の記事をご覧になればなんとなくわかっていただけると思いますが、<br /><br />　　１．機能ごとに関数を作って提供し、どなたでも自分の必要とする機能をもったプログラムを容易に構成できるようにする。<br />　　２．ハードコーディングは極力避ける（といっても相手がSHOWROOMという生きたシステムなので限度がありますが）<br />　　３．agoutiを使う必然性がない部分はgoquery（やencoding/jason）を利用して負荷軽減を図る。<br />　　４．GOの言語仕様の特性を活用し、またできるだけパッケージを利用した作りとする。<br />　　５．機能の使いやすさ・わかりやすさを優先し、星集め・星投げを非同期で動作させるような作りはいったん排除する。<br /><br />というような方針でやってます。</p>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-08-30T17:50:18+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/08/post-a2dbbc.html">
<title>SHOWROOM - 自動星集め/種集め - 配信ルームリストの取得（ソース）</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/08/post-a2dbbc.html</link>
<description>現在、SHOWROOMでの自動星集め/種集め、さらには自動星投げ/種投げツール（...</description>
<content:encoded><![CDATA[<p>現在、SHOWROOMでの自動星集め/種集め、さらには自動星投げ/種投げツール（両方合わせれば自動三周ツール）の作成に必要な要素について記事を書いています。前記事 <em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/08/post-9b442d.html">SHOWROOM - 自動星集め/種集め - 配信ジャンルの取得（ソース）</a>」</em> では公式、アマチュアそれぞれのジャンルの求め方について書いたので、今回はそれぞれのジャンルにある配信ルームのリストを作ることになります。<br />（次は「星集め関数」の予定です）<br /><br />前回、今回の記事はブラウザを開きそこから必要なデータを取得する方法ですので、<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/06/post-231815.html">SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版）</a>」</em> や <em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/07/post-fec00d.html">SHOWROOM - イベント貢献ランキング（貢献ポイント）を取得する関数（ソース）</a>」</em> のようにブラウザを開かずJSONあるいはHTMLをスクレイピングする方法に比較すると若干パフォーマンス的に劣る方法になります。<br /><br />じつは<a href="https://twitter.com/MmSwrm">ムム＠ＳＲ</a>さん（ あるいは <a href="https://www.sr-evd.xyz/">Showroom イベント ポイント遷移グラフ公開所</a>）から<br /><br /></p>
<blockquote class="twitter-tweet">
<p dir="ltr" lang="ja">ONLIVEのリストを取得するだけであれば、SRのトップページが開かれた瞬間に<a href="https://t.co/vZMxQaHTou">https://t.co/vZMxQaHTou</a><br />から全ジャンルのONLIVEルームリスト(UPCOMINGリストは除く)を取得しているようですので、この返りのJSONをごにょごにょすればブラウザ要らず、かもです。</p>
— ムム＠ＳＲ (@MmSwrm) <a href="https://twitter.com/MmSwrm/status/1158972887518199809?ref_src=twsrc%5Etfw">August 7, 2019</a></blockquote>
<p>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<br /><br />というご指摘をいただいています。要するにこの配信ルームのリストを作る機能もブラウザを開かずに（つまりgo/agoutiではなくJSONのパースだけで）作れるということです。そちらの方がパフォーマンス的に有利かと思いますが、すでにこの関数を作りかけていたのでひとまずこちらから公開することにします。JSON版もそのうち作って公開したいと思います。<br /><br />プログラム自体それほど大きなものではありませんし、コメントも入れてあるので記事の最後にそのまま公開することにします。<br />main()（テストプログラム部）の実行にはGetCategoryList()が必要ですが、これはPackage ShowroomLibを作ってそれにおさめています（パッケージはビルドしたあとインストールが必要です。念のため）<br />もちろん前記事のソースからGetCategoryList()を持ってきてこのソースに追加してもかまいませんが、その場合は<br />  IdxAmateur, IdxOfficial, status := ShowroomLib.GetCategoryList(...<br />のところはとうぜん<br />  IdxAmateur, IdxOfficial, status := GetCategoryList(...<br />とします。<br /><br />最近多少はGO言語やagoutiの使い方がわかってきたので、今までよりはだいぶマシなプログラムになっていると思います（あくまで"今までより"ですが）<br /><br />セレクターはこれまでブラウザの開発ツールでCSSセレクターをコピーしてきてそれを使っていたのですが、かならずしも意図したものにならない場合があり、今回はhtmlの構造を考えながらセレクターを作っています。<br />また"li"のところのデータの取得ではMultiSelectionを使ってみました（セレクション取得のための All()、セレクション数を得る Count()、個別のセレクションを得る At() ）<br />個別に取得するのとたいして違いはないのですが、今回は後ろからデータを取得しなければならないケースがあり最初に個数が必要なので。<br /><br /><em><span style="font-size: 10pt;">※ 自動星集め・星投げについてはすでにソースを公開（「<a href="http://seppina.cocolog-nifty.com/blog/2018/06/showroom---9bd2.html">Showroom - 自動星集め・星投げ・カウントツール）</a>」 ）していますが、機能ごとにソースを分けてない上にふつうは必要にならないような機能を盛り込んだこともあってソースの可読性がよろしくないです。またハードコーティングされた部分もありますし、コメントの位置や量にムラがあります。そこでそのあたりを改善して自分の目的にあったプログラムを作っていただけるようにしようと、機能ごとに関数を分けて一つずつ記事にしている次第です。</span></em><br /><em><span style="font-size: 10pt;">もうひとつの 「<a href="http://seppina.cocolog-nifty.com/blog/2018/08/showroom---3-11.html">Showroom - 自動三周ツール（もう一つの自動星集め・星投げ・カウントツール）</a>」　 の方もすでにあしかっぴ(@pf_ashika）さんから視聴ボーナス対応版のソースをいただいているので、公開予定ですが、私のソースをベースにされているため同じ課題が残っています。</span></em> <br /><br /></p>]]><![CDATA[<p> </p>
<pre> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>main</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"ShowroomLib"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"fmt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"time"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"github.com/sclevine/agouti"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームの情報</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"今後の展開"を考慮しstringの配列ではなく構造体としています。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">type</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">RoomInf</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">struct</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>URL<span style="color: #c0c0c0;">  </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームのURL</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>name<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者ルームのタイトル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームのリストを作るときの順番</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">InOrder</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">昇順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">公式はアイドル、タレント・モデル、ミュージック、...と進み</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">毎日○○、ONLIVEの順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">アマチュアは初配信、ONLIVEの順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">InReverseOreder</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">降順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">公式はお笑い・トーク、声優・アニメ、ミュージック、...と進み</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">//</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ONLIVE、毎日○○の順でリストを作っていきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">const</span><span style="color: #c0c0c0;"> </span>InReversOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetRoomList()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SHOWROOMの「オンライブ」画面から、指定されたカテゴリー位置のジャンルの現在配信中のルームのリストを取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリー位置とはGetCategoryList()で取得した、公式/アマチュアの各ジャンルのオンライブ画面上の位置（順序）です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">取得したルームのリストはをスライスに格納して戻します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetCategoryList()については</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">「SHOWROOM</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">自動星集め/種集め</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">配信ジャンルの取得（ソース）」</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">http://seppina.cocolog-nifty.com/blog/2019/08/post-9b442d.html</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">引数</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Direction</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">int</span><span style="color: #c0c0c0;">				</span><span style="color: #008000;">リストを作るときの順番（方向）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">									</span><span style="color: #008000;">InOrder</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">昇順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">									</span><span style="color: #008000;">InReverseOreder</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">降順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">星集めを目的としたとき必要となる引数です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">なんらかの理由であまり時間をおかずにリストを作るとき、結果が似通ったものに</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">ならないように、つまりすでに星集めをしたところがリストに入らないようにするためです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">maxnoofroom</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">int</span><span style="color: #c0c0c0;">				</span><span style="color: #008000;">ルーム情報を取得するルームの数（上限）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">これも星集めを目的としたときのためにあります。星集めは10ルーム分集めればいいので</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">配信ルームのリストは（データを収集した直後に配信をやめたルームがあるなど考えても）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">20個もあれば十分ですから。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">実際の取得数がここで指定したルーム数より少ないこともありえます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">page</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">*agouti.Page</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ブラウザ画面のポインタ</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">nilであれば新たにブラウザを開きます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ChromeTmpFolder</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">string</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">Chrome作業用フォルダ、事前にSHOWROOMを視聴できる環境を作っておきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">CategoryList</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">[]int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ルームリストを取得したいジャンルの位置リスト</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">通常GetCategoryList()で取得したIdxAmateur,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxOfficialの</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">いずれかを渡します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">戻り値</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">RoomList</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">[]string</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">配信中ルームのURL（の最後の文字列）のリスト</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">statsu</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">int</span><span style="color: #c0c0c0;">				</span><span style="color: #008000;">実行結果</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">0</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">正常終了（現状では必ず</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">を返します）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">GetRoomList(</span>Direction<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>maxnoofroom<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>page<span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span>agouti<span style="color: #000000;">.</span>Page<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ChromeTmpFolder<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CategoryList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">int</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>RoomList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span>RoomInf<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>roominf<span style="color: #c0c0c0;"> </span>RoomInf</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ブラウザが開かれていない場合は、新たにブラウザを開きます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ここで開いたブラウザはこの関数が終了するときとじられます（</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">==&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">defer()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>page<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Chromeを利用することを宣言</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>agoutiDriver<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>agouti<span style="color: #000000;">.</span>ChromeDriver<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>agoutiDriver<span style="color: #000000;">.</span>Start<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>agoutiDriver<span style="color: #000000;">.</span>Stop<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>agoutiDriver<span style="color: #000000;">.</span>NewPage<span style="color: #000000;">(</span>agouti<span style="color: #000000;">.</span>Desired<span style="color: #000000;">(</span>agouti<span style="color: #000000;">.</span>Capabilities<span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">"chromeOptions"</span><span style="color: #000000;">:</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">][]</span><span style="color: #000080;">string</span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">"args"</span><span style="color: #000000;">:</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">string</span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">					</span><span style="color: #008000;">"user-data-dir="</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>ChromeTmpFolder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Hyperion</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #000000;">},</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">},</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}),</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SHOWROOMオンライブ画面にいないときはオンライブ画面に移行</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>url<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>page<span style="color: #000000;">.</span>URL<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>url<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"https://www.showroom-live.com/onlive"</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">.</span>Navigate<span style="color: #000000;">(</span><span style="color: #008000;">"https://www.showroom-live.com/onlive"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>time<span style="color: #000000;">.</span>Sleep<span style="color: #000000;">(</span><span style="color: #800080;">5</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Second<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">指定されたジャンルそれぞれの配信中のルームをリストに追加していきます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">情報取得した配信ルームの数</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>n<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">取得の順序(方向)に応じてジャンルの範囲を設定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>ib<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ie<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>is<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>Direction<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ib<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ie<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>CategoryList<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>is<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ib<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>CategoryList<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ie<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>is<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">三重ループを抜けるときのラベル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000080;">OuterLoop</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">すべてのジャンルについて繰り返します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>ib<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span>ie<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+=</span><span style="color: #c0c0c0;"> </span>is<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"category=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CategoryList<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">指定されたジャンルの画面に移行します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>FmtFrame<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"#js-categorymenu-list</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">li:nth-child(%d)"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>SelectorFrame<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sprintf<span style="color: #000000;">(</span>FmtFrame<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CategoryList<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">.</span>Find<span style="color: #000000;">(</span>SelectorFrame<span style="color: #000000;">).</span>Click<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>time<span style="color: #000000;">.</span>Sleep<span style="color: #000000;">(</span><span style="color: #800080;">5</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Second<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">取得の順序(方向)に応じて毎日○○、ONLIVE（初配信、ONLIVE）の取得順序を決めます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>jb<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>je<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>js<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>Direction<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>jb<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>je<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">3</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>js<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>jb<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>je<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>js<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">毎日○○、ONLIVE（初配信、ONLIVE）について繰り返します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>j<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>jb<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>j<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span>je<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>j<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+=</span><span style="color: #c0c0c0;"> </span>js<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">j=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>j<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームへのマルチセレクションとそのセレクション数を取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>Selector<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sprintf<span style="color: #000000;">(</span><span style="color: #008000;">"#js-onlive-collection</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">div:nth-child(1)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">section:nth-child(%d)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">ul</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">li"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>j<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>MSelectionToRoom<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>page<span style="color: #000000;">.</span>All<span style="color: #000000;">(</span>Selector<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>NoOfRoom<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>MSelectionToRoom<span style="color: #000000;">.</span>Count<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"No</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">of</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Room</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>NoOfRoom<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">取得の順序（方向）に応じて配信ルームの取得順序を決めます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>kb<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ke<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ks<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>Direction<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span>InOrder<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>kb<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>ke<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>NoOfRoom</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>ks<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>kb<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>NoOfRoom<span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>ke<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>ks<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームの分だけ繰り返します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>k<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>kb<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>k<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span>ke<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>k<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+=</span><span style="color: #c0c0c0;"> </span>ks<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームのURLを取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>roominf<span style="color: #000000;">.</span>URL<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>MSelectionToRoom<span style="color: #000000;">.</span>At<span style="color: #000000;">(</span>k<span style="color: #000000;">).</span>Find<span style="color: #000000;">(</span><span style="color: #008000;">".listcard-join-btn"</span><span style="color: #000000;">).</span>Attribute<span style="color: #000000;">(</span><span style="color: #008000;">"href"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームのタイトルを取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>roominf<span style="color: #000000;">.</span>name<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>MSelectionToRoom<span style="color: #000000;">.</span>At<span style="color: #000000;">(</span>k<span style="color: #000000;">).</span>Find<span style="color: #000000;">(</span><span style="color: #008000;">".listcard-name"</span><span style="color: #000000;">).</span>Text<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span>roominf<span style="color: #000000;">.</span>URL<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>roominf<span style="color: #000000;">.</span>name<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信ルームの情報を取得できなかったとき。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">現実にはこの条件を満たすことはないと思いますが....</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>roominf<span style="color: #000000;">.</span>URL<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">""</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">					</span><span style="font-weight: 600; color: #000080;">continue</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">取得したデータを戻り値（用の変数）に格納します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>RoomList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>RoomList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>roominf<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">データ取得数が指定した数に達したら終了です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>n<span style="color: #000000;">++</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>n<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span>maxnoofroom<span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">					</span><span style="font-weight: 600; color: #000080;">break</span><span style="color: #c0c0c0;"> </span>OuterLoop</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">SHOWROOM関連関数のテスト用プログラム、対象は</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetCategoryList()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetRoomList()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">です。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">実行には</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"CategoryName.txt"</span><span style="color: #c0c0c0;">　</span><span style="color: #008000;">が必要です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"CategoryName.txt"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">の内容はGetCategoryList()の説明にあります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">「SHOWROOM</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">自動星集め/種集め</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">-</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">配信ジャンルの取得（ソース）」</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">http://seppina.cocolog-nifty.com/blog/2019/08/post-9b442d.html</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">main()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Chromeを利用することを宣言</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>agoutiDriver<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>agouti<span style="color: #000000;">.</span>ChromeDriver<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>agoutiDriver<span style="color: #000000;">.</span>Start<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>agoutiDriver<span style="color: #000000;">.</span>Stop<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>page<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>agoutiDriver<span style="color: #000000;">.</span>NewPage<span style="color: #000000;">(</span>agouti<span style="color: #000000;">.</span>Desired<span style="color: #000000;">(</span>agouti<span style="color: #000000;">.</span>Capabilities<span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">"chromeOptions"</span><span style="color: #000000;">:</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">][]</span><span style="color: #000080;">string</span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">"args"</span><span style="color: #000000;">:</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">string</span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">"user-data-dir="</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"E:\\Tmp\\Chrome11"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Hyperion</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">},</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">},</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}),</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>IdxAmateur<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxOfficial<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>ShowroomLib<span style="color: #000000;">.</span>GetCategoryList<span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">,</span><span style="color: #c0c0c0;">                </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">*agouti.Page</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">"E:\\Tmp\\Chrome11"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Chrome作業用フォルダ、事前にSHOWROOMを視聴できる環境を作っておきます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">"CategoryName.txt"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンルとそのタイプ（公式/アマチュア）のリストです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Print<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxAmateur</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>IdxAmateur<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"%3d"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxAmateur<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Print<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxOfficial</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>IdxOfficial<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"%3d"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxOfficial<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>RoomList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>GetRoomList<span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>InOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;">             </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">昇順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #800080;">20</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;">                  </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">情報を取得するルームの数の上限</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">,</span><span style="color: #c0c0c0;">                </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">*agouti.Page</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">"E:\\Tmp\\Chrome11"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">環境設定済みのChrome作業フォルダ</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>IdxAmateur<span style="color: #000000;">,</span><span style="color: #c0c0c0;">          </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">アマチュア枠リスト</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Print<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Roomlist(アマチュア枠)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">\n"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>RoomList<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"&lt;%s&gt;\n"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>RoomList<span style="color: #000000;">[</span>i<span style="color: #000000;">].</span>URL<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>RoomList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>GetRoomList<span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>InReversOrder<span style="color: #000000;">,</span><span style="color: #c0c0c0;">       </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">降順</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #800080;">100</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;">                 </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">情報を取得するルームの数の上限</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">,</span><span style="color: #c0c0c0;">                </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">*agouti.Page</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">"E:\\Tmp\\Chrome11"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">環境設定済みのChrome作業フォルダ</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>IdxOfficial<span style="color: #000000;">,</span><span style="color: #c0c0c0;">         </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">公式枠リスト</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Print<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Roomlist(公式枠)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">\n"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>RoomList<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"&lt;%s&gt;\n"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>RoomList<span style="color: #000000;">[</span>i<span style="color: #000000;">].</span>URL<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre> </pre>
<p> </p>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-08-11T13:13:50+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/08/post-9b442d.html">
<title>SHOWROOM - 自動星集め/種集め - 配信ジャンルの取得（ソース）</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/08/post-9b442d.html</link>
<description>SHOWROOMで星あるいは種を集めようとするとオンライブ画面から公式枠なりアマ...</description>
<content:encoded><![CDATA[<p>SHOWROOMで星あるいは種を集めようとするとオンライブ画面から公式枠なりアマチュア枠なりのジャンルに移動して、現在配信されている配信画面を次々に開いていく必要があるのですが、ジャンル構成がたびたび変更されるのでその都度対応＝プログラムの修正＝を行うということになってました（<em>「<a href="http://seppina.cocolog-nifty.com/blog/2018/06/showroom---9bd2.html">Showroom - 自動星集め・星投げ・カウントツール</a>」</em>など）<br /><br />公式枠はジャンルの3番目から7番目、アマチュア枠は10番目というようなハードコーディングをやってるからそうなるわけで、今回はオンライブ画面から公式枠とアマチュア枠のジャンルがどこにあるか調べてジャンル位置のリストを作る関数を作ってみました。<br /><br />ジャンルの追加、削除、位置の変更に対し、何もしなくてもあるいはデータファイルを変更するだけで対応できるようになります。<br /><br />記事の最後にソースをおいておきます。利用法を含めかなり細かい説明を入れたつもりなので、記事での説明は省略します。<br /><br />それからいつジャンルのリストを作業をするかが問題です。星集めのプログラムの中で一日に一回やっておけばじゅうぶんみたいに思えるのですが、これまでの仕様変更（ジャンル枠の変更）は16時とかずいぶん思い切った(?)時間に行われたことがありましたから星集めの都度やっておいた方が無難かも....<br /><br />なお、こういうをやってると規約上どうなんだろう、という問題が発生するわけですが、それはご自身で考えてください。<br />すべてアウト（にできるぞ！）、とも受け取れる規約ですが、私の場合は、ここまではセーフ、ここから先はグレー、という線を自分なりに想定してやってます。<br /><br />ところでこういうのは、ほどほどにしておけばだいじょうぶ、と安心してもいられないことを最近知りました。<br /><br />　　<em>「<a href="https://ja.wikipedia.org/wiki/%E5%B2%A1%E5%B4%8E%E5%B8%82%E7%AB%8B%E4%B8%AD%E5%A4%AE%E5%9B%B3%E6%9B%B8%E9%A4%A8%E4%BA%8B%E4%BB%B6">岡崎市立中央図書館事件(Wikipedia)</a>」<br />　　「<a href="http://librahack.jp/">Librahack</a>」</em><br /><br />SHOWROOMのエンジニアさんは優秀そうだから、こんなことはないと思いますが、お互い気をつけましょう。<br /><br />---------------------<br /><br />SHOWROOMのための関数（GO言語、ソース）<br /><br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/04/post-7c90.html">SHOWROOMのイベント参加者のリストを取得する（GO, スクレイピング）</a>」</em><br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/06/post-231815.html">SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版）</a>」</em><br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/07/post-fec00d.html">SHOWROOM - イベント貢献ランキング（貢献ポイント）を取得する関数（ソース）</a>」</em><br /><br /></p>]]><![CDATA[<pre> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>main</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"fmt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"os"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"time"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"github.com/sclevine/agouti"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetCategoryList()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SHOWROOMの「オンライブ」画面で左側のジャンルのリストから、公式枠の位置と、アマチュア枠の位置を見つけ</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">その位置をスライスに格納して戻します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">引数</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">page</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">*agouti.Page</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ブラウザ画面のポインタ</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">nilであれば新たにブラウザを開きます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ChromeTmpFolder</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">string</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">pageがnilの場合はChromeの作業用フォルダを指定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">あらかじめ--user-data-dirにこのフォルダを指定してChromeを</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">起動し、SHOWROOMの視聴環境を整えておくことが必要です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">（この関数に限ってであれば、SHOWROOMへのログインは不要です）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">例</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">Chromeの作業用フォルダの起動オプションを</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								　　</span><span style="color: #008000;">--user-data-dir=E:\tmp\chrome01</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">と指定したときは、この引数は</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								　　</span><span style="color: #008000;">"E:\\Tmp\\Chrome11"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">と指定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">FilenameOfCatName</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">string</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンル名とタイプ（公式枠/アマチュア枠）の対応リストのファイル名を指定します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">								</span><span style="color: #008000;">ファイル名だけを指定した場合起動環境にあるファイルを読み込みます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">戻り値</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">IdxAmateur</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">[]int</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">オンライブ画面でのアマチュア枠ジャンルの位置</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">IdxOfficial</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">[]int</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">オンライブ画面での公式枠ジャンルの位置</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">statas</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">実行結果</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">0</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">正常終了</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">-1</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリータイプ対応リストが開けない</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">							</span><span style="color: #008000;">-2</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">オンライブ画面が開けないか、開けてもデータが取得できない</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">（2019年8月6日時点では）ジャンル名とタイプの対応リストファイルの内容は以下のようになります。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Official</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">アイドル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Official</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">タレント・モデル</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Official</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ミュージック</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Official</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">声優・アニメ</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Official</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">お笑い・トーク</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">Amateur</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">アマチュア</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これに対してオンライブ画面でのアマチュア枠/公式枠ジャンルの位置は次のような結果が得られます。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxAmateur</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">10</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxOfficial</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;">   </span><span style="color: #008000;">3</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">4</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">5</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">6</span><span style="color: #c0c0c0;">  </span><span style="color: #008000;">7</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">--------------------</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">この関数で得られたデータを利用してオンライブの各ジャンルの画面を巡回するときは次のような方法をとります。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">すべての公式枠について巡回する。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">IdxAmateur,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxOfficial,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">GetCategoryList(nil,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"E:\\Tmp\\Chrome11",</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"CategoryName.txt")</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">for</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">i</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">0;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">i</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">len(IdxOfficial);</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">i++</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">FmtFrame</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"#js-categorymenu-list</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">li:nth-child(%d)"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">SelectorFrame</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">fmt.Sprintf(FmtFrame,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxOfficial[i])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">page.Find(SelectorFrame).Click()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">.</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">.</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">.</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">--------------------</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">***</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これまで作った（公開）したプログラムにはハードコーディングしたところが多いです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">少しずつ直してきたのですが、いちばん問題になるジャンルの変更への対応を解決するために</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">用意した関数です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">これで以下のようなケースにプログラムを変更せずに対応できるようになります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">（もちろん星集め/種集めの関数をこの関数に合わせて変更する必要はあります）</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンルの順番</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンルの並び順が変更されても影響は受けません。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンルの削除</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">対応リストから該当ジャンルを削除します。ただ削除しなくても正常に動作します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンルの追加</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">対応リストの変更が必要です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">対応リストを変更しない場合、追加されたジャンルがないものとして動作します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">また、本来のジャンルとは違うもの（カラオケやメンズ枠みたいなやつ）の追加は</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">何もしなくて対応できます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ジャンル名の変更</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">対応リストのジャンル名を変更します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">対応リストを変更しない場合、名称が変更されたジャンルがないものとして動作します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">情報収集にしても星集め、星投げにしてもSHOWROOMのシステムに依存しているわけで、</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">プログラムを変更しないで、SHOWROOMの仕様変更すべてに対応できるわけはないのですが...</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">--------------------</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">それから、この関数はデータ収集が目的だからagoutiではなくてgoqueryでいいのではないのかという指摘がありそうですが、</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">オンライブ画面からのジャンル情報の取得は動的サイトとして扱う必要がありgoqueryでは必要なデータを得ることができません。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Scrapy</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">+</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Splash</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">を使えば動的サイトとして扱わなければならない場合もgoqueryで行けるそうですが、まだ実際に</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">やってみたことがありません。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">なおagoutiを使うにしてもheadlessで動かせれば負荷の軽減になるのですが、これもまだうまく行っていません。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">GetCategoryList(</span>page<span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span>agouti<span style="color: #000000;">.</span>Page<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ChromeTmpFolder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>FilenameOfCatName<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>IdxAmateur<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxOfficial<span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリーリストを読み込みマップに格納します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>CategoryMap<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">make</span><span style="color: #000000;">(</span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">]</span><span style="color: #000080;">string</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>CategName<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>TypeName<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>FileCategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Open<span style="color: #000000;">(</span>FilenameOfCatName<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリーリストをオープンできなかった場合</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>nod<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Fscanf<span style="color: #000000;">(</span>FileCategory<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"%s%s\n"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>TypeName<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&amp;</span>CategName<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>nod<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">読み込んだデータが2個でない場合は読み込みを終了します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">EOFや空白行がデータの終わりということになります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">break</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>CategoryMap<span style="color: #000000;">[</span>CategName<span style="color: #000000;">]</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>TypeName</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ブラウザが開かれていない場合は、新たにブラウザを開きます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ここで開いたブラウザはこの関数が終了するときとじられます（</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">==&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">defer()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>page<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Chromeを利用することを宣言</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>agoutiDriver<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>agouti<span style="color: #000000;">.</span>ChromeDriver<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>agoutiDriver<span style="color: #000000;">.</span>Start<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">defer</span><span style="color: #c0c0c0;"> </span>agoutiDriver<span style="color: #000000;">.</span>Stop<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>page<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>agoutiDriver<span style="color: #000000;">.</span>NewPage<span style="color: #000000;">(</span>agouti<span style="color: #000000;">.</span>Desired<span style="color: #000000;">(</span>agouti<span style="color: #000000;">.</span>Capabilities<span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">"chromeOptions"</span><span style="color: #000000;">:</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">map</span><span style="color: #000000;">[</span><span style="color: #000080;">string</span><span style="color: #000000;">][]</span><span style="color: #000080;">string</span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">"args"</span><span style="color: #000000;">:</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">string</span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">					</span><span style="color: #008000;">"user-data-dir="</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>ChromeTmpFolder<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">Hyperion</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #000000;">},</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">},</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}),</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">「オンライブ」画面、左側にジャンルの一覧が表示されています。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>page<span style="color: #000000;">.</span>Navigate<span style="color: #000000;">(</span><span style="color: #008000;">"https://www.showroom-live.com/onlive"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">画面が安定するまで待つため。これでもダメなときはデータ取得のときリトライを繰り返します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>time<span style="color: #000000;">.</span>Sleep<span style="color: #000000;">(</span><span style="color: #800080;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Second<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">表示されているジャンルの名称を上から順番に取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>retry<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>Selector<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sprintf<span style="color: #000000;">(</span><span style="color: #008000;">"#js-categorymenu-list</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">li:nth-child(%d)"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>NameOfCateg<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>page<span style="color: #000000;">.</span>Find<span style="color: #000000;">(</span>Selector<span style="color: #000000;">).</span>Text<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>NameOfCateg<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">""</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>retry<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">すでに少なくともデータを一つ以上取得できているケースです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">すべてのデータが処理済みと考えます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="font-weight: 600; color: #000080;">break</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>retry<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">9</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ウェイトが10回繰り返された場合は</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">何らかの理由で画面が開けないものとしエラーを戻します</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">2</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">最初のデータが取得できない場合はウェイトします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>time<span style="color: #000000;">.</span>Sleep<span style="color: #000000;">(</span><span style="color: #800080;">2</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">*</span><span style="color: #c0c0c0;"> </span>time<span style="color: #000000;">.</span>Second<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>i<span style="color: #000000;">--</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>retry<span style="color: #000000;">++</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"GetCategoryList()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">Retry</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>retry<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span><span style="color: #c0c0c0;"> </span><span style="font-weight: 600; color: #000080;">else</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">データを取得できたとき</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>retry<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">カテゴリーリストを参照して公式、アマチュアに振り分けます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">switch</span><span style="color: #c0c0c0;"> </span>CategoryMap<span style="color: #000000;">[</span>NameOfCateg<span style="color: #000000;">]</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"Official"</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>IdxOfficial<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>IdxOfficial<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">case</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"Amateur"</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>IdxAmateur<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>IdxAmateur<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">default</span><span style="color: #000000;">:</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">振り分けられないジャンルが存在する場合は</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">本来の意味ではないジャンル（人気、メンズ、バーチャル、カラオケ、誕生日など）の場合</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">カテゴリーリストの記述に誤りがある。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">カテゴリーリストが最新の状況を反映していない</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">のいずれかでしょう。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"GetCategoryList()</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">No</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">such</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">category</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">or</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">type</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&lt;%s&gt;&lt;%s&gt;.\r\n"</span><span style="color: #000000;">,</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">				</span>NameOfCateg<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>CategoryMap<span style="color: #000000;">[</span>NameOfCateg<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">GetCategoryList()のテスト用プログラム</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"CategoryName.txt"の内容はGetCategoryList()の説明にあります。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">main()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>IdxAmateur<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxOfficial<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>GetCategoryList<span style="color: #000000;">(</span><span style="color: #000080;">nil</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"E:\\Tmp\\Chrome11"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"CategoryName.txt"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">status="</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>status<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Print<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxAmateur</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>IdxAmateur<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"%3d"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxAmateur<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Print<span style="color: #000000;">(</span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">IdxOfficial</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>IdxOfficial<span style="color: #000000;">);</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"%3d"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>IdxOfficial<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre> </pre>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-08-07T11:05:54+09:00</dc:date>
</item>
<item rdf:about="http://seppina.cocolog-nifty.com/blog/2019/07/post-fec00d.html">
<title>SHOWROOM - イベント貢献ランキング（貢献ポイント）を取得する関数（ソース）</title>
<link>http://seppina.cocolog-nifty.com/blog/2019/07/post-fec00d.html</link>
<description>イベント貢献ランキングの取得については以前書いた　　「Showroom - イベ...</description>
<content:encoded><![CDATA[<p>イベント貢献ランキングの取得については以前書いた<br /><br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2018/08/showroom---aa9a.html">Showroom - イベントの獲得ポイント数を取得して記録するツール</a>」</em><br /><br />にもあったのですが、パフォーマンス（負荷）の問題があるので<br /><br />　　<em>「<a href="http://seppina.cocolog-nifty.com/blog/2019/06/post-231815.html">SHOWROOM - イベントでの配信者の獲得ポイント数を取得する（改良版）</a>」</em> <br /><br />と同じように書き直してみました。つまり go/agouti をやめて go/goquery を使っています。<br /><br />また関数のインターフェースについては、最近のいくつかの記事と同様に<br /><br />　　1.  実行時のパラメータ（イベントIDや配信者ID）は引数として渡し<br />　　2.  結果はすべて戻り値として受け取る<br />　　3.  結果がリストの場合はSliceとして受け渡す<br /><br />という方針にしました。ソースはそれほど長くないのでこの記事の最後にそのまま掲載します。<br /><br />関数のインターフェースやサンプルプログラムの実行方法についてはコメントにあります。<br /><br />ところで、貢献ポイントランキングを取得することに意味があるのか、というのがあるのですが、<br />まあぜったい必要になるというのは減算が発生したとき、原因アカウントを特定するときくらいでしょうか w<br />もっとも貢献ポイントランキングがあればかならず原因アカウントを特定できるわけでもありませんが。<br /><br />配信者さんにとっては、○○くん、最近サボリ気味だから気合入れておこうかなあ、とか...<br /><br />なお減算については<br /><br /><em>　　「<a href="http://seppina.cocolog-nifty.com/blog/2018/09/showroom-----23.html">Showroom - 複数アカウント(複垢)問題の真実 - 実験計画</a>」<br />　　「<a href="http://seppina.cocolog-nifty.com/blog/2018/11/showroom-caeb.html">Showroomの重複アカウント（複垢）減算はこうして起きる</a>」</em> <br /><br />に書いたのですが、<a href="https://twitter.com/MmSwrm">ムム＠ＳＲ</a>さん（ あるいは <a href="https://www.sr-evd.xyz/">Showroom イベント ポイント遷移グラフ公開所</a>）によれば実際はもっと"複雑怪奇"なケースもあるようです。<br /><br />サンプルプログラムの実行結果<br /><a href="http://seppina.cocolog-nifty.com/photos/uncategorized/photo_20190729003701.png" target="_blank" rel="noopener"><img style="margin: 3px;" title="Photo_20190729003701" src="http://seppina.cocolog-nifty.com/blog/images/photo_20190729003701.png" alt="Photo_20190729003701" width="300" height="219" border="0" /></a> <br /><br />じつはさらに（もうちょっとだけ）パフォーマンスがいい方法があるようです。公開に問題なさそうであれば、そのうち記事にします。<br /><br />---------------------------------------------<br /><br /></p>]]><![CDATA[<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">SHOWROOMのイベント貢献ランキングを取得する関数とその使用例です。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">使い方</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">イベントページのURLが</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">https://www.showroom-live.com/event/event_id</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">で、配信者さんのID（SHOWROOMへの登録順を示すと思われる6桁以下の数字）が</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">ID_Account</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">のとき</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">%</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">実行モジュール名</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">event_id</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">ID_Account</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">と実行すると貢献ランキングの一覧が表示されます。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">例えば現時点(2019/07/28)でいちばん目立つところにあるイベントの一位さんの貢献ランキングを知りたいときは</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">%</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">実行モジュール名</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">kc19aw_final</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">120380</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">とします。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">Webページからのデータ取得の参考としては以下などがあります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">「はじめてのGo言語：Golangでスクレイピングをしてみた」</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">https://qiita.com/ryo_naka/items/a08d70f003fac7fb0808</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">※</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">ざくっとした内容ですがGO言語のインストールのところから書いてあります。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="color: #008000;">※</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">お時間のある方は系統的に書かれたものを探してじっくり勉強してください。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetPointsContA00.exe</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">2019/07/28</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">15:00</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">新規作成</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">package</span><span style="color: #c0c0c0;"> </span>main</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">import</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"fmt"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"os"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"strconv"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"strings"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"net/url"</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">"github.com/PuerkitoBio/goquery"</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">/*</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">GetPointsCont()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">イベントページのURLと配信者さんのIDから、イベント貢献ランキングのリストを取得します。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">引数</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">EvnetName</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">string</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">イベント名、下記イベントページURLの"event_id"の部分</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">https://www.showroom-live.com/event/event_id</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ID_Account</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">string</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">配信者さんのID</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">SHOWROOMへの登録順を示すと思われる6桁(以下)の数字です。アカウントとは違います。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">戻り値</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">NoListner</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">int</span><span style="color: #c0c0c0;">			</span><span style="color: #008000;">リスナーの数、現状最大100ですが、100を越えても問題ないです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">RankingList</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">[]int</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">リスナーの順位</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">PointList</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">[]int</span><span style="color: #c0c0c0;">		</span><span style="color: #008000;">リスナーの貢献ポイント</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ListnerList</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">[]string</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">リスナーの名前</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">***</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">リスナーさんの日々のあるいは配信ごとの貢献ポイントの推移がすぐにわかれば配信者さんもいろいろ手の打ちよう(?)が</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">ありそうですが、「リスナーの名前」というのはリスナーさんが自由に設定・変更できるので貢献ポイントを追いかけて</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">行くのはけっこうたいへんです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">こまめに記録しておくと、減算ポイントが発生したときの原因アカウントの特定には使えないこともないです。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">（実際やってみるとわかるのですが、これはこれでなかなかたいへんです）</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">なお、原因アカウントの特定、というのは犯人探しというような意味で言ってるわけじゃありませんので念のため。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #008000;">*/</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">GetPointsCont(</span>EventName<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ID_Account<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">(</span>NoListner<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>RankingList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>PointList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">int</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ListnerList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">[]</span><span style="color: #000080;">string</span><span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">貢献ランキングのページを開き、データ取得の準備をします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>_url<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"https://www.showroom-live.com/event/contribution/"</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>EventName<span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"?room_id="</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">+</span><span style="color: #c0c0c0;"> </span>ID_Account</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>doc<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>goquery<span style="color: #000000;">.</span>NewDocument<span style="color: #000000;">(</span>_url<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>err<span style="color: #c0c0c0;"> </span><span style="color: #000000;">!=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">nil</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000080;">panic</span><span style="color: #000000;">(</span>err<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>u<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>url<span style="color: #000000;">.</span>URL<span style="color: #000000;">{}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>u<span style="color: #000000;">.</span>Scheme<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>doc<span style="color: #000000;">.</span>Url<span style="color: #000000;">.</span>Scheme</pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>u<span style="color: #000000;">.</span>Host<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>doc<span style="color: #000000;">.</span>Url<span style="color: #000000;">.</span>Host</pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">各リスナーの情報を取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>selector_ranking<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>selector_listner<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>selector_point<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ranking<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>listner<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>point<span style="color: #c0c0c0;"> </span><span style="color: #000080;">string</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">var</span><span style="color: #c0c0c0;"> </span>iranking<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ipoint<span style="color: #c0c0c0;"> </span><span style="color: #000080;">int</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">データを一つ取得するたびに(戻り値となる)リスナー数をカウントアップします。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">100</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">以下セレクターはブラウザの開発ツールを使って確認したものです。</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">順位を取得し、文字列から数値に変換します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>selector_ranking<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sprintf<span style="color: #000000;">(</span><span style="color: #008000;">"table.table-type-01:nth-child(2)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">tbody:nth-child(2)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">tr:nth-child(%d)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">td:nth-child(%d)"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #000000;">+</span><span style="color: #800080;">2</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">1</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ranking<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>doc<span style="color: #000000;">.</span>Find<span style="color: #000000;">(</span>selector_ranking<span style="color: #000000;">).</span>Text<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">データがなくなったらbreakします。このときのNoListnerは通常100、場合によってはそれ以下です。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span>ranking<span style="color: #c0c0c0;"> </span><span style="color: #000000;">==</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">""</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">			</span><span style="font-weight: 600; color: #000080;">break</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>iranking<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>strconv<span style="color: #000000;">.</span>Atoi<span style="color: #000000;">(</span>ranking<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">リスナー名を取得します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>selector_listner<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sprintf<span style="color: #000000;">(</span><span style="color: #008000;">"table.table-type-01:nth-child(2)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">tbody:nth-child(2)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">tr:nth-child(%d)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">td:nth-child(%d)"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #000000;">+</span><span style="color: #800080;">2</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">2</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>listner<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>doc<span style="color: #000000;">.</span>Find<span style="color: #000000;">(</span>selector_listner<span style="color: #000000;">).</span>Text<span style="color: #000000;">()</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">貢献ポイントを取得し、文字列から"pt"の部分を除いた上で数値に変換します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>selector_point<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>fmt<span style="color: #000000;">.</span>Sprintf<span style="color: #000000;">(</span><span style="color: #008000;">"table.table-type-01:nth-child(2)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">tbody:nth-child(2)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">tr:nth-child(%d)</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">&gt;</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">td:nth-child(%d)"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #000000;">+</span><span style="color: #800080;">2</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">3</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>point<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>doc<span style="color: #000000;">.</span>Find<span style="color: #000000;">(</span>selector_point<span style="color: #000000;">).</span>Text<span style="color: #000000;">()</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>point<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>strings<span style="color: #000000;">.</span>Replace<span style="color: #000000;">(</span>point<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"pt"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">""</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">-</span><span style="color: #800080;">1</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ipoint<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>_<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span>strconv<span style="color: #000000;">.</span>Atoi<span style="color: #000000;">(</span>point<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="color: #008000;">//</span><span style="color: #c0c0c0;">	</span><span style="color: #008000;">戻り値となるスライスに取得したデータを追加します。</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>RankingList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>RankingList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>iranking<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>PointList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>PointList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ipoint<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>ListnerList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">=</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">append</span><span style="color: #000000;">(</span>ListnerList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>listner<span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="font-weight: 600; color: #000080;">func</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">main()</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">if</span><span style="color: #c0c0c0;"> </span><span style="color: #000080;">len</span><span style="color: #000000;">(</span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">)</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">3</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Println<span style="color: #000000;">(</span><span style="color: #008000;">"Usage:</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">0</span><span style="color: #000000;">],</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">"</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">EventName</span><span style="color: #c0c0c0;"> </span><span style="color: #008000;">ID_Account"</span><span style="color: #000000;">)</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span><span style="font-weight: 600; color: #000080;">return</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>EventName<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">1</span><span style="color: #000000;">]</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>ID_Account<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>os<span style="color: #000000;">.</span>Args<span style="color: #000000;">[</span><span style="color: #800080;">2</span><span style="color: #000000;">]</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span>NoListner<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>RankingList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>PointList<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ListnerList<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span>GetPointsCont<span style="color: #000000;">(</span>EventName<span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>ID_Account<span style="color: #000000;">)</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="font-weight: 600; color: #000080;">for</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">:=</span><span style="color: #c0c0c0;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #c0c0c0;"> </span><span style="color: #000000;">&lt;</span><span style="color: #c0c0c0;"> </span>NoListner<span style="color: #000000;">;</span><span style="color: #c0c0c0;"> </span>i<span style="color: #000000;">++</span><span style="color: #c0c0c0;"> </span><span style="color: #000000;">{</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">		</span>fmt<span style="color: #000000;">.</span>Printf<span style="color: #000000;">(</span><span style="color: #008000;">"%d\t%d\t%s\r\n"</span><span style="color: #000000;">,</span><span style="color: #c0c0c0;"> </span>RankingList<span style="color: #000000;">[</span>i<span style="color: #000000;">],</span><span style="color: #c0c0c0;"> </span>PointList<span style="color: #000000;">[</span>i<span style="color: #000000;">],</span><span style="color: #c0c0c0;"> </span>ListnerList<span style="color: #000000;">[</span>i<span style="color: #000000;">])</span></pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #c0c0c0;">	</span><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>
<pre style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"><span style="color: #000000;">}</span></pre>
<pre style="-qt-paragraph-type: empty; -qt-block-indent: 0; text-indent: 0px; margin: 0px;"> </pre>]]></content:encoded>


<dc:subject>パソコン・インターネット</dc:subject>

<dc:creator>セッピーナ</dc:creator>
<dc:date>2019-07-29T00:45:22+09:00</dc:date>
</item>


</rdf:RDF>
