function updateCSSAndNames($key) { global $lastPrint; $lastPrint = "group"; $sTime = microtime(true); list($subs, $nsfw) = keyToInfo($key); $cT = new cssEmoteParser(); if (!$nsfw) { $cT->nsfw = array_merge($cT->nsfw, array("horsecock", "dick", "j**z", "dashurbate")); } foreach ($subs as &$s) { $d = @file_get_contents("subs/{$s}.min.css"); if (!$d) { file_put_contents("subs/{$s}.min.css", "/*Not yet retrieved from queue.*/"); touch("subs/{$s}.min.css", time() - 1900, time() - 1900); } $cT->parseString($d, $s, false, false); } $cT->finalize(); $d = $cT->getEmoteNames($key); file_put_contents("cache/{$key}.name", $d); file_put_contents("cache/{$key}.css", ""); file_put_contents("cache/{$key}.css", $cT->toString()); echo "\nUpdated {$key}: " . count($subs) . " subs, nsfw=" . $nsfw . "\tTime: " . (microtime(true) - $sTime) . ""; }
$subs = unique_order($subs); if (count($subs) < 1) { //die(); die('{"cssKey": "broken"}'); } $nsfw = @$_GET['nsfw'] === '1'; $compact = implode(",", $subs) . ",nsfw=" . ($nsfw ? "1" : "0"); $key = md5($compact); $d = @file_get_contents("cache/{$key}.name"); touch("keys/{$key}.key"); file_put_contents("keys/{$key}.key", $compact); if ($d) { echo $d; die; } die('{"cssKey": "generating"}'); require "cssEmoteParser.php"; $cT = new cssEmoteParser(); if (!$nsfw) { $cT->nsfw = array_merge($cT->nsfw, array("horsecock", "dick", "j**z", "dashurbate")); } foreach ($subs as &$s) { $d = @file_get_contents("subs/{$s}.min.css"); if (!$d) { file_put_contents("subs/{$s}.min.css", "/*Not yet retrieved from queue.*/"); } $cT->parseString($d, $s, false, false); } $d = $cT->getEmoteNames($key); echo $d; file_put_contents("cache/{$key}.name", $d);
if (stripos($k, "_nsfw") === false) { $cT->nsfw = array_merge($cT->nsfw, array("horsecock", "dick", "j**z", "dashurbate")); } else { if (isset($nsfwMin[$k])) { $cT->emotePriorities = $nsfwMin[$k]; } else { echo "{$k} had no clean names!\n"; } } foreach ($subs as $s) { $cT->parseString($css[$s], $s, false, in_array($s, $noCompress)); } $cT->finalize(); if ($cT->emoteCount > 0) { file_put_contents("{$k}.min.css", 'body::after{content:"Your GrEmB is out of date, or you have multiple versions installed. Please go to http://nallar.me/scripts/ and update it!"; width: 400px; display:block; height: 40px; background-color: white; position: fixed; left:20px; top: 100px; border: 1px solid #E1B000;}' . $cT->toString()); file_put_contents("{$k}.names", implode("\n", $cT->getEmoteNames(false, true))); file_put_contents("unstable/{$k}.min.css", $cT->toString()); file_put_contents("{$k}.count", $cT->emoteCount); if (isset($subss[$k . "_nsfw"])) { $nsfwMin[$k . "_nsfw"] = array(); foreach ($cT->emotePriorities as $ek => $ignored) { $nsfwMin[$k . "_nsfw"][$ek] = 999; } } } echo "Done {$k} with {$cT->emoteCount} emotes.\n"; sleep(60); continue; $cT = new cssEmoteParser(); $cT->gremb = false; if (stripos($k, "_nsfw") === false) {