<?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>Netphase &#187; Acts As Amazon Product</title>
	<atom:link href="http://blog.netphase.com/category/blog/amazon/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.netphase.com</link>
	<description>for a connected world</description>
	<lastBuildDate>Mon, 14 Dec 2009 21:40:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Acts As Amazon Product</title>
		<link>http://blog.netphase.com/2009/08/05/acts-as-amazon-product/</link>
		<comments>http://blog.netphase.com/2009/08/05/acts-as-amazon-product/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 14:53:45 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Acts As Amazon Product]]></category>
		<category><![CDATA[Check This Out]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.netphase.com/?p=343</guid>
		<description><![CDATA[Acts As Amazon Product, or AAAP for short, is a Ruby Gem developed by Netphase and available on github as an Open Source offering. This gem allows you to easily include products from Amazon's vast catalog in your application. ]]></description>
			<content:encoded><![CDATA[<p>Acts As Amazon Product, or AAAP for short, is a Ruby Gem developed by Netphase and <a href="http://github.com/netphase/aaap/tree/master">available on github</a> as an Open Source offering. This gem allows you to easily include products from Amazon&#8217;s vast catalog in your application. You have great control over whether you want the items to load into their own models, or one of your own, and also if the model is saved or merely loaded in memory for further action by you application.</p>
<p>We have used Acts As Amazon Product in production, as have other stellar Ruby on Rails consultancies. We hope that you find it as helpful as we have. And true to the open source nature of the project, if you have any ideas on how we can make AAAP better, by all means, submit a pull request!</p>
<p>For more information on AAAP, check out the <a href="http://github.com/netphase/aaap/tree/master">project page on Github</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netphase.com/2009/08/05/acts-as-amazon-product/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Netphase Launches Homeschool Apple</title>
		<link>http://blog.netphase.com/2009/03/07/netphase-launches-homeschool-apple/</link>
		<comments>http://blog.netphase.com/2009/03/07/netphase-launches-homeschool-apple/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 04:59:09 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Acts As Amazon Product]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[newsworthy]]></category>

		<guid isPermaLink="false">http://www.netphase.com/?p=308</guid>
		<description><![CDATA[Netphase launched the first in what is expected to be a long line of web offerings geared towards making the lives of homeschoolers a little easier. Homeschool Apple takes the pain out of buying and selling used homeschool curriculum.]]></description>
			<content:encoded><![CDATA[<p>Earlier today, Netphase launched its first in what is expected to be a long line of web applications based on its new virtual mall engine, WeSell.  WeSell aims to conquer some of the problems typically associated with selling from multiple vendors in a shopping cart-based system, utilizing only one checkout.</p>
<p>The technology behind it is really quite remarkable. Netphase&#8217;s proprietary solution takes into account the available inventory of the seller, who typically will be an average user with products in their possession that they wish to resell. It prevents shopping cart conflicts, yet also considers how long a prospective buyer is allowed to keep an item in his cart before the item is returned back to the active inventory for others to purchase. Bottom line is that it strives to strike the difficult balance of allowing a seller to have inventory tied up by only those wanting to purchase, and also of allowing a buyer with an item in her cart to shop with confidence, knowing that when she checks out, the item is in fact hers.</p>
<p>Other features of WeSell protect both the buyer and seller by way of a built-in transaction escrow system. It is fully secure, deployed in the infinitely scalable Amazon EC2 Cloud, and of course, it runs on Ruby on Rails.</p>
<h3>About Homeschool Apple</h3>
<p>The <a href="http://homeschoolapple.com">Homeschool Apple</a> mission is to be an oasis for homeschoolers on the internet. HSA seeks to provide a one-stop place where homeschoolers can sell their used, new, self-published or downloadable curriculum, connect with others, and share their talents with the world. While far from complete, Homeschool Apple is well on its way, with the most unique homeschool store on the Web and a rock-solid platform on which to build. The site is currently in public Beta, and homeschoolers are encouraged to sign up for their FREE account now. Pass the word to your friends, won&#8217;t you?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netphase.com/2009/03/07/netphase-launches-homeschool-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AAAP Updated!</title>
		<link>http://blog.netphase.com/2008/12/05/acts_as_amazon_product-update/</link>
		<comments>http://blog.netphase.com/2008/12/05/acts_as_amazon_product-update/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 17:45:02 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Acts As Amazon Product]]></category>
		<category><![CDATA[Netphase News]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[aaap]]></category>
		<category><![CDATA[acts_as_amazon_product]]></category>
		<category><![CDATA[gem]]></category>

		<guid isPermaLink="false">http://www.netphase.com/?p=160</guid>
		<description><![CDATA[It&#8217;s been a while since we have called attention to it, but over the course of the year, our Amazon product integration gem, acts_as_amazon_product, has been improved.
First, we got some participation from David Eisinger to help improve testing and some other critical features. Thanks, David! Recently though, we added some new functionality we had lying [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since we have called attention to it, but over the course of the year, our Amazon product integration gem, <a href="http://github.com/netphase/aaap/tree/master" target="_new">acts_as_amazon_product</a>, has been improved.</p>
<p>First, we got some participation from David Eisinger to help improve testing and some other critical features. Thanks, David! Recently though, we added some new functionality we had lying around in an old plugin called acts_as_amazonable.</p>
<p>The new functionality allows you to load Amazon product attributes into a new or existing model object on your system. You can define which fields are loaded, and which attributes in your model they map to. We are using this functionality on a new double-secret project that we are working on, and it is great. In that project, we are letting our users type in an ISBN code, and we pre-populate a form with all of the Amazon data we want for that product, saving the user from a lot of typing. We also pick up the images, so they don&#8217;t even have  to load an image to sell their item. Pretty cool!</p>
<p>Here&#8217;s how you use aaap&#8217;s new functionality:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'acts_as_amazon_product'</span>
&nbsp;
 <span style="color:#9966CC; font-weight:bold;">class</span> LocalBook <span style="color:#006600; font-weight:bold;">&amp;</span>lt; <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
   acts_as_amazon_product<span style="color:#006600; font-weight:bold;">&#40;</span>
     <span style="color:#ff3333; font-weight:bold;">:asin</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'isbn'</span>, <span style="color:#ff3333; font-weight:bold;">:name</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'title'</span>,
     <span style="color:#ff3333; font-weight:bold;">:access_key</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'0123456'</span>, <span style="color:#ff3333; font-weight:bold;">:associate_tag</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'assoc-20'</span>,
     <span style="color:#ff3333; font-weight:bold;">:auto_load_fields</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006600; font-weight:bold;">&#123;</span>
         <span style="color:#ff3333; font-weight:bold;">:title</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'title'</span>,
         <span style="color:#ff3333; font-weight:bold;">:isbn</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'asin'</span>,
         <span style="color:#ff3333; font-weight:bold;">:publisher_name</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'manufacturer'</span>,
         <span style="color:#ff3333; font-weight:bold;">:author</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'author'</span><span style="color:#006600; font-weight:bold;">&#125;</span>
   <span style="color:#006600; font-weight:bold;">&#41;</span>
 <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The keys in the auto_load_fields hash are the fields in your object, and the values are their Amazon equivalents. In the true Rails convention over configuration spirit, we have included some of the most popular auto load fields as defaults. If your object contains the following attributes, they will automatically be loaded with their Amazon equivalents:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#ff3333; font-weight:bold;">:auto_load_fields</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006600; font-weight:bold;">&#123;</span>
     <span style="color:#ff3333; font-weight:bold;">:title</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'title'</span>,
     <span style="color:#ff3333; font-weight:bold;">:isbn</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'asin'</span>,
     <span style="color:#ff3333; font-weight:bold;">:publisher_name</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'manufacturer'</span>,
     <span style="color:#ff3333; font-weight:bold;">:author</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'author'</span>,
     <span style="color:#ff3333; font-weight:bold;">:binding</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'binding'</span>,
     <span style="color:#ff3333; font-weight:bold;">:list_price</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'listprice/amount'</span>,
     <span style="color:#ff3333; font-weight:bold;">:pages</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'numberofpages'</span>,
     <span style="color:#ff3333; font-weight:bold;">:description</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'content'</span>,
     <span style="color:#ff3333; font-weight:bold;">:small_image_url</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'smallimage/url'</span>,
     <span style="color:#ff3333; font-weight:bold;">:medium_image_url</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'mediumimage/url'</span>,
     <span style="color:#ff3333; font-weight:bold;">:large_image_url</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'largeimage/url'</span>,
     <span style="color:#ff3333; font-weight:bold;">:detail_url</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'detailpageurl'</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Don&#8217;t worry if your object does not have some or most of these fields; Acts as Amazon Product is smart enough to check to see if the method exists before attempting to load up the Amazon value.</p>
<p>Now, if by some coincidence you have some fields in your local object that have the same name as our auto_load defaults, you can choose to specifically ignore those fields using, you guessed it, :ignore_fields.  :ignore_fields is a simple array of fields in your object that you do NOT want to be replaced with the Amazon equivalent.  You would specify them like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">acts_as_amazon_product<span style="color:#006600; font-weight:bold;">&#40;</span>
    <span style="color:#ff3333; font-weight:bold;">:asin</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'isbn'</span>, <span style="color:#ff3333; font-weight:bold;">:name</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'title'</span>,
    <span style="color:#ff3333; font-weight:bold;">:access_key</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'0123456'</span>, <span style="color:#ff3333; font-weight:bold;">:associate_tag</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'assoc-20'</span>,
    <span style="color:#ff3333; font-weight:bold;">:ignore_fields</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:small_image_url</span>, <span style="color:#ff3333; font-weight:bold;">:medium_image_url</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  <span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>In this instance, the object in question would load Amazon info for any of the default fields that the object has, with the exception of the small_image_url and medium_image_url values.</p>
<p>To load the Amazon values into your object for local storage, you may call the following methods:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">load_from_amazon<span style="color:#006600; font-weight:bold;">&#40;</span>title_or_asin, by_title = <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>
load_from_amazon!<span style="color:#006600; font-weight:bold;">&#40;</span>title_or_asin, by_title = <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>The two methods do exactly the same thing, except the first simply returns a new, unsaved object with its Amazon-like fields loaded with their appropriate Amazon values.  The second version (load_from_amazon!) goes one step further and saves the object for good measure.</p>
<p>You may pass either an isbn (asin) or a title in.  If you are passing a title, you need to specify that you are passing a title by also passing true as the second parameter so we will perform an item_search rather than an item_lookup. Note that passing a title is risky business, since currently the code will take the first result returned and load that into your object. So unless your title is unique, I would recommend sticking with the isbn (asin) value.</p>
<p>Since that is the default, all you need to do would be something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#0066ff; font-weight:bold;">@local_book</span> = LocalBook.<span style="color:#9900CC;">load_from_amazon</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'1590598415'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>If your object was similar to the LocalBook object in our example, for instance, you would not need to specify the auto_load_fields in the acts_as call at all.  The title, isbn, publisher_name and author methods would automatically be called once you call load_from_amazon, and their values populated appropriately.</p>
<p>It is important to note that if you call load_from_amazon with an invalid asin, you will simply get back an empty object.</p>
<p>Now, calling load_from_amazon still allows you to take advantage of the other Acts as Amazon features, like the dynamic loading of Amazon attributes on the fly by using the various amazon.foo methods as it always has.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netphase.com/2008/12/05/acts_as_amazon_product-update/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>acts_as_amazon_product</title>
		<link>http://blog.netphase.com/2007/09/26/acts_as_amazon_product/</link>
		<comments>http://blog.netphase.com/2007/09/26/acts_as_amazon_product/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 20:31:58 +0000</pubDate>
		<dc:creator>scottned</dc:creator>
				<category><![CDATA[Acts As Amazon Product]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.netphase.com/2007/09/26/acts_as_amazon_product/</guid>
		<description><![CDATA[Today we released a new Ruby Gem that makes integrating with Amazon E-Commerce Service (ECS) a snap.  It&#8217;s called acts_as_amazon_product and you can find it on RubyForge.
All that&#8217;s necessary to integrate any of your existing models with Amazon is to add a require line to the top of your model file and then an [...]]]></description>
			<content:encoded><![CDATA[<p>Today we released a new Ruby Gem that makes integrating with Amazon E-Commerce Service (ECS) a snap.  It&#8217;s called acts_as_amazon_product and you can <a href="http://rubyforge.org/projects/aaap/">find it on RubyForge</a>.</p>
<p>All that&#8217;s necessary to integrate any of your existing models with Amazon is to add a <em>require</em> line to the top of your model file and then an acts_as_amazon_product line just inside your class definition.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'acts_as_amazon_product'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Book <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  acts_as_amazon_product<span style="color:#006600; font-weight:bold;">&#40;</span>
      <span style="color:#ff3333; font-weight:bold;">:asin</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'isbn'</span>, <span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'title'</span>, 
      <span style="color:#ff3333; font-weight:bold;">:access_key</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'0123456'</span>, 
      <span style="color:#ff3333; font-weight:bold;">:associate_tag</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'assoc-20'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>After this, you can access Amazon data in your controllers or views like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#0066ff; font-weight:bold;">@book</span> = Book.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:title</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'Getting Things Done'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#0066ff; font-weight:bold;">@book</span>.<span style="color:#9900CC;">amazon</span>.<span style="color:#9900CC;">isbn</span>
<span style="color:#0066ff; font-weight:bold;">@book</span>.<span style="color:#9900CC;">amazon</span>.<span style="color:#9900CC;">title</span>
<span style="color:#0066ff; font-weight:bold;">@book</span>.<span style="color:#9900CC;">amazon</span>.<span style="color:#9900CC;">author</span>
<span style="color:#0066ff; font-weight:bold;">@book</span>.<span style="color:#9900CC;">amazon</span>.<span style="color:#9900CC;">small_image_url</span>
&nbsp;
<span style="color:#0066ff; font-weight:bold;">@book</span>.<span style="color:#9900CC;">amazon</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'itemattributes/foobar'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>The code does not require changing any current database tables.  It only requires adding one migration for a single new table used to cache responses from Amazon:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">connection</span>.<span style="color:#9900CC;">create_table</span> <span style="color:#ff3333; font-weight:bold;">:amazon_products</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>t<span style="color:#006600; font-weight:bold;">|</span>
  t.<span style="color:#9900CC;">column</span> <span style="color:#ff3333; font-weight:bold;">:asin</span>, <span style="color:#ff3333; font-weight:bold;">:string</span>
  t.<span style="color:#9900CC;">column</span> <span style="color:#ff3333; font-weight:bold;">:xml</span>, <span style="color:#ff3333; font-weight:bold;">:text</span>
  t.<span style="color:#9900CC;">column</span> <span style="color:#ff3333; font-weight:bold;">:created_at</span>, <span style="color:#ff3333; font-weight:bold;">:datetime</span>
  t.<span style="color:#9900CC;">column</span> <span style="color:#ff3333; font-weight:bold;">:amazonable_id</span>, <span style="color:#ff3333; font-weight:bold;">:integer</span>
  t.<span style="color:#9900CC;">column</span> <span style="color:#ff3333; font-weight:bold;">:amazonable_type</span>, <span style="color:#ff3333; font-weight:bold;">:string</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.netphase.com/2007/09/26/acts_as_amazon_product/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
