<?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>Twitter | You Look Too Cool</title>
	<atom:link href="https://stabucky.com/wp/archives/category/digital/twitter/feed" rel="self" type="application/rss+xml" />
	<link>https://stabucky.com/wp</link>
	<description>ゆるくつくる stabuckyのブログ</description>
	<lastBuildDate>Tue, 20 Jan 2026 11:43:10 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://stabucky.com/wp/wp-content/uploads/2024/05/cropped-stabucky-32x32.png</url>
	<title>Twitter | You Look Too Cool</title>
	<link>https://stabucky.com/wp</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>X(旧Twitter)で自分が「いいね」をしたポスト(ツイート)を見る方法</title>
		<link>https://stabucky.com/wp/archives/11606</link>
					<comments>https://stabucky.com/wp/archives/11606#comments</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Mon, 08 Oct 2018 00:15:57 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">https://stabucky.com/wp/?p=11606</guid>

					<description><![CDATA[X(旧Twitter)にはポスト(ツイート)に「いいね」をすることができます。以前は「お気に入り」だったような気がします。 最近、いくつかのポスト(ツイート)に「いいね」をしたのですが、それを見返そうと思ったところ、方法 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>X(旧Twitter)にはポスト(ツイート)に「いいね」をすることができます。以前は「お気に入り」だったような気がします。<br />
最近、いくつかのポスト(ツイート)に「いいね」をしたのですが、それを見返そうと思ったところ、方法が分かりません。<br />
ようやくその方法を見つけたのでメモしておきます。<span id="more-11606"></span></p>
<p>左の「プロフィール」をクリックします。<br />
<img fetchpriority="high" decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2018/10/a.png" alt="" width="500" height="341" class="alignnone size-full wp-image-14879" /></p>
<p>「いいね」をクリックします。<br />
<img decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2018/10/b.png" alt="" width="500" height="341" class="alignnone size-full wp-image-14880" /></p>
<p>下に表示されます。<br />
<img decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2018/10/c.png" alt="" width="500" height="412" class="alignnone size-full wp-image-14881" /></p>
<p>「なぜ他人のポスト(ツイート)を見るのに(自分の)「プロフィール」から辿るんだ！」と詰問したいところです。</p>
<p>2022年4月3日追記<br />
少し変わったので書き直しました。</p>
<p>2024年8月18日追記<br />
「X(旧Twitter)」「ポスト(ツイート)」に書き直しました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/11606/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Twitterのbotが停止された</title>
		<link>https://stabucky.com/wp/archives/11143</link>
					<comments>https://stabucky.com/wp/archives/11143#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Sat, 04 Aug 2018 23:06:29 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[bot]]></category>
		<guid isPermaLink="false">https://stabucky.com/wp/?p=11143</guid>

					<description><![CDATA[私は自作のTwitterボットを動かしていたのですが停止されてしまいました。利用規約に反しているとのことのようです。メールが届いていました。 This is a notice that your application, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>私は<a href="https://stabucky.com/wp/archives/2031">自作のTwitterボット</a>を動かしていたのですが停止されてしまいました。利用規約に反しているとのことのようです。メールが届いていました。<span id="more-11143"></span></p>
<blockquote><p>This is a notice that your application, stabot, is no longer allowed to perform write operations.</p></blockquote>
<p>Googleで翻訳すると「これは、アプリケーションであるstabotが書き込み操作を実行できなくなったという通知です。」ということでした。<br />
確かに8月1日を最後にツイートが止まっています。<br />
最近は放置していたのでこれを機会にcronを停止しました。</p>
<p><img loading="lazy" decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2018/08/twitterlogo.png" alt="" width="400" height="400" class="img-responsive" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/11143/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>私のハッシュタグ使用数トップ20</title>
		<link>https://stabucky.com/wp/archives/5147</link>
					<comments>https://stabucky.com/wp/archives/5147#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Sun, 28 Apr 2013 09:26:03 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[ハッシュタグ]]></category>
		<category><![CDATA[一覧]]></category>
		<category><![CDATA[単語登録]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=5147</guid>

					<description><![CDATA[私はTwitterを2008年1月からやっています。 よく使うハッシュタグは何だろうと思い、調べてみました。 順位 ハッシュタグ 回数 1 #chibalotte 554 2 #twinomi 549 3 #chishi [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>私はTwitterを2008年1月からやっています。<br />
よく使うハッシュタグは何だろうと思い、調べてみました。<span id="more-5147"></span></p>
<table class="table">
<tr>
<th>順位</th>
<th>ハッシュタグ</th>
<th>回数</th>
</tr>
<tr>
<td>1</td>
<td>#chibalotte</td>
<td>554</td>
</tr>
<tr>
<td>2</td>
<td>#twinomi</td>
<td>549</td>
</tr>
<tr>
<td>3</td>
<td>#chishiki</td>
<td>149</td>
</tr>
<tr>
<td>4</td>
<td>#fujitv</td>
<td>95</td>
</tr>
<tr>
<td>5</td>
<td>#ntv</td>
<td>88</td>
</tr>
<tr>
<td>6</td>
<td>#npb</td>
<td>76</td>
</tr>
<tr>
<td>7</td>
<td>#tbs</td>
<td>66</td>
</tr>
<tr>
<td>8</td>
<td>#nowplaying</td>
<td>64</td>
</tr>
<tr>
<td>9</td>
<td>#wbc</td>
<td>60</td>
</tr>
<tr>
<td>10</td>
<td>#mh3g</td>
<td>56</td>
</tr>
<tr>
<td>11</td>
<td>#tvasahi</td>
<td>54</td>
</tr>
<tr>
<td>12</td>
<td>#FNN</td>
<td>52</td>
</tr>
<tr>
<td>13</td>
<td>#nhk_news</td>
<td>42</td>
</tr>
<tr>
<td>14</td>
<td>#3ds</td>
<td>38</td>
</tr>
<tr>
<td>14</td>
<td>#nadeshiko</td>
<td>38</td>
</tr>
<tr>
<td>16</td>
<td>#marines</td>
<td>33</td>
</tr>
<tr>
<td>17</td>
<td>#daihyo</td>
<td>27</td>
</tr>
<tr>
<td>18</td>
<td>#tvtokyo</td>
<td>24</td>
</tr>
<tr>
<td>19</td>
<td>#jefunited</td>
<td>23</td>
</tr>
<tr>
<td>20</td>
<td>#senbatsu</td>
<td>22</td>
</tr>
</table>
<p>上位20個です。1位は野球中継を見ながら、2位は飲みながら、3位は<a href="http://stabucky.com/tw/tw.php?q=%23chishiki" title="豆知識">豆知識</a>です。<br />
あとはテレビを見ながら、と、ニュース系のリツイートが多いようです。<br />
これらを単語登録しようと思っています。「たぐ」か何かで変換されるように。</p>
<p><img loading="lazy" decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2018/10/twitter_logo.png" alt="" width="300" height="300" class="alignnone size-full wp-image-11632" srcset="https://stabucky.com/wp/wp-content/uploads/2018/10/twitter_logo.png 300w, https://stabucky.com/wp/wp-content/uploads/2018/10/twitter_logo-150x150.png 150w" sizes="(max-width: 300px) 100vw, 300px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/5147/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHPでTwitterAPIを使う「codebird」</title>
		<link>https://stabucky.com/wp/archives/4870</link>
					<comments>https://stabucky.com/wp/archives/4870#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Sat, 23 Feb 2013 23:29:38 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=4870</guid>

					<description><![CDATA[TwitterAPIは1.1に切り替えられます。2013年3月5日にブラックアウトテストが行われ、古いAPIだとエラーになるそうです。 PHPでTwitterAPI1.1を使うためのプログラムを紹介します。 mynetx [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>TwitterAPIは1.1に切り替えられます。2013年3月5日にブラックアウトテストが行われ、古いAPIだとエラーになるそうです。</p>
<p>PHPでTwitterAPI1.1を使うためのプログラムを紹介します。<span id="more-4870"></span><br />
<a rel="noopener" href="https://github.com/mynetx/codebird-php" target="_blank">mynetx/codebird-php · GitHub</a></p>
<h3>サンプル</h3>
<div class="codecolorer-container php dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;height:400px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #666666; font-style: italic;">//カスタマーキー等の設定</span><br />
<span style="color: #000088;">$consumer_key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;{自分のConsumer key}&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$consumer_secret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;{自分のConsumer secret}&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$access_token</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;{自分のAccess token}&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$access_token_secret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;{自分のAccess token secret}&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//準備</span><br />
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;codebird.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Codebird<span style="color: #339933;">::</span><span style="color: #004000;">setConsumerKey</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$consumer_key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$consumer_secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$cb</span> <span style="color: #339933;">=</span> Codebird<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$cb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setToken</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$access_token</span><span style="color: #339933;">,</span> <span style="color: #000088;">$access_token_secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//パラメータ</span><br />
<span style="color: #000088;">$params</span><span style="color: #339933;">=</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'screen_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'{取得したいユーザーのscreen name}'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'count'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">10</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//取得</span><br />
<span style="color: #000088;">$tweets</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$cb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">statuses_userTimeline</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/array_pop"><span style="color: #990000;">array_pop</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweets</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//最後の1件はステータスコードなので削除。</span><br />
<span style="color: #666666; font-style: italic;">//出力</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweets</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;p&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">text</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>ツイートを取得するためのサンプルです。<br />
カスタマーキーは自分のものを使います。<br />
パラメータを配列で作って取得するという流れです。ここでは指定したユーザーのツイートを10件取得します。</p>
<p>TwitterAPIの公式ページは「<a rel="noopener" href="https://dev.twitter.com/rest/public" target="_blank">REST APIs — Twitter Developers</a>」です。<br />
パラメータの設定方法はここに詳しく書かれています。<br />
APIメソッドをCodebirdの関数に置き換えるには、スラッシュをアンダースコアに、単語の切れ目を大文字に(キャメルケース)、置き換えます。</p>
<table class="table">
<tr>
<th>APIメソッド</th>
<th>Codebirdの関数</th>
</tr>
<tr>
<td>statuses/update</td>
<td>statuses_update()</td>
</tr>
<tr>
<td>statuses/home_usertimeline</td>
<td>statuses_userTimeline()</td>
</tr>
</table>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/4870/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>TwitterAPIの投稿用のURL</title>
		<link>https://stabucky.com/wp/archives/4550</link>
					<comments>https://stabucky.com/wp/archives/4550#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Sun, 21 Oct 2012 08:08:13 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[仕様]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=4550</guid>

					<description><![CDATA[PHPを使い、Twitterのボットを作って動かしているのですが(ヒナ先輩)、今朝の午前4時頃に突然、動かなくなりました。 調べるとプログラムにはおかしな部分はなく、どうやら投稿をポストしたときにエラーが起きている様子。 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>PHPを使い、Twitterのボットを作って動かしているのですが(<a rel="noopener" href="https://twitter.com/stabot" target="_blank">ヒナ先輩</a>)、今朝の午前4時頃に突然、動かなくなりました。<br />
調べるとプログラムにはおかしな部分はなく、どうやら投稿をポストしたときにエラーが起きている様子。<br />
となるとTwitter側の仕様変更が考えられます。</p>
<p>結論を書くと次の通り。<span id="more-4550"></span></p>
<p>変更前「https://<strong>twitter.com</strong>/statuses/update.xml」<br />
変更後「http://<strong>api.twitter.com/1</strong>/statuses/update.xml」</p>
<p>変更前のURLが無効になったようです。私は随分、古いAPI、仕様を使っていた様子。<br />
ここを修正したら、あっさり動きました。</p>
<p><img loading="lazy" decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2018/08/twitterlogo.png" alt="" width="400" height="400" class="alignnone size-full wp-image-11144" srcset="https://stabucky.com/wp/wp-content/uploads/2018/08/twitterlogo.png 400w, https://stabucky.com/wp/wp-content/uploads/2018/08/twitterlogo-150x150.png 150w" sizes="(max-width: 400px) 100vw, 400px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/4550/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>飲酒カレンダー</title>
		<link>https://stabucky.com/wp/archives/3689</link>
					<comments>https://stabucky.com/wp/archives/3689#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Tue, 10 Jan 2012 14:00:52 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[カレンダー]]></category>
		<category><![CDATA[スタニッキ]]></category>
		<category><![CDATA[飲酒]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=3689</guid>

					<description><![CDATA[私の飲酒の状況を表示する「飲酒カレンダー」を作ってみました。 Twitterで「アルコール」や「#twinomi」という文字列を含むツイートを抽出して整形しています。 飲酒カレンダー 今年はアルコールを控えるつもりでした [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>私の飲酒の状況を表示する「飲酒カレンダー」を作ってみました。<br />
Twitterで「アルコール」や「#twinomi」という文字列を含むツイートを抽出して整形しています。</p>
<p><a href="http://stabucky.com/tw/tw.php?d=a">飲酒カレンダー</a></p>
<p>今年はアルコールを控えるつもりでしたが、10日間のうち7日も飲んでいました。元日は前日の飲み過ぎで倒れていましたし、2日は車の運転をするため我慢。実質、1日しか休んでいません。</p>
<p><iframe src="http://rcm-jp.amazon.co.jp/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=saigohaundesu-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=484540706X" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe><br />
「禁煙セラピー」は効果があったそうですが。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/3689/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>jQueryでTwitterAPIを使う簡単なサンプル</title>
		<link>https://stabucky.com/wp/archives/2654</link>
					<comments>https://stabucky.com/wp/archives/2654#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 13:00:39 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[getJSON]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[TwitterAPI]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=2654</guid>

					<description><![CDATA[TwitterAPIを使うと自分のツイートなどが簡単に取得できます。 またjQueryを使うとこれをブラウザに簡単に表示できます。 そのための最低限のサンプルを紹介します。 HTML HTMLは次のようにします。 div [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>TwitterAPIを使うと自分のツイートなどが簡単に取得できます。<br />
またjQueryを使うとこれをブラウザに簡単に表示できます。<br />
そのための最低限のサンプルを紹介します。<span id="more-2654"></span></p>
<h3><span id="toc1">HTML</span></h3>
<p>HTMLは次のようにします。<br />
divでもpでも何でもよいのですが行数を数えるためにolにしました。</p>
<div class="codecolorer-container html4strict dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ol.html"><span style="color: #000000; font-weight: bold;">ol</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myol&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ol.html"><span style="color: #000000; font-weight: bold;">ol</span></a>&gt;</span></div></div>
<h3><span id="toc2">JavaScript</span></h3>
<p>jQueryを使っているという前提です。<br />
getJSONを使うと簡単にツイートを取得できます。idは私のものです。<br />
getJSONは取得したツイートを配列「data」に格納します。<br />
eachは配列から一つずつ取り出して「item」に格納します。<br />
ツイートは「item.text」で取得できます。<br />
「item.created_at」とするとツイート時刻です。</p>
<div class="codecolorer-container javascript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://api.twitter.com/1/statuses/user_timeline.json?callback=?&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;stabucky&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; <span style="color: #3366CC;">&quot;count&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> status<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; $.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> item<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#myol&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&quot;</span> <span style="color: #339933;">+</span> item.<span style="color: #660066;">text</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<div class="alert alert-warning" role="alert">この記事は情報が古く、正しく動作しません。(2018年10月8日)</div>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/2654/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Twitter APIを使い、JSON形式でツイートを取得</title>
		<link>https://stabucky.com/wp/archives/2645</link>
					<comments>https://stabucky.com/wp/archives/2645#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Thu, 14 Apr 2011 15:32:19 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[TwitterAPI]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=2645</guid>

					<description><![CDATA[Twitter APIについて調べたので、メモ的に書いておきます。 URLとして「http://api.twitter.com/1/statuses/user_timeline/stabucky.json?count=1 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Twitter APIについて調べたので、メモ的に書いておきます。<br />
URLとして「http://api.twitter.com/1/statuses/user_timeline/stabucky.json?count=1」を指定すると次のようにJSON形式で戻ってきます。<br />
つまり直近1回分のツイートの内容を示しています。<span id="more-2645"></span></p>
<div class="codecolorer-container javascript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;height:400px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">［<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;favorited&quot;</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: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\u</span>300c<span style="color: #000099; font-weight: bold;">\u</span>6c17<span style="color: #000099; font-weight: bold;">\u</span>4ed9&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;retweet_count&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;coordinates&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;in_reply_to_screen_name&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;in_reply_to_status_id_str&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;place&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;in_reply_to_status_id&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;contributors&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;geo&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;retweeted&quot;</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: #3366CC;">&quot;source&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>アプリケーション<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;created_at&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Thu Apr 14 11:51:40 +0000 2011&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;in_reply_to_user_id_str&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;in_reply_to_user_id&quot;</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;user&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>省略<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;truncated&quot;</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: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">58497645043392512</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;id_str&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;58497645043392512&quot;</span><br />
<span style="color: #009900;">&#125;</span>］</div></div>
<h3><span id="toc1">text</span></h3>
<p>ツイートの内容です。<br />
「\u300c」のように文字化けしているように見えますが、これはエンコードされているだけで、ブラウザに表示すると「気」と正しく表示されます。</p>
<h3><span id="toc2">sourse</span></h3>
<p>省略しました。<br />
ツイートしたときのアプリケーションが表示されます。</p>
<h3><span id="toc3">created_at</span></h3>
<p>ツイートしたときの時刻です。</p>
<h3><span id="toc4">user</span></h3>
<p>省略しました。<br />
ユーザーの名前などの情報が表示されます。<br />
ツイートするたびに同じ情報が表示されます。<br />
上の例ではcount=1なので1回だけですが、count=100とすると、その時点のユーザー情報について同じものを100回返してきます。</p>
<h3><span id="toc5">id、id_str</span></h3>
<p>そのツイートを指す、ユニークな(唯一の)番号です。<br />
idもid_strも同じものですが、idは数値、id_strは文字列になっています。<br />
JavaScriptなどのプログラムでidの数値が大きすぎて丸められてしまうケースがあります。その場合はid_strを使うとうまくいく場合があります。文字列なので丸められません。</p>
<div class="alert alert-warning" role="alert">この記事は情報が古く、正しく動作しません。(2018年10月8日)</div>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/2645/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>一括してアンフォロー</title>
		<link>https://stabucky.com/wp/archives/2503</link>
					<comments>https://stabucky.com/wp/archives/2503#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Sat, 19 Mar 2011 08:49:21 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=2503</guid>

					<description><![CDATA[私はTwitterのbotをやっています。 東日本大震災が起きてからbotを止めていたのですが、1週間経ったので再開しました。 このbotは自分からフォローすることはありませんが「#followme」などのタグを付けてい [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>私はTwitterのbotをやっています。<br />
東日本大震災が起きてからbotを止めていたのですが、1週間経ったので再開しました。<br />
このbotは自分からフォローすることはありませんが「#followme」などのタグを付けているのでフォローされることがあります。<br />
この場合、必ず自動的にフォロー返しする仕組みになっています。<br />
しばらくするとアンフォローされていることがあります。この場合、botから自動的にアンフォローするような仕組みにはなっていません。<br />
先ほど確認したところ、約5000フォローに対して約4600フォロワーとなっていました。つまり約400アカウントはアンフォローされたままになっています。<br />
これらのアカウントを一括してアンフォローすることにしました。<span id="more-2503"></span></p>
<p>そこで使ったのが次のウェブサイト。</p>
<p>ManageFlitter &#8211; Fast &amp; Easy Unfollowing for Twitter(リンク切れ)</p>
<p>ログインするとフォロー状況を調べてくれます。<br />
Not Following Backを見ると、アンフォローされたままになっているアカウントが表示されます。<br />
これら全てにチェックを入れて「Unfollow 100 Selected」をクリックします(100個選択した場合)。<br />
しばらくするとアンフォローしてくれます。<br />
まだアカウントがまだ表示されているので、未練がある場合は、ここで元に戻すこともできます。<br />
未練がない場合には「Clear 100 Unffollowed」をクリックするとアカウントが消えます。</p>
<p>他にも最近ツイートしていないアカウントなどを調べることができますので便利です。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/2503/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Twitterのidを取得するときは「id_str」</title>
		<link>https://stabucky.com/wp/archives/2091</link>
					<comments>https://stabucky.com/wp/archives/2091#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Mon, 15 Nov 2010 12:23:43 +0000</pubDate>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[TwitterAPI]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=2091</guid>

					<description><![CDATA[Twitterの自分のツイートを記録してブログ風に表示できるページを作っています。 スタニッキ TwitterのAPIを使い、JSON形式で取得し、PHPでMySQLに保存します。 最近、これが正しく動作しなくなりました [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Twitterの自分のツイートを記録してブログ風に表示できるページを作っています。</p>
<p><a href="http://stabucky.com/tw/tw.php">スタニッキ</a></p>
<p>TwitterのAPIを使い、JSON形式で取得し、PHPでMySQLに保存します。<br />
最近、これが正しく動作しなくなりました。<br />
Twitterは各ツイートにidが付けられていますが、このidが桁落ちします。Twitterのidは16桁あるのですが、私のプログラムでは有効なのは上12桁だけで下4桁が「0000」になってしまいます。<span id="more-2091"></span></p>
<p><img loading="lazy" decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2009/09/bird_aoitori_bluebird.png" alt="bird_aoitori_bluebird" width="200" height="181" class="img-responsive" /></p>
<p>原因を探ってみると、最近、Twitterの仕様が変わったようです。<br />
idが11月4日までは11桁だったのが5日に15桁に増え、7日には16桁になっています。<br />
11月5日に仕様の変更があったようです。</p>
<p>PHPでは、変数に数値を代入したときに自動的に丸めてしまいます。これが原因だと思われます。このようなときは数値(整数)ではなく文字列で処理すればよいのですが、TwitterのAPI(JSON形式)では「&#8221;id&#8221;:123456789」となっていて、PHPでは数値として読み込んでしまいます。</p>
<p>強制的に文字列として読み込む方法を模索したのですが、うまくいきません。<br />
しかし簡単な解決方法がありました。<br />
今回の仕様の変更に伴い、APIの仕様も変わっていたようです。<br />
「id」の他に「id_str」という項目が新設されていました。</p>
<p>&#8220;id&#8221;:123456789<br />
&#8220;id<strong>_str</strong>&#8220;:&#8221;123456789&#8221;</p>
<p>このように値は一致しますが型が異なります。<br />
PHPのコードの「id」を「id_str」に置き換えるだけで正しく動作するようになりました。<br />
「in_reply_to_status_id<strong>_str</strong>」、「in_reply_to_user_id<strong>_str</strong>」も同様です。</p>
<p>11月5日以降に取得した内容が間違っていたので、これらを削除し、再度、実行したところ、正しく取得することができました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/2091/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
