• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatically extract the main text content (and more) from an HTML document

essence

Maven Central All Contributors

An automatic web page content extractor for Kotlin and Java.

Given an HTML document, essence automatically extracts the main text content (and much more).

Try out the demo - a simple webapp to demonstrate essence.

This library is inspired by node-unfluff and its lineage

Usage

Java

import io.github.cdimascio.essence.Essence;

EssenceResult data = Essence.extract(html);
System.out.println(data.getText());

Kotlin

val data = Essence.extract(html)
println(data.text)

See Extracted data elements for additional extracted metadata.

Install

Maven

<dependency>
  <groupId>io.github.cdimascio</groupId>
  <artifactId>essence</artifactId>
  <version>0.13.0</version>
  <type>pom</type>
</dependency>

Gradle

compile 'io.github.cdimascio:essence:0.13.0'

Try the Essence web demo

Essence web is a simple web page that fetches content at a given url and passes the HTML to this essence library.

The essence web project lives here

Extracted data elements

essence attempts to extract the following content:

  • title - The document's title
  • softTitle - A version of title with less truncation
  • date - The document's publication date
  • copyright - The document's copyright line, if present
  • author - The document's author
  • publisher - The document's publisher (website name)
  • text - The main text of the document with all the junk thrown away
  • image - The main image for the document (what's used by facebook, etc.)
  • (coming soon...)videos - An array of videos that were embedded in the article. Each video has src, width and height.
  • tags- Any tags or keywords that could be found by checking <rel> tags or by looking at href urls.
  • canonicalLink - The canonical url of the document, if given.
  • lang - The language of the document, either detected or supplied by you.
  • description - The description of the document, from <meta> tags
  • favicon - The url of the document's favicon.
  • links - An array of links embedded within the article text. (text and href for each)

Credits

License

Apache 2.0

Buy Me A Coffee

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Clรฉment P.

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

express-openapi-validator

๐Ÿฆ‹ Auto-validates api requests, responses, and securities using ExpressJS and an OpenAPI 3.x specification
TypeScript
914
star
2

generator-express-no-stress

๐Ÿš‚ A Yeoman generator for Express.js based 12-factor apps and apis
JavaScript
579
star
3

dotenv-kotlin

๐Ÿ—๏ธ Dotenv is a module that loads environment variables from a .env file
Kotlin
414
star
4

generator-express-no-stress-typescript

๐Ÿš„ A Yeoman generator for Express.js based 12-factor apps and apis using Typescript
TypeScript
348
star
5

dotenv-java

๐Ÿ—๏ธ Dotenv is a no-dep, pure Java module that loads environment variables from a .env file
Java
308
star
6

py-readability-metrics

๐Ÿ“— Score text readability using a number of formulas: Flesch-Kincaid Grade Level, Gunning Fog, ARI, Dale Chall, SMOG, and more
Python
281
star
7

kotlin-openapi-spring-functional-template

๐Ÿƒ Kotlin Spring 5 Webflux functional application with api request validation and interactive api doc
Kotlin
177
star
8

uuid-mongodb

๐Ÿ“‡ Generates and parses MongoDB BSON UUIDs
JavaScript
97
star
9

openapi-spring-webflux-validator

๐ŸŒฑ A friendly kotlin library to validate API endpoints using an OpenApi 3.0 and Swagger 2.0 specification
Kotlin
93
star
10

node-mongodb-fixtures

๐Ÿ Setup and tear down test fixtures with MongoDB.
JavaScript
90
star
11

lambda-zsh-theme

ฮป Beautiful lambda theme for Zsh
58
star
12

nationalparks_conversation

Chatbots and Watson: Letโ€™s talk about national parks: course source code
JavaScript
46
star
13

java-dotenv

Use dotenv-java or dotenv-kotlin https://github.com/cdimascio/dotenv-java or https://github.com/cdimascio/dotenv-kotlin instead
24
star
14

kotlin-spring-mvc-template

12-factor compliant Spring MVC Kotlin template. Features automatic request/response validation and interactive API doc
Kotlin
22
star
15

react-native-share-sheet

iOS share sheet for React Native
Objective-C
11
star
16

dbpedia-sparql-client

A promisified DBpedia SPARQL client that keeps it simple.
JavaScript
10
star
17

express-openapi-validator-example

simple openapi validation examplewith express-openapi-validator
JavaScript
9
star
18

watson-nlc-spam

Create a spam classifier with Watson Natural Language Classifier.
CSS
9
star
19

gin-openapi

Automatically validates API requests against an OpenAPI 3 spec.
Go
6
star
20

cloudant-upsert

A no-dependency module that adds 'upsert' to Node.js Cloudant
JavaScript
5
star
21

couchinator

๐Ÿ›‹๏ธ Fixtures for CouchDB and IBM Cloudant: Create and teardown cloudant dbs
JavaScript
5
star
22

japi-errors

โšกCustomizable errors for RESTful and HTTP services.
Java
4
star
23

md5-nodejs

A node module that hashes data to MD5.
JavaScript
4
star
24

mongoose-compose-example

An example to quickly get your up and running with Mongoose and MongoDB on IBM Compose.io.
JavaScript
4
star
25

ya-angular-requirejs-seed

Seed for AngularJs and require.js
JavaScript
3
star
26

essence-web

JavaScript
3
star
27

couchinator-java-wrapper

Fixtures for CouchDB and IBM Cloudant.
Java
3
star
28

sqs-replay

โ™ป๏ธ CLI that replays AWS SQS messages between queues.
Rust
2
star
29

my-projects

A list of newsworthy projects that I led or was key contributor
2
star
30

md5-to-uuid

A node module that converts MD5 hashes to UUIDs.
JavaScript
2
star
31

aws-config-manager

Manage multiple AWS credentials and config files
Go
2
star
32

wcp-errors

Generate normalized http error messages
JavaScript
2
star
33

express-no-stress-openapi3-example

JavaScript
2
star
34

bunyan-decorator

bunyan log decorator for es6 class methods
JavaScript
1
star
35

java-dotenv-example

Java
1
star
36

scripts

Shell
1
star
37

aws-credentials-manager

Utility for managing multiple AWS credentials files.
Shell
1
star
38

woh-deploy

CSS
1
star
39

homebrew-tap

Ruby
1
star
40

rails-example

Ruby
1
star
41

docker-images

Dockerfile
1
star
42

lerna-test

JavaScript
1
star
43

flagger-on

๐Ÿฆฉ fast, feature flags with percentage rollout
TypeScript
1
star
44

keras_nns

Python
1
star
45

cdimascio.github.io

Personal website
CSS
1
star
46

nlu-news-web

Sample application using Watson Natural Language Understand and IBM Cloud Functions
JavaScript
1
star
47

mixpanel-export-java

Lightweight export library for Mixpanel
Java
1
star
48

node-api-errors

JavaScript
1
star
49

cdimascio-card

๐Ÿ“› Carmine's card
JavaScript
1
star
50

me-web

JavaScript
1
star
51

vue-webqr

JavaScript
1
star
52

ballparks

Source code for developerWorks article: Create a baseball-themed app powered by Weather Company Data for IBM Bluemix and DBpedia
JavaScript
1
star