Compare commits
No commits in common. "6aeeeb22caae5bfa88c236c78d5796a0b26e7cf1" and "e5e7ab27e30e8e35ce9540a8e772806aea0c8e32" have entirely different histories.
6aeeeb22ca
...
e5e7ab27e3
12
.htaccess
12
.htaccess
|
@ -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/
|
|
15
epub.php
15
epub.php
|
@ -19,11 +19,6 @@
|
||||||
|
|
||||||
function add_mp_article($url, $context, $epub)
|
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);
|
$article = file_get_contents($url, false, $context);
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
$doc->loadHTML($article);
|
$doc->loadHTML($article);
|
||||||
|
@ -31,7 +26,7 @@
|
||||||
|
|
||||||
$title = $finder->query('//h1')->item(0)->textContent;
|
$title = $finder->query('//h1')->item(0)->textContent;
|
||||||
$author = $finder->query('//a[contains(@href, "biographie")]')->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;
|
$summary = $finder->query('//p[contains(@class, "news__heading__top__intro")]')->item(0)->textContent;
|
||||||
|
|
||||||
// strip images
|
// strip images
|
||||||
|
@ -380,8 +375,7 @@
|
||||||
$epub = new TPEpubCreator();
|
$epub = new TPEpubCreator();
|
||||||
$epub->temp_folder = 'temp/';
|
$epub->temp_folder = 'temp/';
|
||||||
$epub->epub_file = 'epub/mediapart.epub';
|
$epub->epub_file = 'epub/mediapart.epub';
|
||||||
$epub->title = 'Mediapart RSS ' . $date;
|
$epub->title = 'Mediapart ' . $date;
|
||||||
$epub->AddImage('https://www.mediapart.fr/icon-news-180x180.png', 'image/jpeg', true);
|
|
||||||
|
|
||||||
// load feeds
|
// load feeds
|
||||||
$feed = file_get_contents($feedurl);
|
$feed = file_get_contents($feedurl);
|
||||||
|
@ -411,8 +405,7 @@
|
||||||
$epub = new TPEpubCreator();
|
$epub = new TPEpubCreator();
|
||||||
$epub->temp_folder = 'temp/';
|
$epub->temp_folder = 'temp/';
|
||||||
$epub->epub_file = 'epub/mediaparthome.epub';
|
$epub->epub_file = 'epub/mediaparthome.epub';
|
||||||
$epub->title = 'Mediapart A la une ' . $date;
|
$epub->title = 'Mediapart home ' . $date;
|
||||||
$epub->AddImage('https://www.mediapart.fr/icon-news-180x180.png', 'image/jpeg', true);
|
|
||||||
|
|
||||||
$home = file_get_contents($homeurl, false, $context);
|
$home = file_get_contents($homeurl, false, $context);
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
@ -614,7 +607,7 @@
|
||||||
<input id="forcempcookies" name="forcempcookies" type="checkbox">
|
<input id="forcempcookies" name="forcempcookies" type="checkbox">
|
||||||
<label for="forcempcookies">Force cookies</label>
|
<label for="forcempcookies">Force cookies</label>
|
||||||
<br>
|
<br>
|
||||||
<input id="mptoday" name="mptoday" type="checkbox">
|
<input id="mptoday" name="mptoday" type="checkbox" disabled>
|
||||||
<label for="mptoday">Today only</label>
|
<label for="mptoday">Today only</label>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue