From 1f3bc62a4a912bd7f5a7c0798667c4aeb44fc33c Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Mon, 30 Dec 2019 14:22:29 +0800 Subject: [PATCH] Fix regex for internet bill and update splitBill since it's just lil Cammy now --- src/common.php | 2 +- src/rules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common.php b/src/common.php index fb00126..36e8f42 100644 --- a/src/common.php +++ b/src/common.php @@ -54,7 +54,7 @@ function getTelegram(): TelegramAPI { } function splitBill(float $amount) : float { - return floor($amount/2); + return $amount; } function identity($x) { diff --git a/src/rules.php b/src/rules.php index 10a2110..8f57393 100644 --- a/src/rules.php +++ b/src/rules.php @@ -15,7 +15,7 @@ return [ ], 'Internet' => [ 'imapQuery' => 'FROM "@online.telstra.com"', - 'regex' => '/Total \$(?[0-9]+(\.[0-9]{2})?).*?Due Date (?\d{1,2} \w{3} \d{4})/', + 'regex' => '/Total.*?\$(?[0-9]+(\.[0-9]{2})?).*?Due Date.*?(?\d{1,2} \w{3} \d{4})/', 'messageTransform' => ∘(glue(" "), map('trim'), lines, 'strip_tags', 'html_entity_decode') ], 'Gas' => [ -- 2.11.0