Permalink
Browse files

Merge branch 'iqbalansari-master'

  • Loading branch information...
cbenard committed Dec 20, 2015
2 parents 226c36c + a2e9778 commit 9a2f990a02c9aa46e6c9adece0786dea482a08ad
Showing with 34 additions and 0 deletions.
  1. +27 −0 classes/TableTitansService.php
  2. +4 −0 cron.yaml
  3. +3 −0 scripts/dependency_injection.php
@@ -0,0 +1,27 @@
<?php
class TableTitansService extends GenericComicService {
const FEED_URI = 'http://tabletitans.com/feed';
const PATTERN = '/class="comic row".*?<img src="(.+?)"/s';
const ENTRY_SEARCH_TEXT = "Latest Adventure:";
public function __construct(FeedService $feedService, Logger $logger, StorageService $store) {
parent::__construct("tabletitans", $feedService, $logger, $store);
}
private function getConfig() {
$config = array();
$config[] = new FeedFetchOptions('default', self::FEED_URI, self::ENTRY_SEARCH_TEXT, self::PATTERN);
return $config;
}
public function fetchAllAndStore() {
$config = $this->getConfig();
foreach ($config as $currentConfig) {
$this->fetchAndStore($currentConfig);
}
}
}
View
@@ -18,3 +18,7 @@ cron:
- description: Fetch PVP
url: /fetch/pvp
schedule: every 2 hours
- description: Fetch Table Titans
url: /fetch/tabletitans
schedule: every 2 hours
@@ -30,6 +30,9 @@
$container['pvp'] = function($c) {
return new PVPService($c['feed'], $c['logger'], $c['storage']);
};
$container['tabletitans'] = function($c) {
return new TableTitansService($c['feed'], $c['logger'], $c['storage']);
};
$container['view'] = function ($c) {
return new ViewService($c['logger'], $c['storage']);
};

0 comments on commit 9a2f990

Please sign in to comment.