示例#1
0
    $sitemap->add('http://www.masterani.me/latest', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
    $sitemap->add('http://www.masterani.me/anime', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
    $sitemap->add('http://www.masterani.me/anime/chart', '2014-07-09T12:30:00+02:00', '0.9', 'daily');
    $sitemap->add('http://www.masterani.me/animehd', '2014-07-09T12:30:00+02:00', '0.9', 'weekly');
    $animes = Anime::all();
    foreach ($animes as $anime) {
        $name = htmlspecialchars($anime->name, ENT_QUOTES, 'UTF-8');
        $sitemap->add('http://www.masterani.me/anime/' . $anime->id . '/' . str_replace(array(" ", "/", "?"), '_', $name), $anime->date_updated, '0.9', 'weekly');
    }
    return $sitemap->render();
});
Route::get('/debug', function () {
    if (Sentry::check()) {
        $user = Sentry::getUser();
        if ($user->isSuperUser()) {
            RecentAnime::scrape();
            return '<br/>DONE SCRAPING';
        }
        return 'must be super user';
    }
    return 'not logged in.';
});
/*Update & manage routes*/
Route::post('/anime/managelistaccount', function () {
    if (Request::ajax()) {
        return MasterAnime::manageListAccount(Input::get("site"), Input::get("username"), Input::get("password"));
    }
    return 'AJAX requests only';
});
Route::get('/disable/announcement', function () {
    if (Request::ajax()) {
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     RecentAnime::scrape();
 }