Snacktory – Yet another Readability clone. This time in Java.
Join the DZone community and get the full member experience.
Join For Free
for
jetslide
i needed a
readability
java clone. there are already some tools, but i wanted some more and other features so i adapted the existing
goose
and
jreadability
and added some stuff. check out the detection quality at
jetslide
and
fork
it to improve it – since today snacktory is free software
!
copied from the readme:
snacktory
this is a small helper utility for pepole don’t want to
write yet another java clone of readability. in most cases, this is
applied to articles, although it should work for any website to find its
major area and extract its text and its important picture. have a look
into
jetslide
where snacktory is used.
jetslide is a new way to consume news, it does not only display the
websites’ title but it displays a small preview of the site (‘a snack’)
and the important image if available.
license
the software stands under apache 2 license and comes with no warranty
features
snacktory borrows some ideas from
jreadability
and
goose
(ideas + a lot test cases)
the advantages over jreadability are
- better article text detection than jreadability
- only java deps
- more tests
the advantages over goose are
- similar article text detection although better detection for none-english sites (german, japanese, …)
- snacktory does not depend on the word count in its text detection to support cjk languages
- no external services required to run the core tests => faster tests
- better charset detection
- with caching support
- skipping some known filetypes
the disadvantages to goose are
- only the detection of the top image and the top text is supported at the moment
- some tests which passed do not pass. but added a bunch of other useful sites (stackoverflow, facebook, other languages …)
usage
htmlfetcher fetcher = new htmlfetcher(); // set cache. e.g. take the map implementation from google collections: // fetcher.setcache(new mapmaker().concurrencylevel(20). // maximumsize(count).expireafterwrite(minutes, timeunit.minutes).makemap(); jresult res = fetcher.fetchandextract(url, resolvetimeout, true); res.gettext(); res.gettitle(); res.getimageurl();
from http://karussell.wordpress.com/2011/07/12/snacktory-yet-another-readability-clone-this-time-in-java/
Java (programming language)
Clone (Java method)
Opinions expressed by DZone contributors are their own.
Comments