JGE Automatic Content Generator
Amazing new PHP script takes the hassles out of writing contents for your website.

Launch JGE Automatic Content Generator interactive demo
See JGE Automatic Content Generator pricing info

JGE Automatic Content Generator is a PHP script that adds high quality and relevant auto content to your existing web pages. Only one time configuration is required and then it runs on its own.

Recent SEO consensus estimates suggest that your article's size should be between 4 and 5 windows worth of text. If your articles are shorter, then you can greatly benefit from the use of the JGE Automatic Content Generator which is a PHP script that will automatically add relevant high quality content to your current web pages. Here is how our article generator works - we perform semantic analysis of your existing content to find essential keywords and then pull content relevant to these keywords from free services. Retrieved articles are then cached to minimize impact of this task on your website's performance. In this process we employ the latest and greatest in the semantic web technologies, for example Linked Data and Natural Language Processing capabilities of Calais. This tool uses content/articles actually written by people so the added content is 100% readable. The final result is that our article generator makes your web pages larger and with more content for your visitors to enjoy.

Please see the JGE Automatic Content Generator demo to find out what kind of results to expect. This demo page includes an input form where you can paste some of your existing content/articles and see what kind of additional content is generated by our script. The complete and commented in details source code for this demo is included in the product download. For more examples of the content generated by our article generator browse our directory of software. You will that that most of our software titles have automatically generated articles placed below the description of the software.

NOTE: All of the html output formatting is controllable by the user to avoid any kind of signature of this product that the search engines could detect!

As a bonus feature our article generator script returns also a list of suggested social tags for your original content.

How to integrate the JGE Automatic Content Generator into your pages.

The following example demonstrates the standard use of the JGE Automatic Content Generator script. Please see how all of the html output formatting is controlled from the user level code so you can integrate easily with any website.

// Add JGE library folder to the include path. You will have to modify this line to reflect
// your directory structure. Alternatively you could just add the 'JGE' folder to your PHP path
// in php.ini.
realpath('relative-path-to-the-JGE-folder'), get_include_path())));

// Include the JGE_Automatic_Content_Generator class file. 

// Create the workhorse object
$jge = new JGE_Automatic_Content_Generator();

// Required call - set your Calais api key.
// Visit http://www.opencalais.com/APIkey if you do not have the key. You have to insert your key
// in the line below. 

// All of the heavy lifting is done here.
    // The $content variable passed to the call contains the contents of the article on your web 
    //page. Usually this data comes from a database. Articles with embedded HTML are OK.
$result $jge->processContent($content);
catch (
Exception $e)
// Something went wrong
    // Keep the line below during the testing phase so you can read the diagnostic messages and
    // address all of the problems.
echo '<p>Exception in JGE Automatic Content Generator: ' $e->getMessage() . '</p>';
$result null;

