在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:karussell/snacktory开源软件地址:https://github.com/karussell/snacktory开源编程语言:HTML 98.3%开源软件介绍:FutureSnacktory is no longer actively maintained by @karussell. Crux is a fork under active development and is the recommended alternative.
SnacktoryThis is a small helper utility for people who 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, extract its text, keywords, its main picture and more. The resulting quality is high, even paper.li uses the core of snacktory. Also have a look into this article, it describes a news aggregator service which uses snacktory. But jetslide is no longer online. Snacktory borrows some ideas and a lot of test cases from goose and jreadability: LicenseThe software stands under Apache 2 License and comes with NO WARRANTY Features
TODOs
UsageInclude the repo at: https://github.com/karussell/mvnrepo Then add the dependency <dependency>
<groupId>de.jetwick</groupId>
<artifactId>snacktory</artifactId>
<version>1.1</version>
<!-- or if you prefer the latest build <version>1.2-SNAPSHOT</version> -->
</dependency> If you need this for Android be sure you read this issue. Or, if you prefer, you can use a build generated by jitpack.io. Now you can use it as follows: 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(articleUrl, resolveTimeout, true);
String text = res.getText();
String title = res.getTitle();
String imageUrl = res.getImageUrl(); Buildvia Maven. Maven will automatically resolve dependencies to jsoup, log4j and slf4j-api |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论