Page MenuHomeDevCentral

D731.diff
No OneTemporary

D731.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.lemonde.fr/ LeMonde
http://www.leparisien.fr/ LeParisien
http://www.lesoir.be/ LeSoir
+http://next.liberation.fr/ Liberation
http://www.liberation.fr/ Liberation
http://www.nytimes.com/ NewYorkTimes
http://www.persee.fr/ Persee
diff --git a/pages/liberation.php b/pages/liberation.php
--- a/pages/liberation.php
+++ b/pages/liberation.php
@@ -10,13 +10,14 @@
// Gets date
// e.g. http://www.liberation.fr/france/2016/06/02/affiches...
- $pos = strpos($this->url, "/20");
- $this->yyyy = substr($this->url, $pos + 1, 4);
- $this->mm = substr($this->url, $pos + 6, 2);
- $this->dd = substr($this->url, $pos + 9, 2);
+ $this->extractYYYYMMDDDateFromURL();
// Extracts author
$author = self::between('<span class="author">', '</span>');
$this->author = self::grab($author, '<span>'); // cleans URL
+ if ($this->author === false) {
+ $this->author = self::grab($author, '">', '</a>'); // link
+ }
+ $this->author = trim($this->author);
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 23:24 (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2267893
Default Alt Text
D731.diff (1 KB)

Event Timeline