aboutsummaryrefslogtreecommitdiffhomepage
path: root/readityourself.php
diff options
context:
space:
mode:
authornicosomb <nicolas@loeuillet.org>2013-04-12 12:25:58 +0200
committernicosomb <nicolas@loeuillet.org>2013-04-12 12:25:58 +0200
commit67e7910439d364f1f7a4dac1d233a7c1055fb933 (patch)
treea694e1e9ed7c170d87bec6e152105ddd25e87813 /readityourself.php
parentb70971e06b67786bb61e863cf89b3b061b4f6467 (diff)
downloadwallabag-67e7910439d364f1f7a4dac1d233a7c1055fb933.tar.gz
wallabag-67e7910439d364f1f7a4dac1d233a7c1055fb933.tar.zst
wallabag-67e7910439d364f1f7a4dac1d233a7c1055fb933.zip
changement de la structure de la bdd sqlite : on stocke le contenu maintenant issue #17
Diffstat (limited to 'readityourself.php')
-rwxr-xr-xreadityourself.php43
1 files changed, 0 insertions, 43 deletions
diff --git a/readityourself.php b/readityourself.php
deleted file mode 100755
index 588baeca..00000000
--- a/readityourself.php
+++ /dev/null
@@ -1,43 +0,0 @@
1<?php
2header('Content-type:text/html; charset=utf-8');
3
4setlocale(LC_ALL, 'fr_FR');
5date_default_timezone_set('Europe/Paris');
6
7require_once dirname(__FILE__).'/inc/Readability.php';
8require_once dirname(__FILE__).'/inc/Encoding.php';
9require_once dirname(__FILE__).'/inc/rain.tpl.class.php';
10include dirname(__FILE__).'/inc/functions.php';
11
12if(isset($_GET['url']) && $_GET['url'] != null && trim($_GET['url']) != "") {
13 // get url link
14 if(strlen(trim($_GET['url'])) > 2048) {
15 echo "Error URL is too large !!";
16 } else {
17 $url = trim($_GET['url']);
18
19 // decode it
20 $url = html_entity_decode($url);
21
22 // if url use https protocol change it to http
23 if (!preg_match('!^https?://!i', $url)) $url = 'http://'.$url;
24
25 // convert page to utf-8
26 $html = Encoding::toUTF8(get_external_file($url,15));
27
28 if(isset($html) and strlen($html) > 0) {
29
30 // send result to readability library
31 $r = new Readability($html, $url);
32
33 if($r->init()) {
34 generate_page($url,$r->articleTitle->innerHTML,$r->articleContent->innerHTML);
35 } else {
36 // return data into an iframe
37 echo "<iframe id='readabilityframe'>".$html."</iframe>";
38 }
39 } else {
40 echo "Error unable to get link : ".$url;
41 }
42 }
43} \ No newline at end of file