function updateSub($sub) { global $lastPrint; if ($lastPrint != "sub") { echo "\nUpdated {$sub}"; } else { echo ", {$sub}"; } $lastPrint = "sub"; $css = getStyle($sub); if (!$css) { touch("subs/{$sub}.min.css"); return; } file_put_contents("cachedsubs/{$sub}.css", $css); $cT = new cssEmoteParser(); $cT->parseString($css, $sub, true); $cT->finalize(); $d = $cT->toString(); if (!$d && file_exists("subs/{$sub}.min.css")) { unlink("subs/{$sub}.min.css"); $lastPrint = "delete"; echo "\nDeleted {$sub} - empty!"; return; } file_put_contents("subs/{$sub}.min.css", $d); file_put_contents("subs/{$sub}.count", $cT->emoteCount); }
} } $str .= "}"; return $str; } } if (@$argv[1] == "-ilcss") { $argv[1] = "-cssd"; cssEmoteParser::$testStr = $argv[2]; } if (@$argv[1] == "-cssf") { $argv[1] = "-cssd"; cssEmoteParser::$testFile = $argv[2]; } if (@$argv[1] == "-cssd") { $cT = new cssEmoteParser(); try { if (cssEmoteParser::$testStr === null) { $cT->parseFile(cssEmoteParser::$testFile); } else { $cT->parseString(cssEmoteParser::$testStr); } } catch (cssParseException $e) { die($e->getMessage()); } $cT->finalize(); var_dump($cT->tokens); //die(); echo @$cT->toString(); unset($cT); }
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) { $cT->nsfw = array_merge($cT->nsfw, array("horsecock", "dick", "j**z", "dashurbate")); } else { if (isset($nsfwMin[$k])) { $cT->emotePriorities = $nsfwMin[$k]; } } foreach ($subs as $s) { $cT->parseString(@file_get_contents("cachedsubs/{$s}.css"), $s, true, in_array($s, $noCompress)); } $cT->finalize(); if ($cT->emoteCount > 0) { file_put_contents("{$k}.style.css", $cT->toString()); } }