<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>tomatomax.net &#187; Program</title>
	<atom:link href="http://blog.tomatomax.net/archives/category/program/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.tomatomax.net</link>
	<description>Every rule has its exception.</description>
	<lastBuildDate>Sat, 21 Jan 2012 13:53:13 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/category/program/feed" />
		<item>
		<title>ログ出力</title>
		<link>http://blog.tomatomax.net/archives/2866</link>
		<comments>http://blog.tomatomax.net/archives/2866#comments</comments>
		<pubDate>Sun, 23 Oct 2011 08:53:20 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2866</guid>
		<description><![CDATA[AndroidのSDKさわりはじめ。まずはデバッグログ出力から。 ・ログの埋め込み プログラム中にログを仕込むにはログのレベル(優先度)に応じてLog.d(), Log.w(),などを使用可能。優先度はverbose,  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/89927564@N00/5715851995/" title="&quot;Narcoleptic Powerbook&quot;" rel=""><img src="http://farm3.static.flickr.com/2414/5715851995_9da122cf5c.jpg" alt="&quot;Narcoleptic Powerbook&quot;"></a><br />
AndroidのSDKさわりはじめ。まずはデバッグログ出力から。</p>
<p><strong>・ログの埋め込み</strong><br />
プログラム中にログを仕込むにはログのレベル(優先度)に応じてLog.d(), Log.w(),などを使用可能。優先度はverbose, debug, info, warning, errorとあって、errorが一番優先度が高い。書き込む際は、それぞれ以下のメソッドで書き込みを行う。</p>
<ul>
<li>Log.v(String tag, String msg) // verbose</li>
<li>Log.d(String tag, String msg) // debug</li>
<li>Log.i(String tag, String msg) // info</li>
<li>Log.w(String tag, String msg) // warning</li>
<li>Log.e(String tag, String msg) // error</li>
</ul>
<p>msgはログ内容。tagは他のプロセス/クラスのログと区別するための識別子として使う。</p>
<p>参照:<a href="http://developer.android.com/reference/android/util/Log.html">LogクラスのAPIリファレンス</a></p>
<p><strong>・ログの表示</strong><br />
Logクラスを使って埋め込んだログを表示するにはlogcatを使用する。全てのプロセスのログが含まれているので、タグでフィルタを作って自分のログのみを抽出する</p>
<p>参照:<a href="http://developer.android.com/guide/developing/tools/logcat.html">logcatリファレンス</a></p>
<p>Eclipseからであればメニューの&#8221;Window&#8221; &gt; &#8220;Show View&#8221; &gt; &#8220;Other&#8221; &gt; &#8220;Android&#8221; &gt; &#8220;Logcat&#8221; でLogcatウィンドウを表示できる。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2866/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2866" />
	</item>
		<item>
		<title>i家計簿バージョンアップしました</title>
		<link>http://blog.tomatomax.net/archives/2821</link>
		<comments>http://blog.tomatomax.net/archives/2821#comments</comments>
		<pubDate>Sat, 19 Feb 2011 13:34:17 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[iAppli]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2821</guid>
		<description><![CDATA[昨日からドコモマーケットで新バージョンが公開されています。大きな機能追加は ありませんが、より使いやすくなっています 変更点 -[詳細表示]の際に上下キー押しっぱなしで高速スクロールするよう修正 -メニューのショートカッ [...]]]></description>
			<content:encoded><![CDATA[<p>昨日からドコモマーケットで新バージョンが公開されています。大きな機能追加は<br />
ありませんが、より使いやすくなっています</p>
<p>変更点<br />
-[詳細表示]の際に上下キー押しっぱなしで高速スクロールするよう修正<br />
-メニューのショートカットキーを追加<br />
-メニューをクリアキーでキャンセルできるように修正<br />
-メール送信の際に容量が多い場合は、分割送信を行うように修正</p>
<p>既にダウンロード済みの方は、無料でアップデートできますので、ドコモマーケッ<br />
トから再度ダウンロードをお願いいたします</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2821/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2821" />
	</item>
		<item>
		<title>ドコマでアプリを公開するまで</title>
		<link>http://blog.tomatomax.net/archives/2810</link>
		<comments>http://blog.tomatomax.net/archives/2810#comments</comments>
		<pubDate>Thu, 27 Jan 2011 14:36:40 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Program]]></category>
		<category><![CDATA[iAppli]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2810</guid>
		<description><![CDATA[twitterでは告知しましたが、1/20からドコモマーケット(ドコマ)でi家計簿を公開しています。ほとんどガイドラインの通りですが、そのときの手順について記録を残しておきます。ガイドラインちょう重要。 作者登録 マーケ [...]]]></description>
			<content:encoded><![CDATA[<p><a class="" rel="" title="docomodake" href="http://www.flickr.com/photos/7743837@N06/5381587896/"><img src="http://farm6.static.flickr.com/5046/5381587896_405604d22f.jpg" alt="docomodake"></a></p>
<p><a href="http://twitter.com/maruguu/status/28077530246283264">twitterでは告知しました</a>が、1/20からドコモマーケット(ドコマ)で<a href="http://blog.tomatomax.net/ikakeibo">i家計簿</a>を公開しています。ほとんどガイドラインの通りですが、そのときの手順について記録を残しておきます。ガイドラインちょう重要。</p>
<h2>作者登録</h2>
<p><a href="https://www.market-box.jp/ip/top.do">マーケット管理システム</a>にアクセスして登録を行う。<br />
登録には&#8221;本人性確認書類&#8221;のスキャンデータが必要。システム利用料については今月末までは無料ということで、支払いはなし。</p>
<p>ドコモからシステム認証キーが郵送されてきたら、マーケット管理システムにログイン後、キーを入力する。これでアプリ登録が可能に。</p>
<h2>アプリ登録</h2>
<p>マーケット管理システムでアプリを追加する。アプリを追加すると、DXIDとPackageURLが割り振られるので開発しているアプリのADFにそのDXIDとPackageURLを入力する。<br />
ビルドしたアプリのアップロードもブラウザから可能。開発用に登録したケータイからダウンロードしてデバッグできる。開発用に登録したケータイだと、ドコマのコンテンツを見ることができないので、デバッグが終わったら登録削除が必要かも。<br />
対応機種には、動作を実際に確認していなくても、機種名にチェックを入れておかないと、対応機種以外ではダウンロードすることができない。机上で確認した分でもチェックが必要。</p>
<h2>アプリ公開申請</h2>
<p>公開準備が整ったら、マーケット管理システムから公開申請を行う。<br />
# チェックシートでガイドラインにそっているか確認するのだけれども、このとき初めて&#8221;開発者の問い合わせ先&#8221;というのがアプリ内に必要ということに気づき、あわてて修正<br />
審査結果はメールで届く。結果は否認。&#8221;開発者の問い合わせ先&#8221;がわかりにくい、というものだった。(最初はアプリ内&#8221;操作説明&#8221;に問い合わせ先が書かれていた)<br />
そこを修正後、再度申請を行うと、今度は承認され、アプリが公開される。<br />
# 審査自体はびっくりするくらい早かった。そんなに忙しくないのか。</p>
<h2>公開後</h2>
<p>マーケット管理システムから売り上げ情報のCSV(がZip圧縮されたもの)がダウンロードできる。まだ一週間分なのでたいした量ではないが、人によっては巨大ファイルになるのでは。</p>
<p>もともとアプリコンテストが目に付き、登録してみたのだけれども、あまりに締め切り直前だったため、作者登録していたら締め切りｵﾜﾀ＼(^o^)／<br />
iアプリの制限はいろいろダメな点が多いですが、4月からようやく自由に通信可能になりそうなのでそれに期待ですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2810/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2810" />
	</item>
		<item>
		<title>家計簿アプリ作りました</title>
		<link>http://blog.tomatomax.net/archives/2773</link>
		<comments>http://blog.tomatomax.net/archives/2773#comments</comments>
		<pubDate>Sat, 18 Dec 2010 07:07:13 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[iAppli]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2773</guid>
		<description><![CDATA[今まで使っていたGoogle Documentでの家計簿をやめて、今年は紙の家計簿にしてました。 KAKEIBO家計ぼセット posted with amazlet at 10.12.18 永岡書店 売り上げランキング: [...]]]></description>
			<content:encoded><![CDATA[<p>今まで使っていたGoogle Documentでの家計簿をやめて、今年は紙の家計簿にしてました。</p>
<div class="amazlet-box" style="margin-bottom:0px;">
<div class="amazlet-image" style="float:left;margin:0px 12px 1px 0px;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4522479557/maruguu-22/ref=nosim/" name="amazletlink" target="_blank"><img src="http://images-jp.amazon.com/images/G/09/icons/books/comingsoon_books.gif" alt="KAKEIBO家計ぼセット" style="border: none;" /></a></div>
<div class="amazlet-info" style="line-height:120%; margin-bottom: 10px">
<div class="amazlet-name" style="margin-bottom:10px;line-height:120%"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4522479557/maruguu-22/ref=nosim/" name="amazletlink" target="_blank">KAKEIBO家計ぼセット</a>
<div class="amazlet-powered-date" style="font-size:80%;margin-top:5px;line-height:120%">posted with <a href="http://www.amazlet.com/browse/ASIN/4522479557/maruguu-22/ref=nosim/" title="KAKEIBO家計ぼセット" target="_blank">amazlet</a> at 10.12.18</div>
</div>
<div class="amazlet-detail">永岡書店 <br />売り上げランキング: 29154</div>
<div class="amazlet-sub-info" style="float: left;">
<div class="amazlet-link" style="margin-top: 5px"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4522479557/maruguu-22/ref=nosim/" name="amazletlink" target="_blank">Amazon.co.jp で詳細を見る</a></div>
</div>
</div>
<div class="amazlet-footer" style="clear: left"></div>
</div>
<p>予算を立てて種類別に記録できたのはよかったけど、計算が面倒だとか、すぐに記録できないといったところで、イライラがたまっていたのでiアプリで作ってみました。</p>
<p><a href="http://blog.tomatomax.net/ikakeibo">i家計簿 &#8211; ケータイ(iアプリ)用家計簿ソフト</a></p>
<p>まだベータ版程度のものですが、iアプリを使える方は試してみてください。</p>
<p>本当はCSVファイルか何かに書き出してケータイ内のドキュメントビューワーで見れたらいいなとか思ってたんですが、そういう経路は用意されていなかった＞＜。外部サーバー連携すれば可能なのかもしれないけど、それをやると来年の家計簿として使えそうにもないので、ナシの方向で。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2773/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2773" />
	</item>
		<item>
		<title>twigadge ver2.0 beta2</title>
		<link>http://blog.tomatomax.net/archives/2715</link>
		<comments>http://blog.tomatomax.net/archives/2715#comments</comments>
		<pubDate>Sun, 30 May 2010 08:32:33 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2715</guid>
		<description><![CDATA[先日OAuth対応版をリリースしましたが、もうひとつ大きな機能追加を入れましたのでbeta2としてリリースします。 追加した機能ですが、上のスクリーンショットのとおり、黒い外観に変更できるようになりました。 また、リツイ [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.tomatomax.net/wp-content/uploads/2010/05/twigadge-ss-2.0.png" title="twigadge-ss-2.0" width="493" height="214" class="alignnone size-full wp-image-2716" /></p>
<p>先日OAuth対応版をリリースしましたが、もうひとつ大きな機能追加を入れましたのでbeta2としてリリースします。<br />
追加した機能ですが、上のスクリーンショットのとおり、黒い外観に変更できるようになりました。<br />
また、リツイート(公式RT)機能に対応しています。</p>
<p>変更点:</p>
<ul>
<li>スキン機能追加(あわせて黒系スキン追加)</li>
<li>リツイート(公式RT)機能追加</li>
<li>バグ修正</li>
</ul>
<p><a href="http://code.google.com/p/twigadge/">ダウンロードページ</a><br />
<a href="http://code.google.com/p/twigadge/wiki/Usage_ja">利用方法</a></p>
<p>もう少し様子を見て、問題なければ正式リリースしたいと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2715/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2715" />
	</item>
		<item>
		<title>TwitterクライアントのOAuth対応(Javascript編)</title>
		<link>http://blog.tomatomax.net/archives/2696</link>
		<comments>http://blog.tomatomax.net/archives/2696#comments</comments>
		<pubDate>Sun, 16 May 2010 04:02:24 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2696</guid>
		<description><![CDATA[6月にBasic認証が廃止されるということで、twitterクライアントのOAuth対応が必須となっています。twigadgeの方でもversion2.xとして対応しているわけですが、いろいろ資料を探してもJavascr [...]]]></description>
			<content:encoded><![CDATA[<p>6月にBasic認証が廃止されるということで、twitterクライアントのOAuth対応が必須となっています。twigadgeの方でもversion2.xとして対応しているわけですが、いろいろ資料を探してもJavascriptでの実装例をあまり見かけなかったので、メモとして残しておきます。<br />
基本的な流れは<a href="http://techno-st.net/2009/11/26/twitter-api-oauth-0.html">Twitter API を OAuth で認証するスクリプトを 0 から書いてみた</a>の通りなので、ここではコードの解説を主に書いていきます。</p>
<h2>使用ライブラリ</h2>
<p><a href="http://code.google.com/p/oauth/">Google CodeのOAuthライブラリ</a><br />
# javascriptのものはSource-&gt;Browse以下に置いてあります。</p>
<p><a href="http://jquery.com/">JQuery</a><br />
# ここで使っているのはAjax送信部分だけです。</p>
<h2>認証手順</h2>
<ol>
<li>Twitterでアプリケーション申請をして、Consumer Key/Consumer Secretを発行してもらう (ここでは省略)</li>
<li>Request Token/Request Token Secretを取得する</li>
<li>ユーザをTwitterに誘導してPINを取得してもらう</li>
<li>Request Token/Request Token SecretとPINを元にAccess Token/Access Token Sceretを取得する</li>
<li>Access Token/Access Token Secretを元にAPIにアクセスする</li>
</ol>
<h4>Request Token/Request Token Secretを取得する</h4>
<p>まず、http://twitter.com/oauth/request_tokenにConsumer Keyを送ります。<br />
他のパラメータとして、oauth_signature_methodはHMAC-SHA1、時刻とNonceはOAuth.setTimestampAndNonceで設定しています。パラメータを設定後、OAuth.SignatureMethod.signでConsumer Secretを使って署名を加えた後、OAuth.addToURLでURLにパラメータを付加し、そこにアクセスしています。パラメータのソートはライブラリがやってくれているので気にする必要はありません。どのAPIに対するアクセスも基本的には同じで、送るパラメータ、署名のkeyが変わるだけとなります。</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; TwitterAPI.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">getRequestToken</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> accessor <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; consumerSecret<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">consumer</span>.<span style="color: #660066;">consumerSecret</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; tokenSecret<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> message <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; method<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; action<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://twitter.com/oauth/request_token&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; parameters<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_signature_method<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;HMAC-SHA1&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_consumer_key<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">consumer</span>.<span style="color: #660066;">consumerKey</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; OAuth.<span style="color: #660066;">setTimestampAndNonce</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; OAuth.<span style="color: #660066;">SignatureMethod</span>.<span style="color: #660066;">sign</span><span style="color: #009900;">&#40;</span>message<span style="color: #339933;">,</span> accessor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> target <span style="color: #339933;">=</span> OAuth.<span style="color: #660066;">addToURL</span><span style="color: #009900;">&#40;</span>message.<span style="color: #660066;">action</span><span style="color: #339933;">,</span> message.<span style="color: #660066;">parameters</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; type<span style="color: #339933;">:</span> message.<span style="color: #660066;">method</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; url<span style="color: #339933;">:</span> target<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> dt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">/* 返り値からRequest Token/Request Token Secretを取り出して、PINを取得するためのURLを作成 */</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 送信</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
<h4>Access Token/Access Token Sceretを取得する</h4>
<p>見て分かる通り、Request Token取得のコードとほとんど同じです。異なる点は以下になります</p>
<ul>
<li>API&#8221;http://twitter.com/oauth/access_token&#8221;変更</li>
<li>署名のkeyがConsumer Secret＆Request Token Secretになる</li>
<li>パラメータoauth_tokenとしてRequest Tokenを送る</li>
<li>パラメータoauth_verifierとしてユーザが入力したPINを送る</li>
</ul>
<p>取得したAccess Token / Access Token Secretをクライアントで保存しておけば、再度取得する必要はありません。</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; TwitterAPI.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">getAccessToken</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>pin<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> accessor <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; consumerSecret<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">consumer</span>.<span style="color: #660066;">consumerSecret</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; tokenSecret<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">token_secret</span> <span style="color: #006600; font-style: italic;">// Request Token Secret</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> message <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; method<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; action<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://twitter.com/oauth/access_token&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; parameters<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_signature_method<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;HMAC-SHA1&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_consumer_key<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">consumer</span>.<span style="color: #660066;">consumerKey</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_token<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">token</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// Request Token</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_verifier<span style="color: #339933;">:</span> pin<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; OAuth.<span style="color: #660066;">setTimestampAndNonce</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; OAuth.<span style="color: #660066;">SignatureMethod</span>.<span style="color: #660066;">sign</span><span style="color: #009900;">&#40;</span>message<span style="color: #339933;">,</span> accessor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> target <span style="color: #339933;">=</span> OAuth.<span style="color: #660066;">addToURL</span><span style="color: #009900;">&#40;</span>message.<span style="color: #660066;">action</span><span style="color: #339933;">,</span> message.<span style="color: #660066;">parameters</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; type<span style="color: #339933;">:</span> message.<span style="color: #660066;">method</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; url<span style="color: #339933;">:</span> target<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> dt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">/* 返り値からAccess Token/Access Token Secretを取り出す */</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 送信</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
<h4>GET/POSTを行う</h4>
<p>Access Token / Access Token Secretを取得したら、それを使ってAPIにアクセスします。以下の点が変わります</p>
<ul>
<li>署名のkeyがConsumer Secret＆Access Token Secretになる</li>
<li>パラメータoauth_tokenとしてAccess Tokenを送る</li>
<li>送信データ全てを含めて署名をつける</li>
</ul>
<p>下のコードがTweetを送信している部分になります。</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; TwitterAPI.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">post</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>api<span style="color: #339933;">,</span> content<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> accessor <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; consumerSecret<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">consumer</span>.<span style="color: #660066;">consumerSecret</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; tokenSecret<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">atoken_secret</span> <span style="color: #006600; font-style: italic;">// Access Token Secret</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> message <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; method<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; action<span style="color: #339933;">:</span> api<span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; parameters<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_signature_method<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;HMAC-SHA1&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_consumer_key<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">consumer</span>.<span style="color: #660066;">consumerKey</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; oauth_token<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">atoken</span> <span style="color: #006600; font-style: italic;">// Access Token</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// 送信するデータをパラメータに追加する</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> key <span style="color: #000066; font-weight: bold;">in</span> content <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; message.<span style="color: #660066;">parameters</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> content<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; OAuth.<span style="color: #660066;">setTimestampAndNonce</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; OAuth.<span style="color: #660066;">SignatureMethod</span>.<span style="color: #660066;">sign</span><span style="color: #009900;">&#40;</span>message<span style="color: #339933;">,</span> accessor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> target <span style="color: #339933;">=</span> OAuth.<span style="color: #660066;">addToURL</span><span style="color: #009900;">&#40;</span>message.<span style="color: #660066;">action</span><span style="color: #339933;">,</span> message.<span style="color: #660066;">parameters</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; type<span style="color: #339933;">:</span> message.<span style="color: #660066;">method</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; url<span style="color: #339933;">:</span> target<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; dataType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'json'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> dt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> callback<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> dt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 送信</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <br />
&nbsp; <span style="color: #006600; font-style: italic;">// (中略)</span><br />
&nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* update the status of user<br />
&nbsp; &nbsp; &nbsp;* @param[in] uptext - user status to update<br />
&nbsp; &nbsp; &nbsp;* @param[in] reply_to - target status id for reply<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; updateStatus<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>uptext<span style="color: #339933;">,</span> reply_to<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #000066;">status</span><span style="color: #339933;">:</span> uptext<span style="color: #339933;">,</span> source<span style="color: #339933;">:</span> <span style="color: #3366CC;">'twigadge'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>reply_to <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; content.<span style="color: #660066;">in_reply_to_status_id</span> <span style="color: #339933;">=</span> reply_to<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; twitterapi.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://twitter.com/statuses/update.json'</span><span style="color: #339933;">,</span> content<span style="color: #339933;">,</span> Twigadge.<span style="color: #660066;">dummy</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; System.<span style="color: #660066;">Gadget</span>.<span style="color: #660066;">Flyout</span>.<span style="color: #660066;">show</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2696/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2696" />
	</item>
		<item>
		<title>twigadge ver2.0 beta</title>
		<link>http://blog.tomatomax.net/archives/2692</link>
		<comments>http://blog.tomatomax.net/archives/2692#comments</comments>
		<pubDate>Sun, 09 May 2010 10:41:17 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2692</guid>
		<description><![CDATA[TwitterのBasic認証廃止ということで、OAuthに対応したものを作成しました。それと同時にライブラリもようやくJQueryに変更、UI周りのコードも一新したのでとりあえずベータ版として公開です。Basic認証完 [...]]]></description>
			<content:encoded><![CDATA[<p>TwitterのBasic認証廃止ということで、OAuthに対応したものを作成しました。それと同時にライブラリもようやくJQueryに変更、UI周りのコードも一新したのでとりあえずベータ版として公開です。Basic認証完全廃止までには正式リリースしたいところ。<br />
主な変更点</p>
<ul>
<li>OAuth対応</li>
<li>タイムライン取得API変更 Friend→Home Reply→Mentions</li>
<li>Flyout表示時のボタンアイコン追加</li>
<li>Reply/DM表示時に毎回取得をするように変更</li>
<li>ハッシュタグ正規表現変更</li>
</ul>
<p><a href="http://code.google.com/p/twigadge/">ダウンロードページ</a><br />
あと、地味な変更点ですがfrom twigadgeのところのリンク先が今のブログに変更されてます。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2692/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2692" />
	</item>
		<item>
		<title>twigadge ver1.2</title>
		<link>http://blog.tomatomax.net/archives/2612</link>
		<comments>http://blog.tomatomax.net/archives/2612#comments</comments>
		<pubDate>Sun, 23 Aug 2009 08:33:25 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Program]]></category>
		<category><![CDATA[sidebar gadget]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2612</guid>
		<description><![CDATA[http://code.google.com/p/twigadge/ ようやくRT機能を実装しました Reply時にin-reply-to設定を追加 RT機能を追加 幅/高さが範囲外のとき、自動で変更されるように修正]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/twigadge/">http://code.google.com/p/twigadge/</a><br />
ようやくRT機能を実装しました</p>
<ul>
<li>Reply時にin-reply-to設定を追加</li>
<li>RT機能を追加</li>
<li>幅/高さが範囲外のとき、自動で変更されるように修正</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2612/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2612" />
	</item>
		<item>
		<title>はてブのお気に入りユーザを隠すスクリプトを更新</title>
		<link>http://blog.tomatomax.net/archives/2606</link>
		<comments>http://blog.tomatomax.net/archives/2606#comments</comments>
		<pubDate>Wed, 05 Aug 2009 04:41:04 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2606</guid>
		<description><![CDATA[以前書いた、はてブのお気に入りページで、ユーザコメントを隠すGreaseMonkeyスクリプトの更新をしました。今回の変更で、はてブのAutoPagerize機能で継ぎ足されたページに対してもスクリプトが有効になるように [...]]]></description>
			<content:encoded><![CDATA[<p>以前書いた、はてブのお気に入りページで、ユーザコメントを隠すGreaseMonkeyスクリプトの更新をしました。今回の変更で、はてブのAutoPagerize機能で継ぎ足されたページに対してもスクリプトが有効になるようになっています。</p>
<p>ダウンロードは<br />
<a href="http://userscripts.org/scripts/show/43057">userscript.org</a>から</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2606/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2606" />
	</item>
		<item>
		<title>twigadge ver1.1.1</title>
		<link>http://blog.tomatomax.net/archives/2575</link>
		<comments>http://blog.tomatomax.net/archives/2575#comments</comments>
		<pubDate>Mon, 11 May 2009 11:33:42 +0000</pubDate>
		<dc:creator>maruguu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Program]]></category>

		<guid isPermaLink="false">http://blog.tomatomax.net/?p=2575</guid>
		<description><![CDATA[http://code.google.com/p/twigadge/ Issueリストに登録された問題の修正 POSTを使ったタイムライン取得機能を削除]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/twigadge/">http://code.google.com/p/twigadge/</a><br />
Issueリストに登録された問題の修正</p>
<ul>
<li>POSTを使ったタイムライン取得機能を削除</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomatomax.net/archives/2575/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.tomatomax.net/archives/2575" />
	</item>
	</channel>
</rss>

