CC-1695 Remove Campcaster Studio and make install easier
Changing htmlUI dir structure to be better.
This commit is contained in:
parent
acda23db88
commit
c4b96da797
285 changed files with 0 additions and 0 deletions
41
htmlUI/ui_twitterCron.php
Normal file
41
htmlUI/ui_twitterCron.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
require_once(dirname(__FILE__).'/ui_conf.php');
|
||||
require_once(dirname(__FILE__).'/ui_handler.class.php');
|
||||
|
||||
$uiHandler = new uiHandler($CC_CONFIG);
|
||||
$uiHandler->init();
|
||||
|
||||
if (is_array($argv)) {
|
||||
define('CRON_DEBUG', array_search('debug', $argv));
|
||||
} else {
|
||||
define('CRON_DEBUG', true);
|
||||
print '<pre>';
|
||||
}
|
||||
|
||||
$uiHandler->sessid = $_COOKIE[$CC_CONFIG['authCookieName']] = Alib::Login('scheduler', 'change_me');
|
||||
|
||||
if (!$uiHandler->sessid) {
|
||||
print "Alib::Login failed\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!$uiHandler->TWITTER->isActive()) {
|
||||
if (CRON_DEBUG) print "Twitter feed is deactivated.\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($uiHandler->TWITTER->needsUpdate()) {
|
||||
if ($feed = $uiHandler->TWITTER->getFeed()) {
|
||||
if (CRON_DEBUG) print "Prepare for update...\n";
|
||||
if ($res = $uiHandler->TWITTER->sendFeed($feed)) {
|
||||
if (CRON_DEBUG) print "Post with feed id: {$res->id}\nContent: $feed";
|
||||
} else {
|
||||
print "Update failed, check auth data.\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
if (CRON_DEBUG) print "No playlist found at offset time.\n";
|
||||
}
|
||||
} else {
|
||||
if (CRON_DEBUG) print "Update interval not reached.\n";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue