GithubHelp home page GithubHelp logo

gander's Introduction

#Gander Build Status ![Coverage Status] (https://img.shields.io/coveralls/intenthq/gander.svg) Maven Central Join the chat at https://gitter.im/intenthq/gander

Gander is a scala library that extracts metadata and content from web pages.

It is based on Goose with the idea to:

  • Simplify its codebase by removing some of its functionality (like crawling, there are plenty of project that do it well)
  • Keep it alive (goose has been inactive for several years now)
  • Make its codebase more functional and take advantage of some of newer scala features

What data does it extract?

Gander will try to extract three different kinds of data from a web page:

  • Metadata: (title, meta description, meta keywords, language, canonical link, open graph data, publish date)
  • Main text for the page
  • Links present in the main text of the page

Using Gander

Adding the dependency

The artefact is published in maven central. If you are using sbt you just need to add the following line (remember to replace 1.0 with the latest version):

"com.intenthq" % "gander" % "1.0"

In your code

Gander provides a single object and a single method to access its functionality and it's pretty straightforward and intuitive to use.

This three lines of code, for example, will download the specified url (using Guava) and extract the page information from the raw html:

val url = "http://engineering.intenthq.com"
val rawHTML = Resources.toString(new URL(url), charset)
println(Gander.extract(rawHTML))

You can find more examples in our tests.

Philosophy

The idea behind Gander is to do one thing and do it well. That's why we've removed some of the features that were not related to its core functionality.

This project will always try to be better at extracting data and information from webpages. But it won't deal with other (probably related but not core) functionalities (like downloading html from urls).

Collaborate

Please, feel free to raise an issue, fork the repo, send pull requests... Any idea or improvement will be welcome.

gander's People

Contributors

jiminoc avatar raisercostin avatar albertpastrana avatar erraggy avatar skyshard avatar artursoler avatar dhepper avatar david-cliqz avatar marcosinger avatar pvdlg avatar nator avatar andrewlin12 avatar warrd avatar bsravanin avatar tomazk avatar nebm51 avatar malax avatar aurality avatar darthbear avatar qu1j0t3 avatar theodorelee avatar jaytaylor avatar andhapp avatar ivgiuliani avatar mneedham avatar jasongoodwin avatar sha0h0ng avatar jordanburke avatar umars avatar sakulk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.