Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env php
<?php
# execute as nightly cronjob
# redirect to /dev/null if you don't want get mailed errors because WoW is running
# use with Elephant (or similar) addon that automatically enables writing to WoWChatLog.txt
$source_path = "/Applications/Games/World of Warcraft/Logs";
$dest_path = '/Users/david/Documents/Logs/WoW';
<?php
preg_match_all('/<img src="([^"]+)_SM.jpg"/i', file_get_contents($argv[1]), $matches);
foreach ($matches[1] as $key => $match)
{
$infile = $match.'_BG.jpg';
if ($data = file_get_contents($infile))
{