busk-ruby-readability 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/readability.rb +37 -41
- data/spec/fixtures/cant_read.html +426 -0
- data/spec/fixtures/sample.html +1198 -0
- data/spec/fixtures/samples/channel4-1-fragments.rb +14 -0
- data/spec/fixtures/samples/channel4-1.html +1330 -0
- data/spec/fixtures/samples/globemail-ottawa-cuts-fragments.rb +31 -0
- data/spec/fixtures/samples/globemail-ottawa-cuts.html +2410 -0
- data/spec/fixtures/should_not_truncate.txt +1077 -0
- data/spec/fixtures/vimeo.com.html +1072 -0
- data/spec/readability_spec.rb +199 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +13 -0
- metadata +17 -4
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
# This sample originally from http://www.channel4.com/news/articles/world/judge+rules+briton+can+be+forcefed/3578372
|
3
|
+
|
4
|
+
$required_fragments = [
|
5
|
+
"Judge rules Briton can be force-fed", # headline
|
6
|
+
"A US judge has ruled that prison officials may continue force-feeding a Briton who began a hunger strike in September 2007 over claims he was convicted on a fabricated sexual assault charge.",
|
7
|
+
"William Coleman, reportedly originally from Liverpool, who is serving an eight-year sentence for rape, said he began his hunger strike to protest against a corrupt judicial system.",
|
8
|
+
"The state of Connecticut began force-feeding Coleman in September 2008 after he stopped accepting fluids, but he argued that the feedings violate his right of free speech."
|
9
|
+
]
|
10
|
+
|
11
|
+
$excluded_fragments = [
|
12
|
+
"Share this article" # ideally this would not be present
|
13
|
+
|
14
|
+
]
|