<?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>dougv.com « Doug Vanderweide &#187; Greasemonkey</title>
	<atom:link href="http://www.dougv.com/tag/greasemonkey/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dougv.com</link>
	<description>ASP.NET, PHP, XML, JavaScript, Web geekery, Entrepreneurship</description>
	<lastBuildDate>Thu, 17 May 2012 22:33:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Working With The authorize.net Server Integration Method (SIM) Payment Gateway, Part 1: Don&#8217;t Use JavaScript</title>
		<link>https://www.dougv.com/2012/02/23/working-with-the-authorize-net-server-integration-method-sim-payment-gateway-part-1-dont-use-javascript/</link>
		<comments>https://www.dougv.com/2012/02/23/working-with-the-authorize-net-server-integration-method-sim-payment-gateway-part-1-dont-use-javascript/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 18:11:19 +0000</pubDate>
		<dc:creator>Doug Vanderweide</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[authorize.net]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[drop down / select list]]></category>
		<category><![CDATA[elegance]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[payment gateway]]></category>
		<category><![CDATA[radio buttons]]></category>
		<category><![CDATA[Server Integration Method]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=4115</guid>
		<description><![CDATA[JavaScript is too insecure to compute shopping cart totals. You can't rely on it when submitting payment requests to authorize.net.<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="https://www.dougv.com/2009/07/06/working-with-the-authorize-net-customer-information-manager-cim-part-1-overview/" rel="bookmark">Working With The Authorize.net Customer Information Manager (CIM), Part 1: Overview</a> (28.4)</li>
				<li><a href="https://www.dougv.com/2009/05/13/using-javascript-to-perform-a-task-traditionally-solved-with-server-side-scripting/" rel="bookmark">Using JavaScript To Perform A Task Traditionally Solved With Server-Side Scripting</a> (16.3)</li>
				<li><a href="https://www.dougv.com/2007/07/03/working-with-a-simple-structure-array-in-vbnet/" rel="bookmark">Working With A Simple Structure Array In VB.NET</a> (14.5)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p>I got an email a few days ago from a reader seeking help with the <a href="http://www.authorize.net/" target="_blank">authorize.net</a> <a href="http://developer.authorize.net/api/sim/" target="_blank">Server Integration Method (SIM)</a> credit card <a href="http://en.wikipedia.org/wiki/Payment_gateway" target="_blank">payment gateway</a>.</p>
<p>Specifically, he was asking how he could use JavaScript to pass a calculated total to a PHP page that contains the SIM code. </p>
<ul>
<li>A customer chooses a series of options from some select lists, radio buttons and the like;</li>
<li>the page calculates an order total;</li>
<li>the end user hits a submit button;</li>
<li>the results are posted to the SIM processing page, which acts as a &#8220;confirmation page&#8221;; and</li>
<li>The customer presses another button, which takes him to authorize.net to provide payment info and actually charge the card.</li>
</ul>
<p>You can see an approximation of what I&#8217;m talking about here: <a href="http://www.dougv.com/demo/js_form_values" target="_blank">http://www.dougv.com/demo/js_form_values</a>. The questioner&#8217;s form is similar to this approximation in function.</p>
<div class="aside">I will show how to properly customize a SIM form, and submit payment requests to authorize.net via SIM, in an upcoming post. This post explores why it&#8217;s a terrible idea to process order forms with JavaScript. That is, it&#8217;s about the wrong way to use SIM. Stay tuned for the right way.</div>
<p><span id="more-4115"></span>The direct answer to my reader&#8217;s question is simple. </p>
<p>1. Add a hidden form field inside the form:</p>
<pre class="brush: xml; title: ; notranslate">&lt;input type=&quot;hidden&quot; id=&quot;order_total_input&quot; name=&quot;order_total_input&quot; value=&quot;0.00&quot; /&gt;</pre>
<p>2. Using JavaScript, assign the calculated total as the value of that hidden form field:</p>
<pre class="brush: jscript; title: ; notranslate">

function orderTotal() {
	var total;
	//bunch of code that calculates the total from various form inputs
	total = total.toFixed(2);
	document.getElementById('order_total_input').value = total;
}
</pre>
<p>3. Add this function as an onsubmit event for the form:</p>
<pre class="brush: xml; title: ; notranslate">&lt;form id=&quot;orderform&quot; name=&quot;orderform&quot; method=&quot;post&quot; action=&quot;sim.php&quot; onsubmit=&quot;orderTotal()&quot;&gt;</pre>
<p>You can see this in action here: <a href="http://www.dougv.com/demo/js_form_values" target="_blank">http://www.dougv.com/demo/js_form_values</a>.</p>
<h3>JavaScript Is Wildly Insecure</h3>
<p><img src="http://www.dougv.com/wp-content/uploads/2012/02/alert.jpg" alt="Never rely on JavaScript alone alert box" title="Never rely on JavaScript alone alert box" width="357" height="115" class="alignright size-full wp-image-4121" />That said, this entire approach is wrong-headed, a complete security risk, and likely to backfire. </p>
<p><strong>Never use JavaScript to calculate the values you intend to submit to a credit card processor.</strong> For what that&#8217;s worth, <strong>never use a hidden form fields to pass any variable to a credit card processor.</strong></p>
<p><strong>Always use server-side processing to check, sanitize and process credit card orders.</strong></p>
<p>Why? Because anyone with a basic understanding of JavaScript can easily change the value of any form variable, simply by injecting a script onto your Web page.</p>
<p>You may have heard of <a href="http://www.greasespot.net/" target="_blank">Greasemonkey</a>. It&#8217;s a Web browser plugin that allows any user to add JavaScript to any Web page. And many Web browsers allow you to <a href="http://www.codinghorror.com/blog/2009/05/the-web-browser-address-bar-is-the-new-command-line.html" target="_blank">add JavaScript to the current page simply by typing it into the location bar</a>.</p>
<p>Using this knowledge, one can easily poison any form variable value on the page. He can not only poison the hidden form input that carries over the total to our shopping cart; he can also poison individual elements.</p>
<p>So, by the same token that the questioner can use this JavaScript to assign a value to order_total_input on form submission:</p>
<pre class="brush: jscript; title: ; notranslate">document.getElementById('order_total_input').value = total;</pre>
<p>I can override the orderTotal() function to be just this one line:</p>
<pre class="brush: jscript; title: ; notranslate">document.getElementById('order_total_input').value = '0.01';</pre>
<p>And that will set the total cost of my order to 1 cent.</p>
<p>You can see a demo of what I am talking about here: <a href="http://www.dougv.com/demo/js_form_values/poison.htm" target="_blank">http://www.dougv.com/demo/js_form_values/poison.htm</a>.</p>
<h3>Always Process Orders Server-Side</h3>
<p>If you don&#8217;t check that value at some point, to ensure it is correct, you could easily wind up selling me your entire cart for a penny. </p>
<p>If you use JavaScript to confirm the order total, not only have you duplicated your efforts / code &#8212; which is the dictionary definition of <a href="http://dictionary.reference.com/browse/inelegant" target="_blank">inelegant</a> &#8212; I can simply poison whatever JavaScript you used to confirm the order total is right, and still send along my one-penny charge.</p>
<p>Now, it&#8217;s true that many credit card processors will <a href="http://en.wikipedia.org/wiki/Credit_card_fraud#Carding" target="_blank">flag a one-cent charge as suspicious</a>. Many will also flag a $1 charge. But most credit card processors consider a $1 hold entirely appropriate, as a request to confirm a card is valid, and indicative of a charge that will be posted later. </p>
<p>(If you buy gasoline at the pump using a credit card, you know this is how it&#8217;s usually handled: A $1 hold is placed on your card, and the actual total for gas is posted as an amended transaction a day or two later, depending on when the gas station&#8217;s merchant bank processes its queue.)</p>
<p>So a smart scammer wouldn&#8217;t use 1 cent to poison your variable. But if he saw a total charge, for several items, of $150, and one or two of the things he ordered cost $35, he would amend his total, via JavaScript, to $35. </p>
<p>That amount wouldn&#8217;t be flagged by the credit card processor, which has no idea what specifically is being bought; only how much you want to charge the customer. It sees a $35 charge, which it has probably processed numerous times on your behalf, as totally legitimate. Such as charge could easily slip past whomever is fulfilling your orders, especially if they are busy, and you haven&#8217;t engineered a program that properly checks order totals.</p>
<h3>Any Form Variable Can Be Poisoned By DOM Manipulation</h3>
<p>Admittedly, a significant part of the problem with the questioner&#8217;s approach is that he is using, as values in his form / JavaScript, the actual prices of what he is selling.</p>
<p>Since I know how much he wants to charge for each thing, and because he is calculating his order total based on values contained in HTML elements, I can simply change those values to be whatever I want them to be, via a little <a href="http://www.w3schools.com/dom/dom_document.asp" target="_blank">Document Object Model (DOM) manipulation</a>. </p>
<p>So, if you have a select list that looks like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;select id=&quot;base_membership&quot; name=&quot;base_membership&quot; onchange=&quot;orderTotal()&quot;&gt;
	&lt;option value=&quot;0.00&quot; selected=&quot;selected&quot;&gt;No membership&lt;/option&gt;
	&lt;option value=&quot;50.00&quot;&gt;Basic membership, $50 / year&lt;/option&gt;
	&lt;option value=&quot;80.00&quot;&gt;Silver membership, $80 / year&lt;/option&gt;
	&lt;option value=&quot;100.00&quot;&gt;Gold membership, $100 / year&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>There is nothing stopping me from writing a Greasemonkey script that changes the values for each of those options:</p>
<pre class="brush: jscript; title: ; notranslate">
var tmp = document.getElementById('base_membership');
var i;
for(i = 0; i &lt; tmp.length; i++) {
	tmp.options[i].value = parseFloat(tmp.options[i].value / 10).toFixed(2);
}
</pre>
<p>Now, his $50 membership only costs me $5, and the $100 membership is a bargain at $10.</p>
<p>You can see this in action here: <a href="http://www.dougv.com/demo/js_form_values/poison2.htm" target="_blank">http://www.dougv.com/demo/js_form_values/poison2.htm</a>.</p>
<p>That is why, again,<strong> you should never use JavaScript to calculate a shopping cart total</strong> and <strong>always process credit card transaction totals on the server side</strong>.</p>
<p>I don&#8217;t mean to pile abuse onto my questioner. </p>
<p>Quite the opposite; I really appreciate the opportunity he&#8217;s provided to address the security issues around using JavaScript to accomplish important tasks, to discuss application security in general, and to set up the future discussion of how to properly implement authorize.net&#8217;s Server Integration Method (SIM).</p>
<p>Again, I&#8217;ll do that soon.</p>
<p>You can download the demo code for this article here: <a href='http://www.dougv.com/wp-content/uploads/2012/02/js_form_values.zip'>http://www.dougv.com/wp-content/uploads/2012/02/js_form_values.zip</a></p>
<p>All links in this post on delicious: <a href="http://delicious.com/dougvdotcom/working-with-the-authorize-net-server-integration-method-sim-payment-gateway-part-1-dont-use-javascript" target="_blank">http://delicious.com/dougvdotcom/working-with-the-authorize-net-server-integration-method-sim-payment-gateway-part-1-dont-use-javascript</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="https://www.dougv.com/2009/07/06/working-with-the-authorize-net-customer-information-manager-cim-part-1-overview/" rel="bookmark">Working With The Authorize.net Customer Information Manager (CIM), Part 1: Overview</a> (28.4)</li>
				<li><a href="https://www.dougv.com/2009/05/13/using-javascript-to-perform-a-task-traditionally-solved-with-server-side-scripting/" rel="bookmark">Using JavaScript To Perform A Task Traditionally Solved With Server-Side Scripting</a> (16.3)</li>
				<li><a href="https://www.dougv.com/2007/07/03/working-with-a-simple-structure-array-in-vbnet/" rel="bookmark">Working With A Simple Structure Array In VB.NET</a> (14.5)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>

	Tags: <a href="https://www.dougv.com/tag/drop-down-select-list/" title="drop down / select list" rel="tag">drop down / select list</a>, <a href="https://www.dougv.com/tag/elegance/" title="elegance" rel="tag">elegance</a>, <a href="https://www.dougv.com/tag/greasemonkey/" title="Greasemonkey" rel="tag">Greasemonkey</a>, <a href="https://www.dougv.com/tag/payment-gateway/" title="payment gateway" rel="tag">payment gateway</a>, <a href="https://www.dougv.com/tag/radio-buttons/" title="radio buttons" rel="tag">radio buttons</a>, <a href="https://www.dougv.com/tag/server-integration-method/" title="Server Integration Method" rel="tag">Server Integration Method</a><br />
]]></content:encoded>
			<wfw:commentRss>https://www.dougv.com/2012/02/23/working-with-the-authorize-net-server-integration-method-sim-payment-gateway-part-1-dont-use-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chrome Just Isn&#8217;t Up To Firefox&#8217;s Snuff</title>
		<link>https://www.dougv.com/2010/11/27/chrome-just-isnt-up-to-firefoxs-snuff/</link>
		<comments>https://www.dougv.com/2010/11/27/chrome-just-isnt-up-to-firefoxs-snuff/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 23:11:07 +0000</pubDate>
		<dc:creator>Doug Vanderweide</dc:creator>
				<category><![CDATA[Help Desk]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[coding standards]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Reader]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.dougv.com/blog/?p=3410</guid>
		<description><![CDATA[Three weeks ago I decided to give Google Chrome a shot at replacing Mozilla Firefox as my primary browser. And believe me, it was a fair contest: I only called upon Firefox when I could not get Chrome to work. Unfortunately, I had to call on Firefox at least once every other day. And while [...]<div class="yarpp">
	<h5>Related Posts</h5>
		
No related posts.
	</div>
]]></description>
			<content:encoded><![CDATA[<p>Three weeks ago I decided to give <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a><img class="alignleft  wp-image-3411" title="Google Chrome Logo" src="http://www.dougv.com/wp-content/uploads/2010/11/google-chrome-7-300x300.jpg" alt="Google Chrome Logo" width="180" /> a shot at replacing <a href="http://www.mozilla.com/en-US/firefox/personal.html" target="_blank">Mozilla Firefox</a> as my primary browser. And believe me, it was a fair contest: I only called upon Firefox when I could not get Chrome to work.</p>
<p>Unfortunately, I had to call on Firefox at least once every other day. And while I still run across the occasional Web site that requires me to use <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">Internet Explorer</a> &#8212; mainly, Web sites that use some Microsoft technology, such as <a href="http://office.microsoft.com/en-us/live-meeting/" target="_blank">LiveMeeting</a> or an <a href="http://msdn.microsoft.com/en-us/library/aa751972%28VS.85%29.aspx" target="_blank">ActiveX</a> control of some sort &#8212; that&#8217;s maybe once or twice a month.</p>
<p>(And no, I have not given IE a chance to be my primary browser. When it truly embraces <a href="http://www.w3.org/">Web standards</a>, then I will consider it. Internet Explorer is barely in the neighborhood of standards compliance right now, never mind on the same street. <a href="http://www.apple.com/safari/" target="_blank">Safari</a>? C&#8217;mon, man. <a href="http://www.opera.com/" target="_blank">Opera</a>? Seriously, stop now, you&#8217;re embarrassing yourself.)</p>
<p>So I&#8217;ve made up my mind: Chrome gets sent back to the minors to work on its skills, and Firefox &#8212; older, fatter, slower, but far more dependable and experienced &#8212; is back as my ace starting pitcher.</p>
<p><span id="more-3410"></span>The problems I had with Chrome were threefold:</p>
<p>I was having problems with <strong>some sites redirecting oddly</strong>, especially when I was trying to shop online. Basically, I couldn&#8217;t complete any mutliple-form-submission efforts without the site sending me back to a previous step in the process. This happened on the <a href="http://www.samsclub.com/sams/homepage.jsp" target="_blank">Sam&#8217;s Club</a>, <a href="http://www.cabelas.com/" target="_blank">Cabela&#8217;s</a> and the <a href="http://www.historybookclub.com/" target="_blank">History Book Club</a> Web sites, so I know it was the browser.</p>
<p>I suspect it was due to a misbehaving plug-in, but I didn&#8217;t want to put in the effort to track it down &#8212; not when Firefox behaves perfectly fine, with dozens of similar plugins, on those sites.</p>
<p>There isn&#8217;t a properly functioning <strong>download accelerator plugin</strong> for Chrome.</p>
<p>I searched high and low for one. The closest I came was <a href="http://www.freedownloadmanager.org/" target="_blank">Free Download Manager</a>, which very closely resembles <a href="http://www.flashget.com/index_en.html" target="_blank">FlashGet</a>, which I use with Firefox (via the <a href="https://addons.mozilla.org/en-US/firefox/addon/220/" target="_blank">FlashGot</a> plugin). But I could never quite get Free Download Manager to work, especially for sites that required either forms or basic authentication. A number of users <a href="http://www.freedownloadmanager.org/board/viewtopic.php?f=1&amp;t=11744" target="_blank">claimed in FDM&#8217;s support forum</a> to have gotten the plugin to work, but I could not.</p>
<p>Again, if FlashGot / FlashGet work just fine, why am I struggling with this problem in Chrome?</p>
<p><img class="alignright size-thumbnail wp-image-3413" title="Mozilla Firefox logo" src="http://www.dougv.com/wp-content/uploads/2010/11/large_firefox-150x150.jpg" alt="Mozilla Firefox logo" width="150" />In the end, <strong>Chrome&#8217;s intangibles didn&#8217;t quite measure up</strong>. Compared to Firefox, everything was just a little more shoddy and a little harder to do.</p>
<p>Clearing history? Chrome struggled hard, whereas Firefox snapped right along. And I don&#8217;t understand the purpose of &#8220;incognito&#8221; mode in Chrome, unless the purpose is to browse without plugins, rather than not storing history, cookies and cache files, <a href="http://www.google.com/support/chrome/bin/answer.py?hl=en&amp;answer=95464" target="_blank">as the documentation states</a>.</p>
<p>Plugins? Some worked great &#8212; I am going to miss the <a href="https://chrome.google.com/extensions/detail/kcnhkahnjcbndmmehfkdnkjomaanaooo" target="_blank">Google Voice</a> and <a href="https://chrome.google.com/extensions/detail/apflmjolhbonpkbkooiamcnenbmbjcbf" target="_blank">Google Reader</a> extensions &#8212; but for the most part, the Chrome version of a given plugin was shoddy in comparison to its Firefox version.</p>
<p>For example, there are no contextual menus for the Chrome version of <a href="http://lastpass.com/" target="_blank">LastPass</a>, which can make filling out forms a lot harder. <a href="https://chrome.google.com/extensions/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo" target="_blank">Tampermonkey</a> &#8212; Chrome&#8217;s version of <a href="https://addons.mozilla.org/en-US/firefox/addon/748/" target="_blank">Greasemonkey</a> &#8212; kept crashing on me. Settings for <a href="https://addons.mozilla.org/en-US/firefox/addon/1865/" target="_blank">Adblock Plus</a> are a lot more complicated in Chrome than in Firefox.</p>
<p>I liked how snappy Chrome was when I first used it. But as soon as I added plugins to it, the trouble started, and now the only practical difference between the two is the aforementioned lack of polish in the Google offering.</p>
<p>That may not last. It is possible Chrome will improve as time goes by. I&#8217;m not averse to giving Chrome a second, third or, for that matter, as many additional shots as it deserves.</p>
<p>But I surf with Firefox. I know Firefox. Firefox is a good friend of mine. <a href="http://en.wikipedia.org/wiki/Senator,_you%27re_no_Jack_Kennedy" target="_blank">Chrome, you&#8217;re no Firefox</a>.</p>
<p>All links in this post on delicious: <a href="http://www.delicious.com/dougvdotcom/chrome-just-isnt-up-to-firefoxs-snuff" target="_blank">http://www.delicious.com/dougvdotcom/chrome-just-isnt-up-to-firefoxs-snuff</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<p>No related posts.</p>
	</div>

	Tags: <a href="https://www.dougv.com/tag/chrome/" title="Chrome" rel="tag">Chrome</a>, <a href="https://www.dougv.com/tag/coding-standards/" title="coding standards" rel="tag">coding standards</a>, <a href="https://www.dougv.com/tag/firefox/" title="Firefox" rel="tag">Firefox</a>, <a href="https://www.dougv.com/tag/google/" title="Google" rel="tag">Google</a>, <a href="https://www.dougv.com/tag/google-reader/" title="Google Reader" rel="tag">Google Reader</a>, <a href="https://www.dougv.com/tag/greasemonkey/" title="Greasemonkey" rel="tag">Greasemonkey</a>, <a href="https://www.dougv.com/tag/internet-explorer/" title="Internet Explorer" rel="tag">Internet Explorer</a>, <a href="https://www.dougv.com/tag/safari/" title="Safari" rel="tag">Safari</a>, <a href="https://www.dougv.com/tag/webkit/" title="WebKit" rel="tag">WebKit</a><br />
]]></content:encoded>
			<wfw:commentRss>https://www.dougv.com/2010/11/27/chrome-just-isnt-up-to-firefoxs-snuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s All Chinese To Me: Reader Has Google Translate Built-In</title>
		<link>https://www.dougv.com/2010/06/10/its-all-chinese-to-me-reader-has-google-translate-built-in/</link>
		<comments>https://www.dougv.com/2010/06/10/its-all-chinese-to-me-reader-has-google-translate-built-in/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 14:43:13 +0000</pubDate>
		<dc:creator>Doug Vanderweide</dc:creator>
				<category><![CDATA[Help Desk]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Reader]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://www.dougv.com/blog/?p=3195</guid>
		<description><![CDATA[I really like Google Reader; one of its great features is its recommendations. As long as you choose to &#8220;like&#8221; articles and media on a fairly consistent basis, Reader can do a very good job of finding new content and sources (provided, that is, they come from a Feedburner RSS feed). Because Google expected me [...]<div class="yarpp">
	<h5>Related Posts</h5>
		
No related posts.
	</div>
]]></description>
			<content:encoded><![CDATA[<p>I really like <a href="http://www.google.com/reader" target="_blank">Google Reader</a>; one of its great features is its recommendations. As long as you choose to &#8220;like&#8221; articles and media on a fairly consistent basis, Reader can do a very good job of finding new content and sources (provided, that is, they come from a <a href="http://feeds.feedburner.com/dougvdotcom" target="_blank">Feedburner RSS feed</a>).</p>
<p>Because Google expected me to have at least a modicum of Internet savvy &#8212; perhaps from the nature of the things I &#8220;like&#8221; and share &#8212; Reader occasionally sends along to me tweets written in Chinese.</p>
<div id="attachment_3197" class="wp-caption alignnone" style="width: 748px"><a href="http://www.dougv.com/wp-content/uploads/2010/06/chinese_tweet.jpg"><img class="size-large wp-image-3197   " title="A tweet written in Chinese" src="http://www.dougv.com/wp-content/uploads/2010/06/chinese_tweet-1024x225.jpg" alt="A tweet written in Chinese" width="695" height="162" /></a><p class="wp-caption-text">Google Reader suggests a tweet, but it&#39;s all Chinese to me. Note the &quot;not interested&quot; tick is checked. That&#39;s because I failed to RTFM.</p></div>
<p>According to Google Translate, the tweet above reads:</p>
<blockquote><p>RT @ aiww: Ha, yes. RT @ luanmazi: Republic of the  &#8220;unsung heroes&#8221; bei RT @  june197433: &#8220;China&#8217;s Internet status&#8221;  throughout the White Paper did not  mention GFW, Fang Bin-Xing Academy  of Engineering uncomfortable it?  Http://aa.cx/r85 @ aiww</p></blockquote>
<p>That&#8217;s clear enough: China doesn&#8217;t mention, in <a href="http://www.scio.gov.cn/zxbd/tt/jd/201006/t660840.htm" target="_blank">its recent statement on the Internet</a>, the school  where China&#8217;s infamous firewall was developed.</p>
<p>As the &#8220;not interested&#8221; tick indicates, previously I had been marking these Chinese tweets to disappear, but I&#8217;ve been getting 2-3 per week, despite my attempt to indicate I can&#8217;t read Chinese. It&#8217;s time-consuming to copy and paste these tweets into Translate; I already waste enough time on <a href="http://www.google.com/reader/shared/dougvanderweide" target="_blank">Reader</a>, <a href="http://twitter.com/dougvdotcom" target="_blank">Twitter</a> and <a href="http://www.facebook.com/dougvdotcom" target="_blank">Facebook</a>.</p>
<p>Which sent me on a quest to find a way to translate Reader posts inline.</p>
<p>Being a typical programmer, my initial thought was a $10 solution to a 50-cent problem: I could use the <a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI" target="_blank">Reader</a> and <a href="http://code.google.com/intl/en/apis/ajaxlanguage/" target="_blank">Translate</a> APIs to do on-the-fly translations. That, however, was quickly dismissed as a gross impracticality.</p>
<p>I could find, or write, a <a href="https://addons.mozilla.org/en-US/firefox/addon/748/" target="_blank">Greasemonkey</a> script to do the translation. I did find <a href="http://userscripts.org/scripts/show/43115" target="_blank">a Greasemonkey script that translates tweets</a> on the Twitter Web page itself. I installed that and it works great, from a technical standpoint; but the Engrish it generates is, shall we say, rough.</p>
<div id="attachment_3198" class="wp-caption alignnone" style="width: 515px"><img class="size-full wp-image-3198" title="A Twitter translation by Google: Wait, what?" src="http://www.dougv.com/wp-content/uploads/2010/06/engrish_tweet.jpg" alt="A Twitter translation by Google: Wait, what?" width="505" height="275" /><p class="wp-caption-text">A Twitter translation by Google, from Japanese to English: Wait, what?</p></div>
<p>So I was resigned to having to live with a choice between no translation or bad translations. Until I decided to <a href="http://en.wikipedia.org/wiki/RTFM" target="_blank">STFW</a> one more time, and found the solution: Google has already handled translation for me. As in, <a href="http://googlesystem.blogspot.com/2008/11/translate-feeds-in-google-reader.html" target="_blank">translation is just a button click away</a>.</p>
<div id="attachment_3204" class="wp-caption alignnone" style="width: 742px"><img class="size-full wp-image-3204 " title="Google Reader translation option" src="http://www.dougv.com/wp-content/uploads/2010/06/translate_option.jpg" alt="Google Reader translation option" width="695" height="208" /><p class="wp-caption-text">Oh, you mean I should click *that* button. Why didn&#39;t you say so?</p></div>
<p>Proving, once again, it&#8217;s important to read the manual.</p>
<p>All links in this post on delicious: <a href="http://delicious.com/dougvdotcom/its-all-chinese-to-me-reader-has-google-translate-built-in" target="_blank">http://delicious.com/dougvdotcom/its-all-chinese-to-me-reader-has-google-translate-built-in</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<p>No related posts.</p>
	</div>

	Tags: <a href="https://www.dougv.com/tag/google/" title="Google" rel="tag">Google</a>, <a href="https://www.dougv.com/tag/google-reader/" title="Google Reader" rel="tag">Google Reader</a>, <a href="https://www.dougv.com/tag/greasemonkey/" title="Greasemonkey" rel="tag">Greasemonkey</a>, <a href="https://www.dougv.com/tag/rss/" title="RSS" rel="tag">RSS</a>, <a href="https://www.dougv.com/tag/translation/" title="translation" rel="tag">translation</a><br />
]]></content:encoded>
			<wfw:commentRss>https://www.dougv.com/2010/06/10/its-all-chinese-to-me-reader-has-google-translate-built-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

