Page MenuHomeDevCentral

D738.diff
No OneTemporary

D738.diff

diff --git a/pages/index.dat b/pages/index.dat
--- a/pages/index.dat
+++ b/pages/index.dat
@@ -13,6 +13,7 @@
http://www.jstor.org/ JSTOR
http://www.lalibre.be/ LaLibreBelgique
http://www.latimes.com/ LosAngelesTimes
+http://www.lavenir.net/ LAvenir
http://www.lefigaro.fr/ LeFigaro
http://www.lemonde.fr/ LeMonde
http://www.leparisien.fr/ LeParisien
diff --git a/pages/lavenir.php b/pages/lavenir.php
new file mode 100644
--- /dev/null
+++ b/pages/lavenir.php
@@ -0,0 +1,31 @@
+<?php
+
+require_once('helpers/namecase.php');
+
+/**
+ * Represents a page from the http://www.lavenir.net/ site.
+ */
+class LAvenirPage extends Page {
+ /**
+ * Analyses the page and extracts metadata
+ */
+ function analyse () {
+ parent::analyse();
+
+ $author = self::between('<span itemprop="author">', '</span>');
+ $this->author = name_case($author);
+
+ $this->extractDate();
+
+ $this->site = "[[L'Avenir (Belgique)|L'Avenir]]";
+ }
+
+ function extractDate () {
+ $pattern = "/dmf([12][0-9]{3})([0-9]{2})([0-9]{2})/";
+ if (preg_match($pattern, $this->url, $matches)) {
+ $this->yyyy = $matches[1];
+ $this->mm = $matches[2];
+ $this->dd = $matches[3];
+ }
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 12:31 (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257991
Default Alt Text
D738.diff (1 KB)

Event Timeline