Compare commits

..

No commits in common. "6aeeeb22caae5bfa88c236c78d5796a0b26e7cf1" and "e5e7ab27e30e8e35ce9540a8e772806aea0c8e32" have entirely different histories.

2 changed files with 4 additions and 23 deletions

View File

@ -1,12 +0,0 @@
RewriteEngine on
# Redirection du www vers non-www en HTTPS
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301]
# Redirection vers HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# See https://ouvaton.coop/certificat-ssl/

View File

@ -19,11 +19,6 @@
function add_mp_article($url, $context, $epub)
{
if (isset($_POST['mptoday']) && $_POST['mptoday'] && !str_contains($url, (new DateTime('today'))->format('dmy')))
{
return;
}
$article = file_get_contents($url, false, $context);
$doc = new DOMDocument();
$doc->loadHTML($article);
@ -31,7 +26,7 @@
$title = $finder->query('//h1')->item(0)->textContent;
$author = $finder->query('//a[contains(@href, "biographie")]')->item(0)->textContent;
$date = trim($finder->query('//time')->item(1)->textContent);
$date = $finder->query('//time')->item(1)->textContent;
$summary = $finder->query('//p[contains(@class, "news__heading__top__intro")]')->item(0)->textContent;
// strip images
@ -380,8 +375,7 @@
$epub = new TPEpubCreator();
$epub->temp_folder = 'temp/';
$epub->epub_file = 'epub/mediapart.epub';
$epub->title = 'Mediapart RSS ' . $date;
$epub->AddImage('https://www.mediapart.fr/icon-news-180x180.png', 'image/jpeg', true);
$epub->title = 'Mediapart ' . $date;
// load feeds
$feed = file_get_contents($feedurl);
@ -411,8 +405,7 @@
$epub = new TPEpubCreator();
$epub->temp_folder = 'temp/';
$epub->epub_file = 'epub/mediaparthome.epub';
$epub->title = 'Mediapart A la une ' . $date;
$epub->AddImage('https://www.mediapart.fr/icon-news-180x180.png', 'image/jpeg', true);
$epub->title = 'Mediapart home ' . $date;
$home = file_get_contents($homeurl, false, $context);
$doc = new DOMDocument();
@ -614,7 +607,7 @@
<input id="forcempcookies" name="forcempcookies" type="checkbox">
<label for="forcempcookies">Force cookies</label>
<br>
<input id="mptoday" name="mptoday" type="checkbox">
<input id="mptoday" name="mptoday" type="checkbox" disabled>
<label for="mptoday">Today only</label>
<br>