2017 © Pedro Peláez
 

craft-plugin ogcrawler

Fetches some basic OpenGraph data from a URL.

image

kristoffer1lundberg/ogcrawler

Fetches some basic OpenGraph data from a URL.

  • Tuesday, April 10, 2018
  • by kristoffer1lundberg
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ogCrawler

Fetches some basic OpenGraph data from a URL and makes it accessible from a Twig variable., (*1)

Requirements

This plugin requires Craft CMS 3.0.0 or later., (*2)

Installation

To install the plugin, follow these instructions., (*3)

  1. Open your terminal and go to your Craft project:, (*4)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*5)

    composer require kristoffer1lundberg/ogcrawler
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for ogCrawler., (*6)

Usage

{# Check OpenGraph data from a URL #}
{# If unsuccessful, your variable will return false #}
{% set ogData = craft.ogCrawler.getUrl('http://www.imdb.com/title/tt0056732/') %}

{% if ogData %}
    Print some data here, for example:
    {% if ogData.image is defined %}
        <img src="{{ ogData.image }}" alt="">
    {% endif %}
{% endif %}

Available properties

description, (*7)

image, (*8)

site_name, (*9)

title, (*10)

type, (*11)

Credit

Based on the OpenGraph Protocol Helper by Scott MacVicar, (*12)

The Versions

10/04 2018

dev-master

9999999-dev

Fetches some basic OpenGraph data from a URL.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft ogcrawler