Browse files

Ugly hack to prevent Goodreads showing 'Huckleberry Finn' reviews whe…

…n it doesn't know the ISBN, thanks to Sanjeev Kumar Dangi for the report
  • Loading branch information...
1 parent dbcc3ba commit be20979b8ce67428bfaefe6353473a1b9b9f2c5f @swaroopch committed Jul 29, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 app/views/book/view.html.erb
View
8 app/views/book/view.html.erb
@@ -80,6 +80,14 @@
<div class="goodreads">
<script type="text/javascript" charset="utf-8" src="http://www.goodreads.com/api/reviews_widget?did=DEVELOPER_ID&isbn=<%= @isbn %>&min_length=100&num_reviews=10"></script>
</div>
+ <% content_for :js do %>
+ // Ugly hack to prevent Goodreads showing 'Huckleberry Finn' reviews when it doesn't know the ISBN...
+ $( function() {
+ if ( $(".goodreads div.gr_reviews_header a").attr('href').match(/2956\./) ) {
+ $(".goodreads").remove();
+ }
+ } );
+ <% end %>
<% unless @bookseer.nil? %>
<h2>What to read next?</h2>

0 comments on commit be20979

Please sign in to comment.