From Mediawiki: Read the RecentChanges feed and find articles that have been updated Fetch the raw article text, and save to a file named wiki.example.com -- PageTitle.txt in the dropbox folder */ foreach ($config as $wikiDomain => $wikiConfig) { $mw = logInToMediaWiki($wikiDomain); $feed = $mw->getRecentChanges(); $xml = simplexml_load_string($feed); foreach ($xml->entry as $entry) { if (preg_match('/--changed-in-dropbox--/', (string) $entry->summary) == FALSE) { if (preg_match('/diff=(\\d+)/', $entry->id, $match)) { $oldid = $match[1]; $title = $entry->title; $filename = $dropboxPath . $wikiDomain . ' -- ' . pageTitleToFilename($title) . '.txt'; # If the remote wiki article was updated after the last date we downloaded the article if (strtotime($entry->updated) > $db->get($wikiDomain, $title . ' WikiUpdated') && (!file_exists($filename) || strtotime($entry->updated) > filemtime($filename))) { # ...then download the new wiki article $db->set($wikiDomain, $title . ' WikiUpdated', strtotime($entry->updated)); echo $title . "\n"; echo "\t" . $filename . "\n"; echo "\tWiki page updated: " . date('Y-m-d H:i:s', strtotime($entry->updated)) . "\n"; echo "\tLocal page updated: " . date('Y-m-d H:i:s', $db->get($wikiDomain, $title . ' WikiUpdated')) . "\n"; if (file_exists($filename)) { echo "\tFile updated: " . date('Y-m-d H:i:s', filemtime($filename)) . "\n"; } else { echo "\tFile not found on disk\n"; } echo "\twriting new file\n"; echo "\n"; $source = $mw->getPage($oldid); file_put_contents($filename, $source);