Metaculous

Full documentationAPI referenceAll releases and notes

Latest release

1.0.4

Date: github

README.md

Metadata helpers

A few simple helpers to generically add metadata tag (description, keywords) to your HTML pages, based on page content.

Website Full documentation

Installation

Composer (recommended)

$ composer install --save monomelodies/metaculous

Manual

Download or clone the files, and add /path/to/metaculous/src to your autoloader for classes in the Metaculous namespace.

Usage

Instantiate the Parser:

<?php

use Metaculous\Parser;

$parser = new Parser;

Generate a short description based on random text (e.g. page content from a database):

<?php

echo '<meta name="description" content="'.$parser->description($bodyText).'">';

Generate top 10 keywords based on the same text:

<?php

echo '<meta name="keywords" content="'.implode(', ', $parser->keywords($bodyText)).'">';

Of course, you could also use the keywords to e.g. display a tag cloud.