Commit 4a80087f authored by ~rs's avatar ~rs

get JWP member list and mail them all

parent 43ac8237
Pipeline #1998 passed with stages
in 1 minute and 36 seconds
#!/usr/bin/php
<?php
include './Core/BotCore.php';
/** MailJWP.php
* Mails all JWP
* @Author KPFC
* @Version 0.1
* @Status Alpha */
class MailJWP extends Core {
public function MailJWP ($Account, $Job, $pUseHTTPS = true, $assert = 'user') {
// login
$this->initcurl($Account, $Job, $pUseHTTPS, $assert);
}
public function email($subject = 'Information', $contentpage) {
$content = file_get_contents($contentpage);
if ($content == '') {
throw new Exception('Missing content to send!');
}
$users = $this->getJWP();
echo $this->sendMassmail($users, $subject, $content);
}
public function getJWP() {
$page = "Wikipedia:Jungwikipedianer/Mitglieder";
$content = $this->readPage($page);
$content = strstr($content, '== Liste ==');
preg_match_all('~name ?= ?([^|]*) ~', $content, $names);
return $names[1];
}
}
$Mailer = new MailJWP('KPFC@test2wiki', 'MailJWP', true, 'user');
$Mailer->email('Einladung zu … der Jungwikipedianer', 'Einladung');
echo implode(';', $Mailer->getJWP()) . "\n";
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment