Giter Club home page Giter Club logo

opengraph-generator's Introduction

opengraph-generator

Open Graph Protocol implementation for Java. Based on the specifications at http://ogp.me/. Still in development.

EXAMPLE OF USE

There is a quickly and easy example of use of this library in the main method of the OpenGraphGenerator.java main class

public static void main(String[] args) {
  OpenGraphGenerator ogg = new OpenGraphGenerator();
  ogg.setArticleType();
  ogg.setTitle("Repositorios DSpace con múltiples contextos OAI-PMH");
  ogg.setLocale("es");
  ogg.addAlternativeLocale("en");
  ogg.addAlternativeLocale("pt");
  ogg.addAlternativeLocale("fr");
  ogg.addAlternativeLocale("jp");
  ArticleType article = (ArticleType) ogg.getType();
  article.addAuthor("https://www.researchgate.net/profile/Facundo_Adorno");
  article.addAuthor("https://www.researchgate.net/profile/Ariel_Lira");
  article.addAuthor("https://www.researchgate.net/profile/Marisa_De_Giusti");
  article.setPublishedTime("2014-11");
  article.addTag("DSpace"); article.addTag("xoai"); article.addTag("SEDICI"); article.addTag("data provider");
  for (OpenGraphMetadata ogm : ogg.getAllObjectMetadata()) {
	  System.out.println(ogm.print());
  }
}

The output of above code is

property = "og:locale:alternate" content = "pt" 
property = "og:locale:alternate" content = "en" 
property = "og:locale:alternate" content = "jp" 
property = "og:locale:alternate" content = "fr" 
property = "og:type" content = "article" 
property = "og:title" content = "Repositorios DSpace con múltiples contextos OAI-PMH" 
property = "og:locale" content = "es" 
property = "article:author" content = "https://www.researchgate.net/profile/Facundo_Adorno" 
property = "article:author" content = "https://www.researchgate.net/profile/Ariel_Lira" 
property = "article:author" content = "https://www.researchgate.net/profile/Marisa_De_Giusti" 
property = "article:published_time" content = "2014-11" 
property = "article:tag" content = "DSpace" 
property = "article:tag" content = "xoai" 
property = "article:tag" content = "SEDICI" 
property = "article:tag" content = "data provider"

opengraph-generator's People

Contributors

facundoadorno avatar

Watchers

 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.