[typo] Amazon Sidebar Component Broken?

Terry Donaghe terry.donaghe at gmail.com
Sat Apr 15 12:46:44 EDT 2006


This is the line of code that's confusing me:

asin_list = params[:contents].to_a.inject([]) { |acc, item| acc |
item.whiteboard[:asins].to_a }

When I set a breakpoint after this line, asin_list always contains nothing.

params[:contents] contains a ton of stuff including the html contents of my
blog.

asin_list = params[:contents].to_a.inject([]) { |acc, item| acc}
returns nothing

asin_list = params[:contents].to_a.inject([]) { |acc, item| item }
returns pretty much the same thing as params[:contents]

Toward the end of the string returned by the last asin_list above, there's
this: "whiteboard" =>{}
So, it looks to me that something should be setting something into this
whiteboard, maybe.

If I look at:
asin_list = params[:contents].to_a.inject([]) { |acc, item| item.whiteboard}
I get {}

Similarly
asin_list = params[:contents].to_a.inject([]) { |acc, item|
item.whiteboard.to_a }
returns []

So, what's the whiteboard, and how does stuff get into it?

Terry


asin_list = params[:contents].to_a.inject([]) { |acc, item|
item.whiteboard[:asins].to_a
}

On 4/15/06, Terry Donaghe <terry.donaghe at gmail.com> wrote:
>
> Hi,
>
> I'm trying to figure out how to use the Amazon Sidebar component.  Is it
> currently broken?  I've tried every sort of Amazon link I can think of and I
> never get anything on my sidebar dealing with Amazon.  Is there a proper way
> to set up my URLs so that they'll work?  Here's what I've been using:
>
> http://www.amazon.com/exec/obidos/ASIN/097669400X/donaghehomepa-20
> and just
> http://www.amazon.com/exec/obidos/ASIN/097669400X/
>
> Neither of these cause anything to show up on the sidebar.
>
> Thanks for any clues here!
>
> Terry
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/typo-list/attachments/20060415/3c873d73/attachment.htm 


More information about the Typo-list mailing list