<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>自動化 &#8211; mirai</title>
	<atom:link href="https://origin.mirai006.com/category/automation/feed" rel="self" type="application/rss+xml" />
	<link>https://origin.mirai006.com</link>
	<description>みらいへ</description>
	<lastBuildDate>Mon, 19 Aug 2019 07:23:05 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.5</generator>
	<item>
		<title>1万ツイート達成</title>
		<link>https://origin.mirai006.com/2015/09/10/196</link>
		
		<dc:creator><![CDATA[mirai]]></dc:creator>
		<pubDate>Wed, 09 Sep 2015 23:57:14 +0000</pubDate>
				<category><![CDATA[自動化]]></category>
		<guid isPermaLink="false">http://roku.tokyo/?p=196</guid>

					<description><![CDATA[BotTweetが1万ツイートを達成しました。 もう少し、TwitterのAlayticsの勉強のため、続けます。 twitter@roku_mirai2]]></description>
										<content:encoded><![CDATA[<p>BotTweetが1万ツイートを達成しました。</p>
<p>もう少し、TwitterのAlayticsの勉強のため、続けます。</p>
<p><a href="https://roku-mirai.sakura.ne.jp/mirai/wp-content/uploads/2015/09/10000.png"><img loading="lazy" class="alignnone size-medium wp-image-194" src="https://roku-mirai.sakura.ne.jp/mirai/wp-content/uploads/2015/09/10000-300x195.png" alt="10000" width="300" height="195"></a></p>
<p><a href="https://twitter.com/roku_mirai2">twitter@roku_mirai2</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>サクラエディタを利用し易い設定にする</title>
		<link>https://origin.mirai006.com/2015/08/26/171</link>
		
		<dc:creator><![CDATA[mirai]]></dc:creator>
		<pubDate>Wed, 26 Aug 2015 03:21:47 +0000</pubDate>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[自動化]]></category>
		<guid isPermaLink="false">http://roku.tokyo/?p=171</guid>

					<description><![CDATA[会社でサクラエディタを利用しています。 最近、Powershellを記述しているのですが、コマンドが正しく入力できているかわからず、何回かエラーを出して修正を繰り返していました。面倒なので、正しくコマンドが入力できている [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>会社でサクラエディタを利用しています。</p>
<p>最近、Powershellを記述しているのですが、コマンドが正しく入力できているかわからず、何回かエラーを出して修正を繰り返していました。面倒なので、正しくコマンドが入力できているか確認するため、サクラエディタの強調機能を利用して文字の色を変えることをしました。</p>
<p>この機能を使うためには、Powershellのコマンドを取ってこなくてはなりません。コマンドを取ってくるソースファイルは下記のとおりです。</p>
<p>&nbsp;</p>
<pre class="lang:ps decode:true"># キーワードを取得する

(Get-Command | Where-Object {$_.CommandType -eq "Cmdlet" } ).Name | `
    Out-File -Encoding UTF8 -FilePath .\PowerShell_ALL.kwd

(Get-Command -Module "AWSPowerShell").Name  | `
    Out-File -Encoding UTF8 -FilePath .\PowerShell_AWS.kwd

(Get-Command -Module "Azure").Name  | `
    Out-File -Encoding UTF8 -FilePath .\PowerShell_Azure.kwd

(Get-Command | Where-Object {$_.CommandType -eq "Cmdlet" -and `
                             $_.Module.Name -ne "AWSPowerShell" -and `
                             $_.Module.Name  -ne "Azure" } ).Name  | `
    Out-File -Encoding UTF8 -FilePath .\PowerShell_command.kwd 
</pre>
<p>AWS、Azure、Powershellのコマンドを分けて取り込むようにしています。今後ソースの色を見たら、おっ、AWSの記述だな。とかAzureじゃん。などと気づけるようになっています。設定後のカラーは下記のとおりです。</p>
<p><img loading="lazy" id="__wp-temp-img-id" title="" src="https://roku-mirai.sakura.ne.jp/mirai/wp-content/uploads/2015/08/newsakura.png" alt="" width="433" height="427"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Twitter投稿サービスのリファクタ</title>
		<link>https://origin.mirai006.com/2015/07/25/134</link>
		
		<dc:creator><![CDATA[mirai]]></dc:creator>
		<pubDate>Sat, 25 Jul 2015 14:46:54 +0000</pubDate>
				<category><![CDATA[自動化]]></category>
		<guid isPermaLink="false">http://roku.tokyo/?p=134</guid>

					<description><![CDATA[Twitterのシステムリファクタのコードです。Rubyで書いています。接続情報などは、yamlで記述しています。また、メッセージも合わせてyamlで取るようにしています。 #!/usr/bin/ruby # encod [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Twitterのシステムリファクタのコードです。Rubyで書いています。接続情報などは、yamlで記述しています。また、メッセージも合わせてyamlで取るようにしています。</p>
<pre class="lang:ruby decode:true">#!/usr/bin/ruby
# encoding: utf-8

require 'twitter'
require 'oauth'
require 'yaml'

  twitterAccuont = ARGV[0]
  messageInfo    = ARGV[1]

  key     = YAML.load_file('../twitterConf/twitter.yml')
  massage = YAML.load_file('../twitterConf/massage.yml')

  begin

    client = Twitter::REST::Client.new do |config|
      config.consumer_key        = key[twitterAccuont]['consumer_key'    ]
      config.consumer_secret     = key[twitterAccuont]['consumer_select' ]
      config.access_token        = key[twitterAccuont]['access_token_key']
      config.access_token_secret = key[twitterAccuont]['access_secret'   ]
    end

    str_out =           massage[messageInfo]['message'] + " "
    str_out = str_out + massage[messageInfo]['tag'] + " " + Time.now.strftime("%Y-%m-%d %H:%M:%S")
    
    client.update(str_out)
    
    p Time.now.strftime("%Y-%m-%d %H:%M:%S") + " " + twitterAccuont + " " + "tweet-msg" + " " + messageInfo
    
    rescue =&gt; e
    STDERR.puts "[EXCEPTION] " + e.to_s
    p Time.now.strftime("%Y-%m-%d %H:%M:%S") + " " + twitterAccuont + " " + "tweet-msg" + " " + messageInfo + " Error:" + e.to_s
    exit 1

  end
</pre>
<p>Twitterの設定ファイルのyamlでは</p>
<pre class="lang:yaml decode:true ">roku-miai:
    consumer_key     : xxxxxxxxxxxxxxxxxxxxx
    consumer_select  : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    access_token_key : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    access_secret    : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
</pre>
<p>メッセージはYamlは</p>
<pre class="lang:yaml decode:true ">say_hello:
  message : "おはようございます。Good morning. Starting to update Today."
  tag     : " #goldfish #金魚 #水温 #RaspberryPi #MiraiWaterTemp #netthing #IoT #M2M"
say_goodby:
  message : "こんばんは。Stopping update because of dark. See you. "
  tag     : " #goldfish #金魚 #水温 #RaspberryPi #MiraiWaterTemp #netthing #IoT #M2M"
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>美しいコード</title>
		<link>https://origin.mirai006.com/2015/06/30/87</link>
		
		<dc:creator><![CDATA[mirai]]></dc:creator>
		<pubDate>Tue, 30 Jun 2015 13:01:28 +0000</pubDate>
				<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">http://roku.tokyo/?p=87</guid>

					<description><![CDATA[今日はお仕事でPowershellを勉強しました。 そこで出会ったコード。すごく美しいんです。ため息が出るくらい。 真髄は１７行目から。For文を使わないで関数を回している。うぅん、ここまでやるか。すげー。即、頂いて自分 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>今日はお仕事でPowershellを勉強しました。</p>
<p>そこで出会ったコード。すごく美しいんです。ため息が出るくらい。</p>
<p>真髄は１７行目から。For文を使わないで関数を回している。うぅん、ここまでやるか。すげー。即、頂いて自分が欲しいデータが取れるようにしました。ありがとう。</p>
<p><a href="http://mtgpowershell.blogspot.jp/2011/03/get-winevent.html">http://mtgpowershell.blogspot.jp/2011/03/get-winevent.html</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Twilioを取得</title>
		<link>https://origin.mirai006.com/2015/06/10/11</link>
		
		<dc:creator><![CDATA[mirai]]></dc:creator>
		<pubDate>Wed, 10 Jun 2015 13:31:28 +0000</pubDate>
				<category><![CDATA[自動化]]></category>
		<guid isPermaLink="false">http://roku-mirai.sakura.ne.jp/mirai/?p=11</guid>

					<description><![CDATA[とうとうやりました。Twilioのサービスに登録しました。 出会ってから半年、とっても良いサービスでテストもバッチシだったのですが、なかなか踏ん切りがつかず、今まで来てしまいました。だけど、やっぱり使いたい！ってことで取 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>とうとうやりました。Twilioのサービスに登録しました。</p>
<p>出会ってから半年、とっても良いサービスでテストもバッチシだったのですが、なかなか踏ん切りがつかず、今まで来てしまいました。だけど、やっぱり使いたい！ってことで取得しました。いえーい！</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