if (
$result != null// Check if any results were returned
// Check if any tags are returned and if so show them as a list.
    // The tags are already ordered based on their importance.
if (count($result->tags) > 0)
// Create a <ul> container for the list of tags. The id used here needs to match your css file.
echo '<ul id="jge_automatic_content_generator_tags_ul">';
// Process all tags.
foreach ($result->tags as $tag)
'<li class="jge_automatic_content_generator_tags_li">' $tag '</li>';

// Close the <ul> container for the list of tags. The id used here needs to match your css file.
echo '</ul>';
// Check if any articles are returned and if so display them.
if (count($result->articles) > 0)
// Create a <div> container for the articles. The id used here needs to match your css file.
echo '<div id="jge_automatic_content_generator_articles_div">';
// Process all articles.
foreach ($result->articles as $name => $data
// For each article call the formatting function. You may want to create
            // your own version of formatArticle to format the article differently, 
            // for example to abbreviate it or to use different css class names.
$block formatArticle($name$data);
// Close the <div> container for the articles.
echo '</div>';

The user supplied format function used in the code above is very important for good presentation of your articles and visually appealing blending with other content on your website. Here is an example implementation of the formatting functionality for our content generator.

function formatArticle($name$data)
$text =  '<div class="jge_automatic_content_generator_article_div">';
// Display the official name of the article's topic (if set)
if (isset($data["officialName"]))
$text .= ('<h3 style="text-transform:capitalize">' $name 
' (' $data["officialName"]. ')</h3>');
$text .= ('<h3 style="text-transform:capitalize">' $name '</h3>');
// Show the image with all required attributes - Google really wants you to use 
    // the 'alt' attribute
$text .= ('<img class="jge_automatic_content_generator_article_image" title="'
$name '" alt="' $name '" src="' $data["image"] . '" />');
//optionally avoid h1 and h2 in the article    
$raw preg_replace('/<h2(.*?)>(.*?)<\/h2>/i''<h3>$2</h3>'$data["article"]);
$raw preg_replace('/<h1(.*?)>(.*?)<\/h1>/i''<h3>$2</h3>'$raw);
$text .= $raw;
//optionally show a link to the source of the data
$text .= ('<a href="' $data["moreInfo"] . '" target="_blank" rel="nofollow">Read more about ' 
$name ' on freebase.com</a>');
$text .= '<br style="clear:both" /></div>';

JGE_Automatic_Content_Generator class.

JGE_Automatic_Content_Generator class synopsis is given below.

// JGE_Automatic_Content_Generator class synopsis
JGE_Automatic_Content_Generator {
// constructor
public __construct()
// Configuration of behavior
    // Set lifetime of article cache (in days), default is 365.
public void setCacheLifetime($cacheLifeTimeDays)
// Set calais API key. Required.
public void setCalaisAPIKey($apiKey)
// Configure Frrebase search options.
public void setFreebaseSearchOptions($options)
// Set the type of content to expect from the user, default is 'text/html'.
public void setContentType($contentType)
// main method to process user-supplied content
public JGE_Automatic_Content_Generator_Result processContent($content)

JGE_Automatic_Content_Generator_Result class.

JGE_Automatic_Content_Generator_Result class synopsis is given below. Instances of this are returned by the processContent method and are the main objects of interest for your implementation of our content creator script. Please make sure to take a look at the sample data below the synopsis.

// JGE_Automatic_Content_Generator_Result class synopsis
class JGE_Automatic_Content_Generator_Result
     * Key/value array of articles and they data .
public $articles = array();    
     * Array tag strings.
public $tags = array();

 *    Included below is a sample abbreviated dump of an JGE_Automatic_Content_Generator_Result
 *    object as it may be returned from the call to processContent()
 *    object(JGE_Automatic_Content_Generator_Result) (2) 
 *    { 
 *        ["articles"]=> array(3) 
 *        { 
 *            ["Microsoft"]=> array(5) 
 *            { 
 *                ["article"]=> string(1212) "Microsoft Corporation (NASDAQ: MSFT) is 
 *                             an American ... (abbreviated)" 
 *                ["image"]=> string(126) http://api.freebase.com/api/trans/image_thumb/m/022pt0v?
 *                            errorid=%2Ffreebase%2Fno_image_png&maxheight=200&mode=fit&maxwidth=150" 
 *                ["freebaseId"]=> string(13) "/en/microsoft" 
 *                ["moreInfo"]=> string(66) "http://www.freebase.com/view
 *                                 /guid/9202a8c04000641f8000000000026344" 
 *                ["officialName"]=> string(21) "Microsoft Corporation" 
 *            } 
 *            ... (abbreviated)
 *        } 
 *        ["tags"]=> array(2) 
 *        { 
 *            [0]=> string(16) "Internet" 
 *            [1]=> string(7) "Finance" 
 *        } 
 *    } 


How to control the lifetime of the article cache?

JGE Automatic Content Generator by default uses cache lifetime of 365 days. You can change this value by adding a call to setCacheLifetime() before processContent(), as follows:

$result $jge->processContent($content);
catch (
Exception $e)
$result null;

Some of my generated articles are not relevant to my content - how to fix this?

JGE Automatic Content Generator uses default Freebase search options which may cause that results from unwanted domains are included. You can change this by adding a call to setFreebaseSearchOptions() before processContent(), as follows:

// Optionally set custom Freebase search options to include/exclude certain domains and types.
// See http://www.freebase.com/docs/web_services/search for more details on the options below.
$freebaseOptions = array();
$freebaseOptions['domain'] = '/computer,/internet';
$freebaseOptions['domain_strict'] = 'should';
$freebaseOptions['type_exclude'] = '/internet/social_network_user,/music/artist,/music/group_member';
$freebaseOptions['type_exclude_strict'] = 'should';
$freebaseOptions["domain_exclude"] = "/film";
$freebaseOptions["domain_exclude_strict"] = "should";

$result $jge->processContent($content);
catch (
Exception $e)
$result null;

In the example above the options are tuned for computer and internet related websites. You may want to visit Freebase Search Info to find out how to fine tune the searches for the domain of your website.

My articles are embedded in XML, can I still use your auto content generator?

Yes. By default our content creator expects 'text/html' but you can change this by adding a call to setContentType('text/xml') before processContent(), as follows:

$result $jge->processContent($xmlContent);
catch (
Exception $e)
$result null;

Performance considerations

As mentioned earlier, our Automatic Content Generator uses caching to minimize its impact on your website's response time. Here is what you are going to notice. When you access the page integrated with our software for the first time you may notice a couple of seconds of a processing delay because all of the heavy lifting needed to process the page and find articles is being done. When you access the very same page for the second time (for example by pressing the 'Refresh' button in your browser) you will not see any performance degradation because your page will use the cached data. The cache is used automatically and you do not have to write any cache related code. You may observe this behavior in our demo page. We suggest you try articles of different sizes.

What are the software requirements?

  • PHP 5.2.4 or later.
  • Zend Framework installed in your PHP path. We have tested with Version: 1.11.10. Download Zend Framework (no charge).
  • You must have your own Calais API key. Request Calais API key (no charge).
  • SQLite 2.8.17 or later. Usually SQLite is already a part of your PHP environment preinstalled by your web hosting provider. Your phpinfo() should include something like this: SQLite info

How about credits for the free content?

On our demp page we use the following to give due credit to those who made our auto content solution possible:

<img alt="Freebase CC-BY" height="23px" style="padding-top:3px;float : left; border: 0;" 
width="61px" src="http://www.freebase.com/policies/freebase-cc-by-61x23.png" />
<div style="font-size: x-small; margin-left: 70px; height: 30px; line-height:normal">
Source of annotations:
<a href="http://www.freebase.com/" target="_blank">Freebase</a>, licensed under
<a href="http://creativecommons.org/licenses/by/2.5/" target="_blank">CC-BY</a><br/>
Other content from
<a href="http://en.wikipedia.org/" target="_blank">Wikipedia</a>,
licensed under <a href="http://creativecommons.org/licenses/by-sa/2.5/" target="_blank">CC BY-SA</a>
<a style="text-decoration:none;color:#ffffff;" href="http://opencalais.com" target="_blank">
<img src="http://opencalais.com/files/calais_logo.png" alt="OpenCalais Home" />

Of course, you may have to apply additional styles and ... hopefully use a css file. We did not use css here so you have something for quick copy and paste.

Where does the added content come from?

The content we provide for you comes from the following sources:

  • Adherents.com
  • ArXiv
  • Baseball Almanac
  • Berlin International Film Festival
  • Center for Responsive Politics
  • ChefMoz
  • chickipedia
  • CrunchBase
  • Cāmara dos Deputados
  • Database
  • databasebasketball.com
  • databaseFootball.com
  • DatabaseOlympics
  • Daylife
  • E-LIS
  • en.citiZENdium.org/wiki/
  • English Wikipedia
  • Factual
  • FDIC
  • Freebase
  • GEBCO Undersea Features Gazetteer
  • Geographic Names Information System
  • German Wikipedia
  • Healthcare Cost Report Information System
  • Hulu
  • IES NCES Public Library Survey
  • Infochimps
  • InstantEncore
  • Internet Movie Database
  • Internet Speculative Fiction Database
  • ISO 15924
  • ITIS
  • Library of Congress
  • Lurkmore.ru
  • MBLWHOI Library
  • Medpedia
  • Metaweb topic merging algorithm
  • MusicBrainz
  • Named entity recognition
  • National Center for Education Statistics
  • National Fire Department Census Database
  • National Oceanic and Atmospheric Administration
  • Nature
  • Netflix
  • Open Library
  • OurAirports
  • Paragliding Earth
  • Pocket Statistical Data on Switzerland 2006
  • Pocket Statistical Data on Switzerland 2007
  • Powerset
  • Public domain
  • PubMed Central
  • Quotationsbook
  • Simon Property Group
  • SkyGrid
  • Stanford University
  • StarCraft and StarCraft II Wiki
  • The Football Database
  • The TVDB
  • The World Factbook
  • TVRage
  • UN Stats
  • United States Census Bureau
  • United States Department of Housing and Urban Development
  • United States Securities and Exchange Commission
  • Wikipedia
  • Wikipedia Categories
  • Wikipedia infoboxes
  • World Bank Group
  • World of Spectrum
  • World Wide Web

JGE Automatic Content Generator
Single-site license

Do you have questions?

In case of any doubt about the product, its capabilities, or about how it operates, please do not hesitate to contact us using the contact form below. Also we would like to hear any suggestions you might have concerning product improvement, demo page, and the description provided on this page.

Share this article!    Bookmark JGE Automatic Content Generator at Delicious Digg JGE Automatic Content Generator Share JGE Automatic Content Generator with your Twitter followers Share JGE Automatic Content Generator at StumbleUpon Add JGE Automatic Content Generator to your Technorati favorites Share JGE Automatic Content Generator on Facebook Share JGE Automatic Content Generator on Blinklist Share JGE Automatic Content Generator on Diigo Share JGE Automatic Content Generator on Reddit Share JGE Automatic Content Generator on Linked In Seed the vine with JGE Automatic Content Generator Share JGE Automatic Content Generator on Mixx Share JGE Automatic Content Generator on DZone Share JGE Automatic Content Generator on Google Buzz Add JGE Automatic Content Generator to Google Bookmarks