public function search() { $this->out['title'] = 'Search'; $id = false; if ($this->uri->segment(2)) { $id = $this->uri->segment(2); } if (isset($_GET['q'])) { $id = $_GET['q']; } if ($id) { if (is_numeric($id)) { redirect('xem/show/' . $id); return; } else { $shows = getShows($this->db, $id); if (count($shows) == 1) { redirect('xem/show/' . $shows[0]->id); } else { //print_query($this->db); $this->out['curShows'] = $shows; $this->_loadView('showList', false); } } } else { redirect('xem/shows/'); } //$this->load->view('top', $this->out); //$this->load->view('bottom', $this->out); }
function __construct() { parent::__construct(); // create a new user alpha beta testers //$this->simpleloginsecure->create('lad1337','*****@*****.**', 'xem.t0gepi175'); //$this->simpleloginsecure->create('zoggy','*****@*****.**', 'badbadrubberpiggy'); //$this->simpleloginsecure->create('xelra','*****@*****.**', 'tester'); //$this->simpleloginsecure->create('gleam','*****@*****.**', 'tester2'); $this->load->helper("url"); $this->load->helper("form"); $this->load->helper("html"); $this->out['logedIn'] = $this->session->userdata('logged_in'); $this->out['uri'] = $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3); $this->out['uri2'] = $this->uri->segment(3) . '/' . $this->uri->segment(4) . '/' . $this->uri->segment(5); $this->out['shows'] = getShows($this->db); $this->user_nick = ""; $this->user_email = ""; $this->user_lvl = -1; if ($this->session->userdata('logged_in')) { $this->out['disabled'] = ""; $this->out['logedInJS'] = "true"; $this->user_nick = $this->session->userdata('user_nick'); $this->user_email = $this->session->userdata('user_email'); $this->user_lvl = $this->session->userdata('user_lvl'); $this->out['user_nick'] = $this->user_nick; $this->out['user_email'] = $this->user_email; $this->out['user_lvl'] = $this->user_lvl; } else { $this->out['disabled'] = 'disabled="disabled"'; $this->out['logedInJS'] = "false"; } $this->out['title'] = 'Xross Entity Map'; $this->load->model('dbobjectcache'); $this->history = new History($this->db, $this->session); $this->oh = new Objectholder($this->db, $this->dbobjectcache, $this->history); }
/** * Process feeds * * @param array $feeds List of feeds to process * @param array $config Configuration array * @return array Processing stats */ function processFeeds($feeds, $config) { $result = array(); $shows = getShows($config); $excludes = getExcludes($config); foreach ($feeds as $feed) { $feedItems = getFeedItems($feed); $cleanItems = cleanFeedItems($feedItems, $shows, $excludes); $history = getHistory($config); foreach ($cleanItems as $d) { $entry = $d['show'] . " " . $d['episode']; if (!in_array($entry, $history)) { downloadTorrent($d['url'], $config); $history[] = $entry; $result[$feed][] = $entry; } } saveHistory($history, $config); } return $result; }
<?php require '../includes/connect.php'; require '../functions/string.php'; require "../functions/recentlyReleased.php"; require '../functions/getTodayShow.php'; require '../functions/updateRatings.php'; set_time_limit(3600); //EMPTIES tvshow $truncateQuery = "TRUNCATE TABLE `tvshow`"; mysqli_query($conn, $truncateQuery) or die(mysqli_error($conn)); /* $py_script = "py\scraper.py"; $py_args = ""; //exec(pythondirectory file), must use python34 becuse of MySQLdb library exec('C:\Users\User\AppData\Local\Programs\Python\Python34\python.exe py\scraper.py'); */ //shows that aired 2 days ago will likely have subtitles //EVERY 3 DAYS $twoDaysAgodate = new DateTime('-2 day'); $twoDaysAgodate = $twoDaysAgodate->format('Y-m-d '); getShows($twoDaysAgodate); $oneDayAgodate = new DateTime('-1 day'); $oneDayAgodate = $oneDayAgodate->format('Y-m-d '); getShows($oneDayAgodate); $date = new DateTime(); $date = $date->format('Y-m-d '); getShows($date); echo "done getshow";