DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Snacktory – Yet another Readability clone. This time in Java.

Snacktory – Yet another Readability clone. This time in Java.

Peter Karussell user avatar by
Peter Karussell
·
Jul. 16, 11 · Java Zone · Interview
Like (0)
Save
Tweet
6.18K Views

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.

Popular on DZone

  • A Guide to Events in Vue
  • Data Visualization of Healthcare Expenses by Country Using Web Scraping in Python
  • Instancio: Random Test Data Generator for Java (Part 1)
  • Building a Kotlin Mobile App with the Salesforce SDK, Part 3: Synchronizing Data

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo