Skip to content

charleshope/opengrape

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenGrape is a Java-based Open Graph parser

The Open Graph Protocol is a metadata standard that enables services, like social media applications, to fetch previews of webpages, such as thumbnail images and summaries.

This Orbit Earth OpenGrape is a friendly fork of the excellent Kientux OpenGrape, which is a Java port of the Swift OpenGraph.

Installation

Unlike Kientux OpenGrape, this version is not hosted in a public Maven repository, but must be built and installed locally using mvn install.

<dependency>
    <groupId>social.orbitearth</groupId>
    <artifactId>opengrape</artifactId>
    <version>2.0.1</version>
</dependency>

Usage

OpenGrape og = new OpenGrape();
Map<OpenGrapeMetadata, String> metadata = og.fetch("https://opengraphprotocol.org/");
String title = metadata.get(OpenGrapeMetadata.TITLE);
System.out.println(title);

Versions

  • 1.0.0 Initial fork
  • 1.0.1 Added Slf4j logging
  • 1.0.2 New user agent that works more broadly
    • Java 17
  • 2.0.0 Changed OpenGrape class from static to instance
    • Handles Youtube urls
    • Removed the removal of trailing / from urls.
  • 2.0.1 Succeeds against some Twitter pages it couldn't parse before, because parsing now uses JSoup.
    • Uses maven assembly jar to bundle dependencies Slf4j, JSoup.

About

Java wrapper for Open Graph protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%