distillery 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .DS_Store
1
2
  *.gem
2
3
  .bundle
3
4
  Gemfile.lock
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  Distillery extracts the "content" portion out of an HTML document. It applies heuristics based on element type, location, class/id name and other attributes to try and find the content part of the HTML document and return it.
4
4
 
5
- The logic for Distillery was heavily influenced by [Readability](https://www.readability.com/), who was nice enough to make [their logic](http://code.google.com/p/arc90labs-readability/source/browse/trunk/js/readability.js) open source. Readability and Distillery share nearly the same logic for locating the content HTML element on the page, however Distillery does *not* aim to be a direct port of that logic (see [iterationlabs/ruby-readability](https://github.com/iterationlabs/ruby-readability) for that).
5
+ The logic for Distillery was heavily influenced by [Readability](https://www.readability.com/), who was nice enough to make [their logic](http://code.google.com/p/arc90labs-readability/source/browse/trunk/js/readability.js) open source. Readability and Distillery share nearly the same logic for locating the content HTML element on the page, however Distillery does *not* aim to be a direct port of that logic (see [iterationlabs/ruby-readability](https://github.com/iterationlabs/ruby-readability) for that).
6
+
7
+ ## Differences from Readability
6
8
 
7
9
  Readability and Distillery differ in how they clean and return the found page content. Readability is focused on stripping the page content down to just paragraphs of text for distraction-free reading, and thus aggressively cleans and transforms the content element HTML. Mostly, this is the conversion of some `<div>` elements and newlines to `<p>` elements. Distillery does no transformation of the content element, and instead returns the content as originally seen in the HTML document.
8
10
 
@@ -28,11 +30,16 @@ Then you simply call `#distill!` on the document object to distill it and return
28
30
 
29
31
  ### Cleaning of the content
30
32
 
31
- Both the `Distill::Document#distill!` and `Distillery.distill` methods by default will clean the HTML of the content to remove elements from it which are unlikely to be the actual content. Usually, this is things like social media share buttons, widgets, advertisements, etc. If you would like to not clean the content, simply pass `:clean => false` to either method:
33
+ Both the `Distillery::Document#distill!` and `Distillery.distill` methods by default will clean the HTML of the content to remove elements from it which are unlikely to be the actual content. Usually, this is things like social media share buttons, widgets, advertisements, etc. If do not want to clean the content, simply pass `:clean => false` to either method:
32
34
 
33
35
  doc.distill!(:clean => false)
34
36
  > "raw distilled content"
35
37
 
38
+ In its cleaning, Distillery will also remove all `<img>` tags from the content element. If you would like to preserve `<img>` tags, pass the `:images => true` option to the `Distillery::Document#distill!` and `Distillery.distill` methods. Please note that this will preserve any elements that wrap `<img>` tags that would have been removed under normal circumstances during cleaning.
39
+
40
+ doc.distill!(:images => true)
41
+ > "raw distilled content with <img src=\"info.png\">"
42
+
36
43
  ## From the command line
37
44
 
38
45
  Distillery also ships with an executable that allows you to distill documents at the command line:
data/bin/distill CHANGED
@@ -9,6 +9,7 @@ require 'slop'
9
9
  opts = Slop.parse :help => true do
10
10
 
11
11
  on :d, :dirty, 'Do not clean content HTML', default: false
12
+ on :i, :images, 'Keep images in the content HTML', default: false
12
13
  on :v, :version, 'Print the version' do
13
14
  puts Distillery::VERSION
14
15
  exit
@@ -20,5 +21,7 @@ end
20
21
  unless ARGV.last =~ /^http/
21
22
  puts opts.help
22
23
  else
23
- puts Distillery.distill(open(ARGV.last).read, :clean => !opts.dirty?)
24
+ puts Distillery.distill(open(ARGV.last).read,
25
+ :clean => !opts.dirty?,
26
+ :images => opts.images?)
24
27
  end
@@ -78,9 +78,8 @@ module Distillery
78
78
  points += [element.text.length / 100, 3].min
79
79
 
80
80
  scores[element.path] = points
81
- parent = element.parent
82
- scores[parent.path] += points
83
- scores[parent.parent.path] += points.to_f/2
81
+ scores[element.parent.path] += points
82
+ scores[element.parent.parent.path] += points.to_f/2
84
83
  end
85
84
 
86
85
  augment_scores_by_link_weight!
@@ -91,22 +90,29 @@ module Distillery
91
90
  # @param [Hash] options Distillation options
92
91
  # @option options [Symbol] :dirty Do not clean the content element HTML
93
92
  def distill!(options = {})
94
- prep_for_distillation!
93
+ remove_irrelevant_elements!
94
+ remove_unlikely_elements!
95
+
95
96
  score!
96
- clean_top_scoring_elements! unless options.delete(:clean) == false
97
97
 
98
+ clean_top_scoring_elements!(options) unless options.delete(:clean) == false
98
99
  top_scoring_elements.map(&:inner_html).join("\n")
99
100
  end
100
101
 
101
102
  # Attempts to clean the top scoring node from non-page content items, such as
102
103
  # advertisements, widgets, etc
103
- def clean_top_scoring_elements!
104
+ def clean_top_scoring_elements!(options = {})
105
+ keep_images = !!options[:images]
106
+
104
107
  top_scoring_elements.each do |element|
108
+
105
109
  element.search("*").each do |node|
110
+ next if (node.name == 'img' || node.children.css('img').any?) && keep_images
106
111
  node.remove if has_empty_text?(node)
107
112
  end
108
113
 
109
114
  element.search("*").each do |node|
115
+ next if node.name == 'img' && keep_images
110
116
  if UNRELATED_ELEMENTS.include?(node.name) ||
111
117
  (node.text.count(',') < 2 && unlikely_to_be_content?(node))
112
118
  node.remove
@@ -115,13 +121,6 @@ module Distillery
115
121
  end
116
122
  end
117
123
 
118
- # Prepares the document for distillation by removing irrelevant and unlikely elements,
119
- # as well as corecomg some elements to paragraphs for scoring.
120
- def prep_for_distillation!
121
- remove_irrelevant_elements!
122
- remove_unlikely_elements!
123
- end
124
-
125
124
  private
126
125
 
127
126
  def scorable_elements
@@ -1,3 +1,3 @@
1
1
  module Distillery
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,812 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
3
+ <!--
4
+ generated 0 seconds ago
5
+ generated in 0.388 seconds
6
+ served from batcache in 0.019 seconds
7
+ expires in 300 seconds
8
+ -->
9
+ <head profile="http://gmpg.org/xfn/11">
10
+
11
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12
+ <title>Rhubarb Upside-Down Cake &laquo; All Things Simple</title>
13
+ <link rel="stylesheet" type="text/css" href="http://s0.wp.com/wp-content/themes/pub/bueno/style.css?m=1309109431g" media="screen" />
14
+ <link rel="pingback" href="http://allthingssimpleblog.com/xmlrpc.php" />
15
+
16
+ <!--[if IE 6]>
17
+ <script type="text/javascript" src="http://s0.wp.com/wp-content/themes/pub/bueno/includes/js/pngfix.js?m=1309109431g"></script>
18
+ <script type="text/javascript" src="http://s0.wp.com/wp-content/themes/pub/bueno/includes/js/menu.js?m=1309109431g"></script>
19
+ <link rel="stylesheet" type="text/css" media="all" href="http://s0.wp.com/wp-content/themes/pub/bueno/css/ie6.css?m=1309109431g" />
20
+ <![endif]-->
21
+
22
+ <!--[if IE 7]>
23
+ <link rel="stylesheet" type="text/css" media="all" href="http://s0.wp.com/wp-content/themes/pub/bueno/css/ie7.css?m=1309109431g" />
24
+ <![endif]-->
25
+
26
+ <link href="http://s0.wp.com/wp-content/themes/pub/bueno/styles/default.css?m=1309109431g" rel="stylesheet" type="text/css" />
27
+ <script src='http://wordpress.com/remote-login.php?action=js&amp;host=allthingssimpleblog.com&amp;id=13297415&amp;t=1311307093&amp;back=allthingssimpleblog.com%2F2011%2F07%2F19%2Frhubarb-upside-down-cake-2%2F' type="text/javascript"></script>
28
+ <script type="text/javascript">
29
+ /* <![CDATA[ */
30
+ if ( 'function' === typeof WPRemoteLogin ) {
31
+ document.cookie = "wordpress_test_cookie=test; path=/";
32
+ if ( document.cookie.match( /(;|^)\s*wordpress_test_cookie\=/ ) ) {
33
+ WPRemoteLogin();
34
+ }
35
+ }
36
+ /* ]]> */
37
+ </script>
38
+ <link rel="alternate" type="application/rss+xml" title="All Things Simple &raquo; Feed" href="http://allthingssimpleblog.com/feed/" />
39
+ <link rel="alternate" type="application/rss+xml" title="All Things Simple &raquo; Comments Feed" href="http://allthingssimpleblog.com/comments/feed/" />
40
+ <link rel="alternate" type="application/rss+xml" title="All Things Simple &raquo; Rhubarb Upside-Down&nbsp;Cake Comments Feed" href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/feed/" />
41
+ <script type="text/javascript">
42
+ /* <![CDATA[ */
43
+ function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
44
+ /* ]]> */
45
+ </script>
46
+ <link rel="stylesheet" href="http://s0.wp.com/wp-content/themes/h4/global.css?m=1309109352g" type="text/css" />
47
+ <link rel='stylesheet' id='sharedaddy-css' href='http://s1.wp.com/wp-content/mu-plugins/post-react-1/sharing/sharing.css?m=1309109333g&#038;ver=MU' type='text/css' media='all' />
48
+ <script type='text/javascript' src='http://s1.wp.com/wp-includes/js/l10n.js?m=1309109308g&amp;ver=20101110'></script>
49
+ <script type='text/javascript' src='http://s0.wp.com/wp-includes/js/jquery/jquery.js?m=1309109305g&amp;ver=1.6.1'></script>
50
+ <script type='text/javascript' src='http://s1.wp.com/wp-includes/js/comment-reply.js?m=1309109308g&amp;ver=20090102'></script>
51
+ <script type='text/javascript' src='http://s0.wp.com/wp-content/themes/pub/bueno/includes/js/general.js?m=1309109431g&amp;ver=MU'></script>
52
+ <script type='text/javascript' src='http://s0.wp.com/wp-content/themes/pub/bueno/includes/js/superfish.js?m=1309109431g&amp;ver=MU'></script>
53
+ <link rel='stylesheet' id='highlander-comments-css' href='http://s2.wp.com/wp-content/mu-plugins/highlander-comments/style.css?m=1309455920g&#038;ver=20110620' type='text/css' media='all' />
54
+ <!--[if lt IE 8]>
55
+ <link rel='stylesheet' id='highlander-comments-ie7-css' href='http://s0.wp.com/wp-content/mu-plugins/highlander-comments/style-ie7.css?m=1309109335g&#038;ver=20110606' type='text/css' media='all' />
56
+ <![endif]-->
57
+ <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://lbrisbo.wordpress.com/xmlrpc.php?rsd" />
58
+ <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://lbrisbo.wordpress.com/wp-includes/wlwmanifest.xml" />
59
+ <link rel='index' title='All Things Simple' href='http://allthingssimpleblog.com/' />
60
+ <link rel='prev' title='Kitchen Adventures: Homemade Dog&nbsp;Treats' href='http://allthingssimpleblog.com/2011/07/14/kitchen-adventures-homemade-dog-treats/' />
61
+ <meta name="generator" content="WordPress.com" />
62
+ <link rel='canonical' href='http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/' />
63
+ <link rel='shortlink' href='http://wp.me/pTNgr-kA' />
64
+ <link rel="alternate" type="application/json+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=json&url=http%3A%2F%2Fallthingssimpleblog.com%2F2011%2F07%2F19%2Frhubarb-upside-down-cake-2%2F&for=wpcom-auto-discovery" /><link rel="alternate" type="application/xml+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=xml&url=http%3A%2F%2Fallthingssimpleblog.com%2F2011%2F07%2F19%2Frhubarb-upside-down-cake-2%2F&for=wpcom-auto-discovery" /><link rel="shortcut icon" type="image/x-icon" href="http://s1.wp.com/i/favicon-stacked.ico?m=1309109303g" sizes="16x16 24x24 32x32 48x48" />
65
+ <link rel="icon" type="image/x-icon" href="http://s1.wp.com/i/favicon-stacked.ico?m=1309109303g" sizes="16x16 24x24 32x32 48x48" />
66
+ <link rel="apple-touch-icon" href="http://s0.wp.com/wp-content/themes/h4/i/webclip.png?m=1309109351g" />
67
+ <link rel='openid.server' href='http://lbrisbo.wordpress.com/?openidserver=1' />
68
+ <link rel='openid.delegate' href='http://lbrisbo.wordpress.com/' />
69
+ <link rel="search" type="application/opensearchdescription+xml" href="http://allthingssimpleblog.com/osd.xml" title="All Things Simple" />
70
+ <link rel="search" type="application/opensearchdescription+xml" href="http://wordpress.com/opensearch.xml" title="WordPress.com" />
71
+ <style type="text/css">
72
+ /* <![CDATA[ */
73
+ div#likes { margin-top: 15px; }
74
+ .like-button { border: 1px solid #eee; padding: 2px 6px; font-size: 13px; font-family: arial, tahoma, sans-serif; }
75
+ #wpl-likebox { clear: left; font-size: 11px; font-family: arial, tahoma, verdana, sans-serif !important; min-height: 30px; margin: 10px 0 !important; padding: 5px 0 10px 0 !important; }
76
+ #wpl-button { float: left; background: url( http://s0.wp.com/i/buttonbg.png ) top left repeat-x; margin-right: 7px; border: 1px solid #d4d4d4; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
77
+ #wpl-button a { border-bottom: none !important; color: #666 !important; line-height: 130% !important; text-decoration: none !important; outline: none; float: left; padding: 3px 6px 2px 24px !important; font-size: 11px !important; background: url( http://s1.wp.com/i/likestar.png ) 6px 49.8% no-repeat; }
78
+ #wpl-button a:hover { border-bottom: none !important; }
79
+ #wpl-button.liked { background: #feffce; border: 1px solid #f3e389; }
80
+ #wpl-button.liked a { color: #ba871b !important; }
81
+ #wpl-likebox #wpl-count { min-height: 25px; line-height: 130% !important; float: left; padding-top: 4px; }
82
+ #wpl-likebox #wpl-avatars { clear: left; max-height: 98px; overflow: hidden; margin-top: 15px; line-height: 130% !important; }
83
+ #wpl-likebox #wpl-avatars img { border: none !important; }
84
+ #wpl-likebox #wpl-mustlogin { line-height: 14px !important; font-size: 11px; clear: left; margin-top: 5px; background: #f0f0f0; padding: 10px; width: 65%; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
85
+ #wpl-likebox #wpl-mustlogin a { color: #888; text-decoration: underline; }
86
+ #wpl-likebox #wpl-mustlogin p { margin: 5px 0; padding: 0 }
87
+ #wpl-likebox #wpl-mustlogin input.input { padding: 2px; background: #fff; font-size: 11px; font-family: inherit; border: 1px solid #ccc; -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1) inset; -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1) inset; line-height: 12px; }
88
+ #wpl-likebox #wpl-mustlogin input#wp-submit { border: 1px solid #ccc; font-size: 11px; background: #fafafa; repeat-x; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; padding: 2px 4px !important; line-height: 12px; }
89
+ #wpl-likebox #wpl-mustlogin label { position: relative; cursor: text; }
90
+ #wpl-likebox #wpl-mustlogin label span { position: absolute; top: 0px; left: 5px; padding: 0 !important; }
91
+ #wpl-likebox #wpl-mustlogin label span { top /*\**/: -10px\9; }
92
+ /* ]]> */
93
+ </style>
94
+ <meta name="application-name" content="All Things Simple" /><meta name="msapplication-window" content="width=device-width;height=device-height" /><meta name="msapplication-task" content="name=Subscribe;action-uri=http://allthingssimpleblog.com/feed/;icon-uri=http://s1.wp.com/i/favicon-stacked.ico" /><meta name="msapplication-task" content="name=Sign up for a free blog;action-uri=http://wordpress.com/signup/;icon-uri=http://s2.wp.com/i/favicon.ico" /><meta name="msapplication-task" content="name=WordPress.com Support;action-uri=http://support.wordpress.com/;icon-uri=http://s2.wp.com/i/favicon.ico" /><meta name="msapplication-task" content="name=WordPress.com Forums;action-uri=http://forums.wordpress.com/;icon-uri=http://s2.wp.com/i/favicon.ico" />
95
+ <script type='text/javascript'>/*<![CDATA[*/if(typeof(addLoadEvent)!='undefined'){addLoadEvent(function(){if(top==self){i=document.createElement('img');i.src='http://botd.wordpress.com/botd.gif?blogid=13297415&postid=1276&lang=1&date=1311144479&ip=24.18.47.120&url=http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/&loc='+document.location;i.style.width='0px';i.style.height='0px';i.style.overflow='hidden';document.body.appendChild(i);}});}/*]]>*/</script>
96
+
97
+ <script type='text/javascript'>/*<![CDATA[*/if(typeof(addLoadEvent)!='undefined'){addLoadEvent(function(){if(top==self){i=document.createElement('img');i.src='http://botd2.wordpress.com/botd.gif?blog=13297415&post=1276&lang=en&date=1311144479&ip=24.18.47.120&url=http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/';i.style.width='0px';i.style.height='0px';i.style.overflow='hidden';document.body.appendChild(i);}});}/*]]>*/</script>
98
+
99
+ <link rel="stylesheet" type="text/css" href="http://s0.wp.com/?custom-css=1&#038;csblog=TNgr&#038;cscache=5&#038;csrev=92" />
100
+
101
+ </head>
102
+
103
+ <body class="single single-post postid-1276 single-format-standard typekit-enabled highlander-enabled highlander-light">
104
+
105
+ <div id="container">
106
+
107
+ <div id="navigation">
108
+
109
+ <div class="col-full">
110
+
111
+ <div id="description" class="fl"></div>
112
+
113
+ <div id="topsearch" class="fr">
114
+ <div id="search_main" class="widget">
115
+
116
+ <h3>Search</h3>
117
+
118
+ <form method="get" id="searchform" action="http://allthingssimpleblog.com">
119
+ <input type="text" class="field" name="s" id="s" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" />
120
+ <input type="submit" class="submit" name="submit" value="Search" />
121
+ </form>
122
+
123
+ <div class="fix"></div>
124
+
125
+ </div>
126
+ </div><!-- /#topsearch -->
127
+
128
+ </div><!-- /.col-full -->
129
+
130
+ </div><!-- /#navigation -->
131
+
132
+ <div id="header" class="col-full">
133
+
134
+ <div id="logo" class="fl">
135
+
136
+ <span class="site-title"><a href="http://allthingssimpleblog.com">All Things Simple</a></span>
137
+
138
+
139
+ </div><!-- /#logo -->
140
+
141
+ <div id="pagenav" class="nav fr">
142
+
143
+ <ul>
144
+
145
+ <li class="b page_item current_page_item"><a href="http://allthingssimpleblog.com">Home</a></li>
146
+
147
+ <li class="page_item page-item-270"><a href="http://allthingssimpleblog.com/about-2/" title="About">About</a></li>
148
+ <li class="page_item page-item-1296"><a href="http://allthingssimpleblog.com/recipes/" title="Recipes">Recipes</a></li>
149
+
150
+ <li class="rss"><a href="http://allthingssimpleblog.com/feed/">RSS</a></li>
151
+ </ul>
152
+
153
+
154
+ </div><!-- /#pagenav -->
155
+
156
+
157
+ </div><!-- /#header -->
158
+ <div id="content" class="col-full">
159
+ <div id="main" class="col-left">
160
+
161
+
162
+ <div class="post">
163
+
164
+ <h1 class="title">Rhubarb Upside-Down&nbsp;Cake</h1>
165
+
166
+ <p class="date">
167
+ <span class="day">19</span>
168
+ <span class="month">Jul</span>
169
+ </p>
170
+
171
+ <div class="entry">
172
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb1.jpg"><img class="aligncenter size-full wp-image-1277" title="Rhubarb1" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb1.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>I really love the taste of rhubarb, but I just haven&#8217;t been able to break away from my trusty rhubarb crisp routine. So when I happened upon <a href="http://www.marthastewart.com/344240/rhubarb-upside-down-cake" target="_blank">this recipe</a> for rhubarb upside-down cake, I just had to try it. This cake is really something special. The sour cream makes the batter so moist, and the orange zest adds an extra layer of flavor. But make no mistake&#8211;the rhubarb is still the star of the show.</p>
173
+ <p>Rhubarb comes in all shapes, sizes, and colors. Because of this, no two rhubarb upside-down cakes will come out looking the same. If symmetry and predictability is your thing, this may not be the recipe for you. You can try to position the rhubarb just perfectly, but when it cooks, chances are it will shift around a bit. There is something beautifully imperfect about this cake&#8211;just go with it!</p>
174
+ <p>The original recipe is from Martha Stewart, but I felt like there were a couple crucial steps left out of the written directions. Hopefully my additions help! Also, a quick note. I understand that some upside-down cakes can be made in a spring form pan. Unfortunately, a lot of liquid is released from the rhubarb when it is cooked, which may leak through the spring form and start a small fire in your oven. I may or may not know this from personal experience&#8230;</p>
175
+ <div>
176
+ <blockquote><p><strong>Rhubarb Upside-Down Cake<br />
177
+ </strong>Adapted from <a href="http://www.marthastewart.com/344240/rhubarb-upside-down-cake" target="_blank">Martha Stewart</a></p>
178
+ <p>Yield: 10 servings</p>
179
+ <ul>
180
+ <li><strong>For The Topping</strong></li>
181
+ <ul>
182
+ <li>4 tablespoons unsalted butter, melted</li>
183
+ <li>1/2 cup all-purpose flour</li>
184
+ <li>1/4 cup sugar</li>
185
+ <li>Coarse salt</li>
186
+ </ul>
187
+ </ul>
188
+ <ul>
189
+ <li><strong>For The Cake</strong>
190
+ <ul>
191
+ <li>1 1/2 sticks unsalted butter, room temperature, plus more for buttering pan</li>
192
+ <li>1 pound rhubarb, trimmed and cut on a very sharp diagonal about 1/2 inch thick</li>
193
+ <li>1 3/4 cups sugar</li>
194
+ <li>1 1/2 cups all-purpose flour</li>
195
+ <li>1 1/2 teaspoons baking powder</li>
196
+ <li>Coarse salt</li>
197
+ <li>1/2 teaspoon finely grated orange zest plus 1 tablespoon fresh orange juice</li>
198
+ <li>2 large eggs</li>
199
+ <li>1 cup sour cream</li>
200
+ </ul>
201
+ </li>
202
+ </ul>
203
+ <ol>
204
+ <li>Preheat oven to 350 degrees. <strong>Make the topping:</strong> Stir together butter, flour, sugar, and 1/4 teaspoon salt until moist and crumbly. Set aside in refrigerator until ready to use.</li>
205
+ <li><strong>Make the cake:</strong> Butter a 9-inch round cake pan (2 inches deep). Dot with 4 tablespoons butter (cut into pieces). Toss rhubarb with 3/4 cup sugar; let stand for 2 minutes. Toss again, and spread in pan with red side of the rhubarb facing down so it will show when the cake is flipped.</li>
206
+ <li>Whisk together flour, baking powder, and 1 1/2 teaspoons salt. Set flour mixture aside.</li>
207
+ <li>Beat remaining stick butter and cup sugar with a mixer on medium speed until pale and fluffy. Beat in orange zest and juice. Beat in eggs, 1 at a time, until incorporated, scraping down sides of bowl. Beat in flour mixture in 3 additions, alternating with sour cream, until smooth. Spread evenly over rhubarb. Crumble topping evenly over batter.</li>
208
+ <li>Bake until a toothpick inserted into the center comes out clean and top springs back when touched, about 1 hour. Let cool for 10 minutes. Run a knife around edge of cake, and invert onto a wire rack. Let cool completely.</li>
209
+ </ol>
210
+ <p>Let the cake cool for 10 minutes before removing it from the pan. The rhubarb will be too hot to handle safely right after baking. But if the cake sits much longer, it may stick.</p></blockquote>
211
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb6.jpg"><img class="aligncenter size-full wp-image-1281" title="Rhubarb6" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb6.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>The rhubarb I picked up from the farmers market was adorably small, so I had to pull quite a few stalks to make a pound.</p>
212
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb11.jpg"><img class="aligncenter size-full wp-image-1286" title="Rhubarb11" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb11.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>I chose the reddest rhubarb at the market, but this is just an aesthetic preference&#8211;greener rhubarb will taste just as good.</p>
213
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb10.jpg"><img class="aligncenter size-full wp-image-1285" title="Rhubarb10" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb10.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>Dot the butter in the pan and wedge in the rhubarb. If there is sugar left at the bottom of the bowl, sprinkle it on top of the rhubarb.</p>
214
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb8.jpg"><img class="aligncenter size-full wp-image-1283" title="Rhubarb8" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb8.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>The batter will be a little thick, so gently smooth it over the rhubarb with a spatula.</p>
215
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb7.jpg"><img class="aligncenter size-full wp-image-1282" title="Rhubarb7" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb7.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>The crumb &#8220;topping&#8221; will become the bottom of the cake once it is flipped.</p>
216
+ <p><a href="http://lbrisbo.files.wordpress.com/2011/07/rhubarb2.jpg"><img class="aligncenter size-full wp-image-1278" title="Rhubarb2" src="http://lbrisbo.files.wordpress.com/2011/07/rhubarb2.jpg?w=490&#038;h=326" alt="" width="490" height="326" /></a>Ta-da! Rhubarb upside-down cake in all its glory.</p>
217
+ </div>
218
+ <div class="snap_nopreview sharing robots-nocontent">
219
+ <ul>
220
+ <li class="sharing_label">Share this:</li>
221
+ <li class="share-facebook share-regular"><a rel="nofollow" class="share-facebook share-icon" href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/?share=facebook" target="_blank" title="Share on Facebook">Facebook</a></li>
222
+ <li class="share-twitter share-regular">
223
+ <div class="twitter_button"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwp.me%2FpTNgr-kA&#038;counturl=http%3A%2F%2Fallthingssimpleblog.com%2F2011%2F07%2F19%2Frhubarb-upside-down-cake-2%2F&#038;count=horizontal&#038;text=Rhubarb%20Upside-Down%20Cake: " style="width:97px; height:20px;"></iframe></div>
224
+ </li>
225
+ <li class="share-email share-regular"><a rel="nofollow" class="share-email share-icon" href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/?share=email" target="_blank" title="Click to email this to a friend">Email</a></li>
226
+ <li class="share-end"></li>
227
+ </ul>
228
+ <div class="sharing-clear"></div>
229
+ </div>
230
+ <p>Tags: <a href="http://en.wordpress.com/tag/dessert/" rel="tag">Dessert</a>, <a href="http://en.wordpress.com/tag/martha-stewart/" rel="tag">Martha Stewart</a>, <a href="http://en.wordpress.com/tag/rhubarb/" rel="tag">Rhubarb</a>, <a href="http://en.wordpress.com/tag/upside-down-cake/" rel="tag">Upside-Down Cake</a></p>
231
+ </div>
232
+
233
+ <div class="post-meta">
234
+
235
+ <ul>
236
+ <li class="comments">
237
+ <span class="head">Comments</span>
238
+ <span class="body"><a href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/#comments" title="Comment on Rhubarb Upside-Down&nbsp;Cake">4 Comments</a></span>
239
+ </li>
240
+ <li class="categories">
241
+ <span class="head">Categories</span>
242
+ <span class="body"><a href="http://en.wordpress.com/tag/recipes/" title="View all posts in Recipes" rel="category tag">Recipes</a></span>
243
+ </li>
244
+ <li class="author">
245
+ <span class="head">Author</span>
246
+ <span class="body"><a href="http://allthingssimpleblog.com/author/lbrisbo/" title="Posts by Lauren B." rel="author">Lauren B.</a></span>
247
+ </li>
248
+ </ul>
249
+
250
+ <div class="fix"></div>
251
+
252
+ </div><!-- /.post-meta -->
253
+
254
+ <div id="nav-below" class="navigation">
255
+ <div class="nav-previous"><a href="http://allthingssimpleblog.com/2011/07/14/kitchen-adventures-homemade-dog-treats/" rel="prev"><span class="meta-nav">&larr;</span> Kitchen Adventures: Homemade Dog&nbsp;Treats</a></div>
256
+ <div class="nav-next"></div>
257
+ </div><!-- #nav-below -->
258
+
259
+ </div><!-- /.post -->
260
+
261
+ <div id="wpl-likebox"><div id="wpl-button"><a href='http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/?like=1&amp;_wpnonce=4090751e9e' title='I like this post' class='like needs-login' rel='nofollow'><span>Like</span></a></div><div id="wpl-count">Be the first to like this post.</div></div>
262
+ <!-- You can start editing here. -->
263
+
264
+
265
+ <div id="comments">
266
+
267
+ <h3>4 Responses to &#8220;Rhubarb Upside-Down&nbsp;Cake&#8221;</h3>
268
+
269
+ <ol class="commentlist">
270
+
271
+
272
+ <li class="comment byuser comment-author-tzirelchana even thread-even depth-1 highlander-comment" id="li-comment-243">
273
+
274
+ <a name="comment-243"></a>
275
+
276
+ <div class="comment-container">
277
+
278
+ <div class="comment-head">
279
+
280
+
281
+ <div class="avatar"><img alt='' src='http://1.gravatar.com/avatar/35a3837110051f80baa1eea5993ae576?s=48&amp;d=identicon&amp;r=G' class='photo avatar avatar-48' height='48' width='48' /></div>
282
+
283
+
284
+ <span class="name"><a href='http://kosherhomecooking.com' rel='external nofollow' class='url url'>tzirelchana</a></span>
285
+
286
+
287
+ <span class="date">July 19, 2011 at 11:52 pm</span>
288
+ <span class="edit"></span>
289
+ <span class="perma"><a href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/#comment-243" title="Direct link to this comment">#</a></span>
290
+
291
+
292
+ <div class="fix"></div>
293
+
294
+ </div><!-- /.comment-head -->
295
+
296
+ <div class="comment-entry" id="comment-243">
297
+
298
+ <p>this sounds amazing. I can only get frozen rhubarb but I may try it.</p>
299
+
300
+
301
+ <div class="reply">
302
+ <a class='comment-reply-link' href='/2011/07/19/rhubarb-upside-down-cake-2/?replytocom=243#respond' onclick='return addComment.moveForm("comment-243", "243", "respond", "1276")'>Reply</a> </div><!-- /.reply -->
303
+
304
+ </div><!-- /comment-entry -->
305
+
306
+ </div><!-- /.comment-container -->
307
+
308
+ </li>
309
+
310
+ <li class="comment byuser comment-author-lbrisbo bypostauthor odd alt thread-odd thread-alt depth-1 highlander-comment" id="li-comment-244">
311
+
312
+ <a name="comment-244"></a>
313
+
314
+ <div class="comment-container">
315
+
316
+ <div class="comment-head">
317
+
318
+
319
+ <div class="avatar"><img alt='' src='http://1.gravatar.com/avatar/523cd3ccd404b03b9804508635d5e6f8?s=48&amp;d=identicon&amp;r=G' class='photo avatar avatar-48' height='48' width='48' /></div>
320
+
321
+
322
+ <span class="name"><a href='http://lbrisbo.wordpress.com' rel='external nofollow' class='url url'>Lauren B.</a></span>
323
+
324
+
325
+ <span class="date">July 20, 2011 at 8:42 am</span>
326
+ <span class="edit"></span>
327
+ <span class="perma"><a href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/#comment-244" title="Direct link to this comment">#</a></span>
328
+
329
+
330
+ <div class="fix"></div>
331
+
332
+ </div><!-- /.comment-head -->
333
+
334
+ <div class="comment-entry" id="comment-244">
335
+
336
+ <p>I think defrosted, frozen rhubarb would work wonderfully in this cake. Enjoy!</p>
337
+
338
+
339
+ <div class="reply">
340
+ <a class='comment-reply-link' href='/2011/07/19/rhubarb-upside-down-cake-2/?replytocom=244#respond' onclick='return addComment.moveForm("comment-244", "244", "respond", "1276")'>Reply</a> </div><!-- /.reply -->
341
+
342
+ </div><!-- /comment-entry -->
343
+
344
+ </div><!-- /.comment-container -->
345
+
346
+ </li>
347
+
348
+ <li class="comment byuser comment-author-amizercooks even thread-even depth-1 highlander-comment" id="li-comment-245">
349
+
350
+ <a name="comment-245"></a>
351
+
352
+ <div class="comment-container">
353
+
354
+ <div class="comment-head">
355
+
356
+
357
+ <div class="avatar"><img alt='' src='http://1.gravatar.com/avatar/9453a07aa7b7fcf2eb5d8d823f09431d?s=48&amp;d=identicon&amp;r=G' class='photo avatar avatar-48' height='48' width='48' /></div>
358
+
359
+
360
+ <span class="name"><a href='http://acookingmizer.wordpress.com' rel='external nofollow' class='url url'>Alice</a></span>
361
+
362
+
363
+ <span class="date">July 21, 2011 at 12:42 pm</span>
364
+ <span class="edit"></span>
365
+ <span class="perma"><a href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/#comment-245" title="Direct link to this comment">#</a></span>
366
+
367
+
368
+ <div class="fix"></div>
369
+
370
+ </div><!-- /.comment-head -->
371
+
372
+ <div class="comment-entry" id="comment-245">
373
+
374
+ <p>You should try this again with the caramel topping I made on my nectarine upside down cake (recipe on my blog of course), I think it could be pretty tasty for you, and it will help you to lay the rhubarb in a pattern that holds &#8211; if you would like of course, but this sounds pretty good too!</p>
375
+
376
+
377
+ <div class="reply">
378
+ <a class='comment-reply-link' href='/2011/07/19/rhubarb-upside-down-cake-2/?replytocom=245#respond' onclick='return addComment.moveForm("comment-245", "245", "respond", "1276")'>Reply</a> </div><!-- /.reply -->
379
+
380
+ </div><!-- /comment-entry -->
381
+
382
+ </div><!-- /.comment-container -->
383
+
384
+ <ul class='children'>
385
+
386
+ <li class="comment byuser comment-author-lbrisbo bypostauthor odd alt depth-2 highlander-comment" id="li-comment-246">
387
+
388
+ <a name="comment-246"></a>
389
+
390
+ <div class="comment-container">
391
+
392
+ <div class="comment-head">
393
+
394
+
395
+ <div class="avatar"><img alt='' src='http://1.gravatar.com/avatar/523cd3ccd404b03b9804508635d5e6f8?s=48&amp;d=identicon&amp;r=G' class='photo avatar avatar-48' height='48' width='48' /></div>
396
+
397
+
398
+ <span class="name"><a href='http://lbrisbo.wordpress.com' rel='external nofollow' class='url url'>Lauren B.</a></span>
399
+
400
+
401
+ <span class="date">July 21, 2011 at 2:31 pm</span>
402
+ <span class="edit"></span>
403
+ <span class="perma"><a href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/#comment-246" title="Direct link to this comment">#</a></span>
404
+
405
+
406
+ <div class="fix"></div>
407
+
408
+ </div><!-- /.comment-head -->
409
+
410
+ <div class="comment-entry" id="comment-246">
411
+
412
+ <p>Thanks for the tip, Alice! Your nectarine upside-down cake looks beautiful. I think you are right&#8211;if you omit the sugar in the rhubarb and use your caramel instead, the rhubarb would set a little better. What a great idea! I will definitely give this a try next time I make this cake. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif?m=1309109311g' alt=':)' class='wp-smiley' /> </p>
413
+
414
+
415
+ <div class="reply">
416
+ <a class='comment-reply-link' href='/2011/07/19/rhubarb-upside-down-cake-2/?replytocom=246#respond' onclick='return addComment.moveForm("comment-246", "246", "respond", "1276")'>Reply</a> </div><!-- /.reply -->
417
+
418
+ </div><!-- /comment-entry -->
419
+
420
+ </div><!-- /.comment-container -->
421
+
422
+ </li>
423
+ </ul>
424
+ </li>
425
+
426
+ </ol>
427
+
428
+ <div class="navigation">
429
+ <div class="fl"></div>
430
+ <div class="fr"></div>
431
+ <div class="fix"></div>
432
+ </div><!-- /.navigation -->
433
+
434
+ </div> <!-- /#comments_wrap -->
435
+
436
+
437
+
438
+
439
+
440
+
441
+ <div id="respond">
442
+ <h3 id="reply-title">Leave a Reply <small><a rel="nofollow" id="cancel-comment-reply-link" href="/2011/07/19/rhubarb-upside-down-cake-2/#respond" style="display:none;">Cancel reply</a></small></h3>
443
+ <form action="http://allthingssimpleblog.com/wp-comments-post.php" method="post" id="commentform">
444
+
445
+
446
+
447
+
448
+ <input type="hidden" name="hc_post_as" id="hc_post_as" value="guest" />
449
+
450
+ <div class="comment-form-field comment-textarea">
451
+ <label for="comment">Enter your comment here...</label>
452
+ <div id="comment-form-comment"><textarea id="comment" name="comment"></textarea></div>
453
+ </div>
454
+
455
+ <div id="comment-form-identity">
456
+
457
+ <div id="comment-form-nascar">
458
+ <ul>
459
+ <li class="selected"><a href="#comment-form-guest" title="Guest" id="postas-guest" class="social_buttons sb_24 sb_guest"><span>Guest</span></a></li>
460
+ <li><a href="#comment-form-wordpress" title="Log In" id="postas-wordpress" class="social_buttons sb_24 sb_wordpress"><span>Log In</span></a></li>
461
+ <li><a href="#comment-form-load-service:Twitter" title="Log In" id="postas-twitter" class="social_buttons sb_24 sb_twitter"><span>Log In</span></a></li>
462
+ <li><a href="#comment-form-load-service:Facebook" title="Log In" id="postas-facebook" class="social_buttons sb_24 sb_facebook"><span>Log In</span></a></li>
463
+ </ul>
464
+ </div>
465
+
466
+ <div id="comment-form-guest" class="comment-form-service selected">
467
+ <div class="comment-form-padder">
468
+ <div class="comment-form-avatar">
469
+ <img src="http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=25&d=mm" alt="Gravatar" width="25" class="no-grav" />
470
+ </div>
471
+
472
+ <div class="comment-form-fields">
473
+ <div class="comment-form-field comment-form-email">
474
+ <label for="email">Email <span class="required">(required)</span> <span class="nopublish">(Not published)</span></label>
475
+ <div class="comment-form-input"><input id="email" name="email" type="text" value="" /></div>
476
+ </div>
477
+ <div class="comment-form-field comment-form-author">
478
+ <label for="author">Name <span class="required">(required)</span></label>
479
+ <div class="comment-form-input"><input id="author" name="author" type="text" value="" /></div>
480
+ </div>
481
+ <div class="comment-form-field comment-form-url">
482
+ <label for="url">Website</label>
483
+ <div class="comment-form-input"><input id="url" name="url" type="text" value="" /></div>
484
+ </div>
485
+ </div>
486
+
487
+ </div>
488
+ </div>
489
+
490
+ <div id="comment-form-wordpress" class="comment-form-service">
491
+ <div class="comment-form-padder">
492
+ <div class="comment-form-avatar">
493
+ <img src="http://s2.wp.com/wp-content/mu-plugins/highlander-comments/images/wplogo.png?m=1309109334g" alt="WordPress.com Logo" width="25" class="no-grav" />
494
+ </div>
495
+
496
+ <div class="comment-form-fields">
497
+ <p id="wordpress-login-first">Please log in to WordPress.com to post a comment to your blog.</p>
498
+ <iframe id="wordpress-login-iframe" data-srcurl="http://lbrisbo.wordpress.com/wp-login.php?redirect_to=http%3A%2F%2Fallthingssimpleblog.com%2Fhighlander.login%2F&#038;action=highlander-login&#038;skin=light"></iframe>
499
+ </div>
500
+
501
+ </div>
502
+ </div>
503
+
504
+ <div id="comment-form-twitter" class="comment-form-service">
505
+ <div class="comment-form-padder">
506
+ <div class="comment-form-avatar">
507
+ <img src="http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=25&d=mm" alt="Twitter picture" width="25" class="no-grav" />
508
+ </div>
509
+
510
+ <div class="comment-form-fields">
511
+ <input type="hidden" name="twitter_avatar" id="twitter-avatar" class="comment-meta-twitter" value="" />
512
+ <input type="hidden" name="twitter_user_id" id="twitter-user_id" class="comment-meta-twitter" value="" />
513
+ <input type="hidden" name="twitter_access_token" id="twitter-access_token" class="comment-meta-twitter" value="" />
514
+ <p class="comment-form-posting-as"><strong></strong> You are commenting using your Twitter account. <span class="comment-form-log-out">(<a href="javascript:HighlanderComments.doExternalLogout( 'twitter' );">Log Out</a>)</span></p>
515
+ </div>
516
+
517
+ </div>
518
+ </div>
519
+
520
+ <div id="comment-form-facebook" class="comment-form-service">
521
+ <div class="comment-form-padder">
522
+ <div class="comment-form-avatar">
523
+ <img src="http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=25&d=mm" alt="Facebook photo" width="25" class="no-grav" />
524
+ </div>
525
+
526
+ <div class="comment-form-fields">
527
+ <input type="hidden" name="fb_avatar" id="facebook-avatar" class="comment-meta-facebook" value="" />
528
+ <input type="hidden" name="fb_user_id" id="facebook-user_id" class="comment-meta-facebook" value="" />
529
+ <input type="hidden" name="fb_access_token" id="facebook-access_token" class="comment-meta-facebook" value="" />
530
+ <p class="comment-form-posting-as"><strong></strong> You are commenting using your Facebook account. <span class="comment-form-log-out">(<a href="javascript:HighlanderComments.doExternalLogout( 'facebook' );">Log Out</a>)</span></p>
531
+ </div>
532
+
533
+ </div>
534
+ </div>
535
+
536
+
537
+ <div id="comment-form-load-service" class="comment-form-service">
538
+ <p>Connecting to %s</p>
539
+ </div>
540
+
541
+
542
+ </div>
543
+
544
+
545
+ <div id="comment-form-subscribe">
546
+ <p class="comment-subscription-form"><input type="checkbox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" tabindex="6"/> <label class="subscribe-label" id="subscribe-label" for="subscribe">Notify me of follow-up comments via email.</label></p></div>
547
+ <p class="form-submit">
548
+ <input name="submit" type="submit" id="comment-submit" value="Post Comment" />
549
+ <input type='hidden' name='comment_post_ID' value='1276' id='comment_post_ID' />
550
+ <input type='hidden' name='comment_parent' id='comment_parent' value='0' />
551
+ </p>
552
+
553
+ <input type="hidden" name="genseq" value="1311307093" />
554
+ <p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="5944935f1f" /></p><script type='text/javascript' src='http://s2.wp.com/wp-content/mu-plugins/akismet-2.5/form.js?m=1309109337g&amp;ver=1'></script>
555
+ <p style="display: none;"><input type="hidden" id="ak_js" name="ak_js" value="61"/></p> </form>
556
+ </div><!-- #respond -->
557
+ <div style="clear: both"></div>
558
+
559
+
560
+
561
+ </div><!-- /#main -->
562
+
563
+ <div id="sidebar" class="col-right">
564
+
565
+ <!-- Widgetized Sidebar -->
566
+ <div id="twitter-3" class="widget widget_twitter"><h3><a href='http://twitter.com/MissBrisbo'>My Tweets</a></h3><ul class='tweets'>
567
+ <li>@<a href='http://twitter.com/onefinedae'>onefinedae</a> Me too Linda, me too. Just holding out for tomorrow when there is allegedly supposed to be sun! <a href="http://twitter.com/MissBrisbo/statuses/94113705859620864" class="timesince">9&nbsp;hours&nbsp;ago</a></li>
568
+ <li>Interesting article about cold-brewing coffee and tea: <a href="http://nyti.ms/r31ACg" rel="nofollow">http://nyti.ms/r31ACg</a> <a href="http://twitter.com/MissBrisbo/statuses/93807304411066369" class="timesince">1&nbsp;day&nbsp;ago</a></li>
569
+ <li>@<a href='http://twitter.com/Michelle_Heng'>Michelle_Heng</a> thanks for the RT! Hope you have a chance to try it! <a href="http://twitter.com/MissBrisbo/statuses/93753083758256128" class="timesince">1&nbsp;day&nbsp;ago</a></li>
570
+ <li>Love this homemade cheese kit--mozzarella, ricotta, goat cheese, paneer, and queso blanco. Yes, please! <a href="http://t.co/3V8Rm2K" rel="nofollow">http://t.co/3V8Rm2K</a> <a href="http://twitter.com/MissBrisbo/statuses/93738390050185217" class="timesince">1&nbsp;day&nbsp;ago</a></li>
571
+ </ul>
572
+ </div> <div id="recent-posts-3" class="widget widget_recent_entries"> <h3>Latest Happenings </h3> <ul>
573
+ <li><a href="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/" title="Rhubarb Upside-Down&nbsp;Cake">Rhubarb Upside-Down&nbsp;Cake</a></li>
574
+ <li><a href="http://allthingssimpleblog.com/2011/07/14/kitchen-adventures-homemade-dog-treats/" title="Kitchen Adventures: Homemade Dog&nbsp;Treats">Kitchen Adventures: Homemade Dog&nbsp;Treats</a></li>
575
+ <li><a href="http://allthingssimpleblog.com/2011/07/10/cold-brewed-iced-coffee/" title="Cold-Brewed Iced&nbsp;Coffee">Cold-Brewed Iced&nbsp;Coffee</a></li>
576
+ <li><a href="http://allthingssimpleblog.com/2011/06/21/morel-and-spring-pea-pasta/" title="Morel and Spring Pea&nbsp;Pasta">Morel and Spring Pea&nbsp;Pasta</a></li>
577
+ <li><a href="http://allthingssimpleblog.com/2011/06/05/kitchen-adventures-bacon-jam/" title="Sweet and Salty Bacon&nbsp;Jam">Sweet and Salty Bacon&nbsp;Jam</a></li>
578
+ </ul>
579
+ </div><div id="archives-3" class="widget widget_archive"><h3>Archives</h3> <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value="">Select Month</option> <option value='http://allthingssimpleblog.com/2011/07/'> July 2011 &nbsp;(3)</option>
580
+ <option value='http://allthingssimpleblog.com/2011/06/'> June 2011 &nbsp;(2)</option>
581
+ <option value='http://allthingssimpleblog.com/2011/05/'> May 2011 &nbsp;(3)</option>
582
+ <option value='http://allthingssimpleblog.com/2011/04/'> April 2011 &nbsp;(6)</option>
583
+ <option value='http://allthingssimpleblog.com/2011/03/'> March 2011 &nbsp;(2)</option>
584
+ <option value='http://allthingssimpleblog.com/2011/02/'> February 2011 &nbsp;(2)</option>
585
+ </select>
586
+ </div><div id="linkcat-239025" class="widget widget_links"><h3>Simple Pleasures</h3>
587
+ <ul class='xoxo blogroll'>
588
+ <li><a href="http://joannagoddard.blogspot.com/">A Cup of Jo</a></li>
589
+ <li><a href="http://anthroholic.blogspot.com/">Anthroholic</a></li>
590
+ <li><a href="http://www.designspongeonline.com/">Design*Sponge</a></li>
591
+ <li><a href="http://effortlessanthropologie.blogspot.com/">Effortless Anthropologie</a></li>
592
+ <li><a href="http://www.deannablogs.blogspot.com/">Harper &amp; Henny</a></li>
593
+ <li><a href="http://torte-law.blogspot.com/">Intentional Tortes</a></li>
594
+ <li><a href="http://opinionator.blogs.nytimes.com/category/mark-bittman/">Mark Bittman</a></li>
595
+ <li><a href="http://www.ohjoy.blogs.com/">Oh Joy!</a></li>
596
+ <li><a href="http://onefinedae.typepad.com/">One Fine Dae</a></li>
597
+ <li><a href="http://seejaneworkplaylive.blogspot.com/">See Jane.</a></li>
598
+ <li><a href="http://smittenkitchen.com/">smitten kitchen</a></li>
599
+ <li><a href="http://sproutedkitchen.com">Sprouted Kitchen</a></li>
600
+
601
+ </ul>
602
+ </div>
603
+
604
+ </div><!-- /#sidebar -->
605
+ </div><!-- /#content -->
606
+
607
+ <div id="extended-footer">
608
+
609
+ <div class="col-full">
610
+
611
+ <div class="block one">
612
+
613
+
614
+ </div><!-- /.block -->
615
+
616
+ <div class="block two">
617
+
618
+
619
+ </div><!-- /.block -->
620
+
621
+ <div class="block three">
622
+
623
+
624
+ </div><!-- /.block -->
625
+
626
+ </div><!-- /.col-full -->
627
+
628
+ </div><!-- /#extended-footer -->
629
+
630
+ <div id="footer">
631
+
632
+ <div class="col-full">
633
+
634
+ <div id="copyright" class="col-left">
635
+ <p><a href="http://wordpress.com/?ref=footer" rel="generator">Blog at WordPress.com</a>.</p>
636
+ </div>
637
+
638
+ <div id="credit" class="col-right">
639
+ Theme: <a href="http://theme.wordpress.com/themes/bueno/">Bueno</a> by <a href="http://www.woothemes.com/" rel="designer">WooThemes</a>. </div>
640
+
641
+ </div><!-- /.col-full -->
642
+
643
+ </div><!-- /#footer -->
644
+
645
+ </div><!-- /#container -->
646
+ <script type="text/javascript">
647
+ // <![CDATA[
648
+ (function() {
649
+ try{
650
+ if ( window.external &&'msIsSiteMode' in window.external) {
651
+ if (window.external.msIsSiteMode()) {
652
+ var jl = document.createElement('script');
653
+ jl.type='text/javascript';
654
+ jl.async=true;
655
+ jl.src='/wp-content/plugins/ie-sitemode/custom-jumplist.php';
656
+ var s = document.getElementsByTagName('script')[0];
657
+ s.parentNode.insertBefore(jl, s);
658
+ }
659
+ }
660
+ }catch(e){}
661
+ })();
662
+ // ]]>
663
+ </script><script type="text/javascript">_qoptions={qacct:'p-18-mFEk4J448M',labels:'language.en,type.wpcom,posttag.dessert,posttag.martha-stewart,posttag.rhubarb,posttag.upside-down-cake'};</script>
664
+ <script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
665
+ <noscript><p><img class="robots-nocontent" src="http://pixel.quantserve.com/pixel/p-18-mFEk4J448M.gif?labels=language.en%2Ctype.wpcom%2Cposttag.dessert%2Cposttag.martha-stewart%2Cposttag.rhubarb%2Cposttag.upside-down-cake" style="display:none" height="1" width="1" alt="" /></p></noscript>
666
+ <script type="text/javascript">
667
+ /* <![CDATA[ */
668
+ jQuery( function() {
669
+
670
+ jQuery('#wpl-button > a.like').click( function(e) {
671
+ e.preventDefault();
672
+
673
+ jQuery('#wpl-mustlogin').remove();
674
+
675
+ jQuery.post( 'http://allthingssimpleblog.com/wp-admin/admin-ajax.php', {
676
+ 'action': 'wpl_record_stat',
677
+ 'stat_name': 'loggedout_like_click'
678
+ } );
679
+
680
+ var tenMins = new Date();
681
+ tenMins.setTime( tenMins.getTime() + 600000 );
682
+ document.cookie = 'wpl_rand=ae1dc8992c; expires=' + tenMins.toGMTString() + '; domain=wordpress.com; path=/;';
683
+
684
+ jQuery('#wpl-count').after( '\
685
+ <div id="wpl-mustlogin"> \
686
+ <form action="https://lbrisbo.wordpress.com/wp-login.php" method="post"> \
687
+ <p>Just one more step to like this post:</p> \
688
+ <label><span>Username</span> <input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="80" /></label> \
689
+ <label><span>Password</span> <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="81" /></label> \
690
+ <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="82" /> \
691
+ <input type="hidden" name="redirect_to" value="http://allthingssimpleblog.com/2011/07/19/rhubarb-upside-down-cake-2/?like=1" /> \
692
+ <input type="hidden" name="wpl_rand" value="ae1dc8992c" /> \
693
+ <p>Not a member yet? <a href="http://wordpress.com/signup/?ref=likebox" id="wpl-signup-link">Sign up with WordPress.com</a></p> \
694
+ </form> \
695
+ </div> \
696
+ ');
697
+
698
+ jQuery('#wpl-mustlogin').hide().slideDown('fast');
699
+ } );
700
+
701
+ jQuery('#wpl-mustlogin input.input').live( 'focus', function() {
702
+ jQuery(this).prev().hide();
703
+ }).live( 'blur', function() {
704
+ if ( jQuery(this).val() == '' )
705
+ jQuery(this).prev().show();
706
+ });
707
+
708
+ jQuery('#wpl-mustlogin input#wp-submit').live( 'click', function(e) {
709
+ e.preventDefault();
710
+
711
+ jQuery.post( 'http://allthingssimpleblog.com/wp-admin/admin-ajax.php', {
712
+ 'action': 'wpl_record_stat',
713
+ 'stat_name': 'loggedout_login_submit'
714
+ }, function() {
715
+ jQuery('#wpl-mustlogin form').submit();
716
+ } );
717
+ });
718
+
719
+ jQuery('#wpl-mustlogin a#wpl-signup-link').live( 'click', function(e) {
720
+ e.preventDefault();
721
+
722
+ var link = jQuery(this).attr('href');
723
+
724
+ jQuery.post( 'http://allthingssimpleblog.com/wp-admin/admin-ajax.php', {
725
+ 'action': 'wpl_record_stat',
726
+ 'stat_name': 'loggedout_signup_click'
727
+ }, function() {
728
+ location.href = link;
729
+ } );
730
+ });
731
+
732
+ });
733
+ /* ]]> */
734
+ </script>
735
+ <script type='text/javascript' src='http://s.gravatar.com/js/gprofiles.js?w&#038;ver=MU'></script>
736
+ <script type='text/javascript'>
737
+ /* <![CDATA[ */
738
+ var WPGroHo = {
739
+ my_hash: ""
740
+ };
741
+ /* ]]> */
742
+ </script>
743
+ <script type='text/javascript' src='http://s1.wp.com/wp-content/mu-plugins/gravatar-hovercards/wpgroho.js?m=1309109336g&amp;ver=MU'></script>
744
+ <div style="display:none">
745
+ <div class="grofile-hash-map-35a3837110051f80baa1eea5993ae576">
746
+ </div>
747
+ <div class="grofile-hash-map-523cd3ccd404b03b9804508635d5e6f8">
748
+ </div>
749
+ <div class="grofile-hash-map-9453a07aa7b7fcf2eb5d8d823f09431d">
750
+ </div>
751
+ </div>
752
+ <script type='text/javascript'>
753
+ /* <![CDATA[ */
754
+ var HighlanderComments = {
755
+ loggingInText: "Logging In&hellip;",
756
+ submittingText: "Posting Comment&hellip;",
757
+ postCommentText: "Post Comment",
758
+ connectingToText: "Connecting to %s",
759
+ commentingAsText: "%1$s: You are commenting using your %2$s account.",
760
+ logoutText: "Log Out",
761
+ loginText: "Log In",
762
+ connectURL: "http://lbrisbo.wordpress.com/public.api/connect/?action=request",
763
+ homeURL: "http://allthingssimpleblog.com/",
764
+ postID: "1276",
765
+ gravDefault: "identicon",
766
+ enterACommentError: "Please enter a comment",
767
+ enterEmailError: "Email address required",
768
+ invalidEmailError: "Invalid email address",
769
+ enterAuthorError: "Name required"
770
+ };
771
+ /* ]]> */
772
+ </script>
773
+ <script type='text/javascript' src='http://s0.wp.com/wp-content/mu-plugins/highlander-comments/script.js?m=1309455920g&amp;ver=20110616d'></script>
774
+ <script type='text/javascript' src='http://s2.wp.com/wp-content/mu-plugins/post-react-1/sharing/sharing.js?m=1309109333g&amp;ver=0.2'></script>
775
+ <div id="sharing_email" style="display: none;">
776
+ <form action="" method="post">
777
+ <label for="target_email">Send to Email Address</label>
778
+ <input type="text" name="target_email" id="target_email" value="" />
779
+
780
+
781
+ <label for="source_name">Your Name</label>
782
+ <input type="text" name="source_name" id="source_name" value="" />
783
+
784
+ <label for="source_email">Your Email Address</label>
785
+ <input type="text" name="source_email" id="source_email" value="" />
786
+
787
+
788
+ <div class="recaptcha" id="sharing_recaptcha"></div>
789
+ <img style="float: right; display: none" class="loading" src="http://lbrisbo.wordpress.com/wp-content/mu-plugins/post-react-1/sharing/images/loading.gif" alt="loading" width="16" height="16" />
790
+ <input type="submit" value="Send Email" class="sharing_send" />
791
+ <a href="#cancel" class="sharing_cancel">Cancel</a>
792
+
793
+ <div class="errors errors-1" style="display: none;">
794
+ Post was not sent - check your email addresses! </div>
795
+
796
+ <div class="errors errors-2" style="display: none;">
797
+ Email check failed, please try again </div>
798
+
799
+ <div class="errors errors-3" style="display: none;">
800
+ Sorry, your blog cannot share posts by email. </div>
801
+ </form>
802
+ </div>
803
+ <script type='text/javascript' src='http://platform.twitter.com/widgets.js?ver=20110531'></script>
804
+ <script type="text/javascript" src="http://b.scorecardresearch.com/beacon.js"></script><script type="text/javascript">try{COMSCORE.beacon({c1:2,c2:7518284});}catch(e){}</script><noscript><p class="robots-nocontent"><img src="http://b.scorecardresearch.com/p?cj=1c1=2&#038;c2=7518284" alt="" style="display:none" width="1" height="1" /></p></noscript><script src="http://s.stats.wordpress.com/w.js?19" type="text/javascript"></script>
805
+ <script type="text/javascript">
806
+ st_go({'blog':'13297415','v':'wpcom','user_id':'0','post':'1276','subd':'lbrisbo'});
807
+ ex_go({'crypt':'UE5XaFBLcG9pbC5FaS41aW9PdS02Y1d1Yn45Sy9maERLSTBqX1lnR3NPWHpNVGJ+WjlXcHFqZ0VraDROd3MwUis0SC10Tk9jLHpjJUR4cUFFPSZNYlRUWmVbLENWaWRnRC1jZ1JqS3gtRnpjZzFfWTE0eXhBdy9JUm1UMyZNNX4zaC40JXEmYWJfY1pwdERuLitlQX5ZLXxFRzcuKzEmKzZdN01ZbVhlbENYfkw9YlgrczgtbkkubFB2UVpQR1VUPVl5LX5teXNJY3prOWhjLGc2RG53VkFTYS94XVlfXXRYZEJ+bU5UcVNZPXNNQ3ZTTkU2YTZbV1gubnwsVWQtZmVQdlVj'});
808
+ addLoadEvent(function(){linktracker_init('13297415',1276);});
809
+ </script>
810
+
811
+ </body>
812
+ </html>
@@ -151,7 +151,8 @@ module Distillery
151
151
  describe 'clean_top_scoring_element!' do
152
152
  def doc_with_top_scored_html_of(markup, *postprocessing)
153
153
  markup = '<div class="winner">' + ('<p>foo,</p>'*5) + markup + '</div>'
154
- document_of(markup, *[:prep_for_distillation!, :score!].push(*postprocessing))
154
+ prep = [:remove_irrelevant_elements!, :remove_unlikely_elements!, :score!]
155
+ document_of(markup, *prep.push(*postprocessing))
155
156
  end
156
157
 
157
158
  it 'removes all empty elements' do
@@ -256,6 +257,12 @@ module Distillery
256
257
  doc.distill!.should_not =~ /Add to Recipe Box/
257
258
  end
258
259
 
260
+ it 'keeps images if the :images => true option is passed' do
261
+ doc = Document.new(File.open('./spec/fixtures/rhubarb.html').read)
262
+ ::Nokogiri::HTML.fragment(doc.dup.distill!).css('img').should be_empty
263
+ ::Nokogiri::HTML.fragment(doc.dup.distill!(:images => true)).css('img').should_not be_empty
264
+ end
265
+
259
266
  it 'works with a HTML document that has no winner' do
260
267
  document_of('foo').distill!.should == 'foo'
261
268
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distillery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-05-08 00:00:00.000000000 -07:00
12
+ date: 2011-07-21 00:00:00.000000000 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
17
- requirement: &2168823320 !ruby/object:Gem::Requirement
17
+ requirement: &2153036460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>'
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '1.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2168823320
25
+ version_requirements: *2153036460
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: slop
28
- requirement: &2168822640 !ruby/object:Gem::Requirement
28
+ requirement: &2153035960 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>'
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2168822640
36
+ version_requirements: *2153035960
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &2168821740 !ruby/object:Gem::Requirement
39
+ requirement: &2153035500 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>'
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '2.0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2168821740
47
+ version_requirements: *2153035500
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: guard
50
- requirement: &2168821200 !ruby/object:Gem::Requirement
50
+ requirement: &2153035120 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2168821200
58
+ version_requirements: *2153035120
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: guard-rspec
61
- requirement: &2168820180 !ruby/object:Gem::Requirement
61
+ requirement: &2153034660 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2168820180
69
+ version_requirements: *2153034660
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: ruby-debug19
72
- requirement: &2168811040 !ruby/object:Gem::Requirement
72
+ requirement: &2168463100 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *2168811040
80
+ version_requirements: *2168463100
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rb-fsevent
83
- requirement: &2168810540 !ruby/object:Gem::Requirement
83
+ requirement: &2168462680 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *2168810540
91
+ version_requirements: *2168462680
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: growl
94
- requirement: &2168809680 !ruby/object:Gem::Requirement
94
+ requirement: &2168462260 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *2168809680
102
+ version_requirements: *2168462260
103
103
  description: Distillery extracts the "content" portion out of an HTML document. It
104
104
  applies heuristics based on element type, location, class/id name and other attributes
105
105
  to try and find the content part of the HTML document and return it.
@@ -135,6 +135,7 @@ files:
135
135
  - spec/fixtures/js_this_keyword.html
136
136
  - spec/fixtures/nyt_social_media.html
137
137
  - spec/fixtures/pina_collada_cupcakes.html
138
+ - spec/fixtures/rhubarb.html
138
139
  - spec/fixtures/vanilla_pound_cake.html
139
140
  - spec/lib/distillery/document_spec.rb
140
141
  - spec/lib/distillery_spec.rb
@@ -178,6 +179,7 @@ test_files:
178
179
  - spec/fixtures/js_this_keyword.html
179
180
  - spec/fixtures/nyt_social_media.html
180
181
  - spec/fixtures/pina_collada_cupcakes.html
182
+ - spec/fixtures/rhubarb.html
181
183
  - spec/fixtures/vanilla_pound_cake.html
182
184
  - spec/lib/distillery/document_spec.rb
183
185
  - spec/lib/distillery_spec.rb