Created
April 8, 2018 16:36
-
-
Save ddavaham/a470076d5ec7e16dbf076342863865d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove font size | |
$formattedMessage = preg_replace('/size="[^"]*[^"]"/', "", $reponse->body); | |
// remove wrong color | |
$formattedMessage = preg_replace('/(color="#)[a-f0-9]{2}([a-f0-9]{6}")/', '', $formattedMessage); | |
// link to kms | |
$formattedMessage = preg_replace('/<a href="killReport:(\d+):(\w+)">/', '<a href="' . config('base.kmUrl') . 'kill/\1/" target="_blank">', $formattedMessage); | |
// link fits | |
$formattedMessage = preg_replace('/<a href="fitting:([\d:;]+)">/', '<a href="' . config('base.osmiumUrl') . 'loadout/dna/\1" target="_blank">', $formattedMessage); | |
// link system/station | |
$formattedMessage = preg_replace('/<a href="showinfo:(?:5|3867)\/\/(\d+)">/', '<a href="' . config('base.dotlanUrl') . 'search?q=\1">', $formattedMessage); | |
// link char | |
$formattedMessage = preg_replace('/<a href="showinfo:(?:1377|1378)\/\/(\d+)">/', '<a href="' . config('base.kmUrl') . 'character/\1">', $formattedMessage); | |
// link corp | |
$formattedMessage = preg_replace('/<a href="showinfo:2\/\/(\d+)">/', '<a href="' . config('base.kmUrl') . 'corporation/\1">', $formattedMessage); | |
// link alliance | |
$formattedMessage = preg_replace('/<a href="showinfo:16159\/\/(\d+)">/', '<a href="' . config('base.kmUrl') . 'alliance/\1">', $formattedMessage); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment