Permalink
Browse files

Added proper file headers. Added Release Feed and other 2.5-era plugi…

…n goodness. Updated phoneHome URL.
  • Loading branch information...
michaelrog committed Jul 7, 2016
1 parent 3d4b1c2 commit e41dc46b5c44f1e4d8faf88be5d137be2e47b8b9
@@ -2,44 +2,145 @@
namespace Craft;
/**
* Scraper plugin class
* ScraperPlugin
*
* @author Top Shelf Craft <support@topshelfcraft.com>
* @copyright Copyright (c) 2016, Michael Rog
* @license http://topshelfcraft.com/license
* @see http://topshelfcraft.com
* @package craft.plugins.scraper
* @since 1.0
*/
class ScraperPlugin extends BasePlugin
{
/**
* @return string
*/
public function getName()
{
return 'Scraper';
}
public function getVersion()
/**
* Return the plugin description
*
* @return string
*/
public function getDescription()
{
return '0.1.0';
return 'Easily fetch, parse, and rejigger HTML from anywhere.';
}
/**
* Return the plugin developer's name
*
* @return string
*/
public function getDeveloper()
{
return 'Michael Rog';
return 'Top Shelf Craft';
}
/**
* Return the plugin developer's URL
*
* @return string
*/
public function getDeveloperUrl()
{
return 'http://michaelrog.com/craft/scraper';
return 'http://topshelfcraft.com';
}
public function hasCpSection()
/**
* Return the plugin's Documentation URL
*
* @return string
*/
public function getDocumentationUrl()
{
return false;
return 'http://topshelfcraft.com/scraper';
}
/**
* Return the plugin's current version
*
* @return string
*/
public function getVersion()
{
return '0.2.0';
}
public function registerCpRoutes()
/**
* Return the plugin's db schema version
*
* @return string|null
*/
public function getSchemaVersion()
{
return array();
return '0.0.0.0';
}
/**
* Return the plugin's Release Feed URL
*
* @return string
*/
public function getReleaseFeedUrl()
{
return Scraper_BetaService::ReleaseFeedUrl;
}
/**
* Return whether the plugin has a CP section
*
* @return bool
*/
public function hasCpSection()
{
return false;
}
/**
*
*/
public function onAfterInstall()
{
craft()->scraper_beta->phoneHome();
}
/**
* Make sure requirements are met before installation.
*
* @return bool
* @throws Exception
*/
public function onBeforeInstall()
{
// Prevent the install if we aren't at least on Craft 2.5
if (version_compare(craft()->getVersion(), '2.5', '<')) {
/*
* No way to gracefully handle this
* (because until 2.5, plugins can't prevent themselves from being installed),
* so throw an Exception.
*/
throw new Exception('Hue requires Craft 2.5+');
}
// Prevent the install if we aren't at least on PHP 5.4
if (!defined('PHP_VERSION') || version_compare(PHP_VERSION, '5.4', '<')) {
Craft::log('Hue requires PHP 5.4+', LogLevel::Error);
return false;
}
// Otherwise we're all good
return true;
}
}
@@ -2,12 +2,20 @@
namespace Craft;
/**
* Scraper BetaService
* Scraper_BetaService
*
* @author Top Shelf Craft <support@topshelfcraft.com>
* @copyright Copyright (c) 2016, Michael Rog
* @license http://topshelfcraft.com/license
* @see http://topshelfcraft.com
* @package craft.plugins.scraper
* @since 1.0
*/
class Scraper_BetaService extends BaseApplicationComponent
{
const SecondStarToTheRight = 'http://michaelrog.com/craft/et/scraper.php';
const SecondStarToTheRight = 'https://topshelfcraft.com/et/scraper.php';
const ReleaseFeedUrl = 'https://topshelfcraft.com/releases/Scraper.json';
public function phoneHome() {
@@ -13,7 +13,14 @@
require_once CRAFT_PLUGINS_PATH . 'scraper/vendor/simplehtmldom/simple_html_dom.php';
/**
* Scraper ScraperService
* Scraper_ScraperService
*
* @author Top Shelf Craft <support@topshelfcraft.com>
* @copyright Copyright (c) 2016, Michael Rog
* @license http://topshelfcraft.com/license
* @see http://topshelfcraft.com
* @package craft.plugins.scraper
* @since 1.0
*/
class Scraper_ScraperService extends BaseApplicationComponent
{
@@ -1,7 +1,16 @@
<?php
namespace Craft;
// TODO: Add proper file header
/**
* ScraperVariable
*
* @author Top Shelf Craft <support@topshelfcraft.com>
* @copyright Copyright (c) 2016, Michael Rog
* @license http://topshelfcraft.com/license
* @see http://topshelfcraft.com
* @package craft.plugins.scraper
* @since 1.0
*/
class ScraperVariable
{

0 comments on commit e41dc46

Please sign in to comment.