<?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>餅空blog WordPress支店 &#187; Greasemonkey</title>
	<atom:link href="http://wordpress.mochy.com/tag/greasemonkey/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordpress.mochy.com</link>
	<description>PC、プログラム、ネットの事などを少しずつ綴ってみる</description>
	<lastBuildDate>Tue, 26 Jan 2010 20:36:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AmazonプライムだとAmazon Short URIが機能しない→解決</title>
		<link>http://wordpress.mochy.com/2008/06/amazon%e3%83%97%e3%83%a9%e3%82%a4%e3%83%a0%e3%81%a0%e3%81%a8amazon-short-uri%e3%81%8c%e6%a9%9f%e8%83%bd%e3%81%97%e3%81%aa%e3%81%84/</link>
		<comments>http://wordpress.mochy.com/2008/06/amazon%e3%83%97%e3%83%a9%e3%82%a4%e3%83%a0%e3%81%a0%e3%81%a8amazon-short-uri%e3%81%8c%e6%a9%9f%e8%83%bd%e3%81%97%e3%81%aa%e3%81%84/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 16:01:46 +0000</pubDate>
		<dc:creator>mochy</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Amazon]]></category>

		<guid isPermaLink="false">http://wordpress.mochy.com/?p=81</guid>
		<description><![CDATA[SEOのためかどうか知らないけどAmazonの長いURLが鬱陶しいので、グリモンの以下のスクリプトを入れてみた。
狐の王国 AmazonのURLを短くするAmazon Short URI
でも、機能しない。あり？
グリモンのスクリプトリストの一番上に持って行ってみたけど、駄目だった。

JavaScriptはよくわからないのだけど、とりあえずソースを見てみたら「nonmemberStripe」のところに挿入されるみたいだ。
PLAIN TEXT
JavaScript:




var target = document.getElementById&#40;'nonmemberStripe'&#41;; 






アマゾンのページのソースを眺めてみたけど nonmemberStripe は見あたらず、Amazonからサインアウトしたら nonmemberStripe が出てきた。Amazonプライムでログインしてると、ここが memberStripe になるようだ。
以下のように変更したところ、Amazonプライムでログインしてる場合だけ出るようになった。
PLAIN TEXT
JavaScript:




var target = document.getElementById&#40;'memberStripe'&#41;; 






これだとアレなので、Amazonプライムでもそうじゃなくても短いURLが表示されるように書き換えてみた。
PLAIN TEXT
JavaScript:




var target = document.getElementById&#40;'nonmemberStripe'&#41;;


&#160; &#160; if &#40;!target&#41; &#123;


&#160; &#160; &#160; &#160; target = document.getElementById&#40;'memberStripe'&#41;;


&#160; &#160; &#125; 






間違ってるのかもしれないけど、とりあえず動いてる。
]]></description>
			<content:encoded><![CDATA[<p>SEOのためかどうか知らないけどAmazonの長いURLが鬱陶しいので、グリモンの以下のスクリプトを入れてみた。</p>
<p><a href="http://www.foxking.org/oldsite/?20080424S1">狐の王国 AmazonのURLを短くするAmazon Short URI</a></p>
<p>でも、機能しない。あり？<br />
グリモンのスクリプトリストの一番上に持って行ってみたけど、駄目だった。<br />
<span id="more-81"></span><br />
JavaScriptはよくわからないのだけど、とりあえずソースを見てみたら「nonmemberStripe」のところに挿入されるみたいだ。</p>
<div class="igBar"><span id="ljavascript-4"><a href="#" onclick="javascript:showCodeTxt('javascript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-4">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> target = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'nonmemberStripe'</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>アマゾンのページのソースを眺めてみたけど nonmemberStripe は見あたらず、Amazonからサインアウトしたら nonmemberStripe が出てきた。Amazonプライムでログインしてると、ここが memberStripe になるようだ。</p>
<p>以下のように変更したところ、Amazonプライムでログインしてる場合だけ出るようになった。</p>
<div class="igBar"><span id="ljavascript-5"><a href="#" onclick="javascript:showCodeTxt('javascript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> target = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'memberStripe'</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>これだとアレなので、Amazonプライムでもそうじゃなくても短いURLが表示されるように書き換えてみた。</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showCodeTxt('javascript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> target = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'nonmemberStripe'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>!target<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; target = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'memberStripe'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>間違ってるのかもしれないけど、とりあえず動いてる。</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress.mochy.com/2008/06/amazon%e3%83%97%e3%83%a9%e3%82%a4%e3%83%a0%e3%81%a0%e3%81%a8amazon-short-uri%e3%81%8c%e6%a9%9f%e8%83%bd%e3%81%97%e3%81%aa%e3%81%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

