From c5025a20b31bc5d0b4315a9b5dbeaf865a8c6f4d Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Tue, 30 Apr 2013 10:36:19 +0200 Subject: [PATCH 001/105] fix issue #29 --- functions.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/functions.php b/functions.php index c296c8c..da867ca 100755 --- a/functions.php +++ b/functions.php @@ -139,6 +139,10 @@ function getArticlesPerPage( $type ) { switch( $type ) { case 'microblog': return 20; + case 'twitter': + return 20; + case 'identica': + return 20; case 'shaarli': return 20; default: @@ -150,6 +154,10 @@ function getInterval( $type ) { switch( $type ) { case 'microblog': return 300; + case 'twitter': + return 300; + case 'identica': + return 300; case 'shaarli': return 1800; default: @@ -161,6 +169,10 @@ function getTimeout( $type ) { switch( $type ) { case 'microblog': return 30; + case 'twitter': + return 30; + case 'identica': + return 30; case 'shaarli': return 30; default: From 6dcd298cb4d1adee3db95a97dc725971bd7ad5ac Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 30 Apr 2013 12:58:23 +0200 Subject: [PATCH 002/105] .gitignore is now working --- config.php | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100755 config.php diff --git a/config.php b/config.php deleted file mode 100755 index 8f98017..0000000 --- a/config.php +++ /dev/null @@ -1,43 +0,0 @@ -SebSauvage et Bohwaz.'); - -// define( 'ALLOW_FULL_UPDATE', TRUE ); -// define( 'ALLOW_CHECK_UPDATE', TRUE ); - -/** - * If you set ALLOW_NEW_AUTOBLOGS to FALSE, the following options do not matter. - **/ -// define( 'ALLOW_NEW_AUTOBLOGS', TRUE ); -// define( 'ALLOW_NEW_AUTOBLOGS_BY_LINKS', TRUE ); -// define( 'ALLOW_NEW_AUTOBLOGS_BY_SOCIAL', TRUE ); -// define( 'ALLOW_NEW_AUTOBLOGS_BY_BUTTON', TRUE ); -// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE', TRUE ); -// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK', TRUE ); -// define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE ); - -/** - * More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge - **/ -// define( 'API_TWITTER', FALSE ); - -/** - * Import autoblogs from friend's autoblog farm - Add a link to the JSON export - **/ -$friends_autoblog_farm = array( - 'https://raw.github.com/mitsukarenai/xsaf-bootstrap/master/3.json', - // 'https://www.ecirtam.net/autoblogs/?export', - // 'https://autoblog.suumitsu.eu/?export', - // 'http://streisand.hoa.ro/?export', -); -?> From 8dc55c0ca68aa49a56f54767ab4b8c290c6f8b18 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 30 Apr 2013 13:05:49 +0200 Subject: [PATCH 003/105] Add config.php.example --- config.php.example | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 config.php.example diff --git a/config.php.example b/config.php.example new file mode 100644 index 0000000..84d6fa9 --- /dev/null +++ b/config.php.example @@ -0,0 +1,44 @@ +SebSauvage et Bohwaz.'); + +// define( 'ALLOW_FULL_UPDATE', TRUE ); +// define( 'ALLOW_CHECK_UPDATE', TRUE ); + +/** + * If you set ALLOW_NEW_AUTOBLOGS to FALSE, the following options do not matter. + **/ +// define( 'ALLOW_NEW_AUTOBLOGS', TRUE ); +// define( 'ALLOW_NEW_AUTOBLOGS_BY_LINKS', TRUE ); +// define( 'ALLOW_NEW_AUTOBLOGS_BY_SOCIAL', TRUE ); +// define( 'ALLOW_NEW_AUTOBLOGS_BY_BUTTON', TRUE ); +// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE', TRUE ); +// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK', TRUE ); +// define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE ); + +/** + * More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge + **/ +// define( 'API_TWITTER', FALSE ); + +/** + * Import autoblogs from friend's autoblog farm - Add a link to the JSON export + **/ +$friends_autoblog_farm = array( + 'https://raw.github.com/mitsukarenai/xsaf-bootstrap/master/3.json', + // 'https://www.ecirtam.net/autoblogs/?export', + // 'https://autoblog.suumitsu.eu/?export', + // 'http://streisand.hoa.ro/?export', +); +?> From 0ca6d277e67da606b49c4f5a10989ba0f9b3173b Mon Sep 17 00:00:00 2001 From: Oros Date: Wed, 1 May 2013 18:41:52 +0200 Subject: [PATCH 004/105] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20la=20foncti?= =?UTF-8?q?on=20index.php=3Fupdateall=20Si=20la=20mise=20=C3=A0=20jour=20n?= =?UTF-8?q?'a=20pas=20=C3=A9t=C3=A9=20fini=20avant=204=20secondes,=20la=20?= =?UTF-8?q?suite=20se=20fera=20au=20prochain=20appel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index 04fed13..03b1bc4 100755 --- a/index.php +++ b/index.php @@ -373,31 +373,55 @@ if (isset($_GET['sitemap'])) * This action can be very slow and consume CPU if you have a lot of autoblogs **/ if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) { - + $max_exec_time=time()+4; // scipt have 4 seconds to update autoblogs $expire = time() - 84600 ; // 23h30 en secondes $lockfile = ".updatealllock"; - if (file_exists($lockfile) && filemtime($lockfile) > $expire) { - echo "too early"; - die; - } - else { - if( file_exists($lockfile) ) - unlink($lockfile); - - if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) { - echo "Merci d'ajouter des droits d'écriture sur le fichier."; - die; + $lockfile_contents = array(); + if (file_exists($lockfile)){ + $lockfile_contents = file_get_contents($lockfile); + if( !isset($lockfile_contents[0]) || $lockfile_contents[0] != "a") { // détection d'une serialisation + if( filemtime($lockfile) > $expire){ + echo "too early"; + die; + }else{ + // need update of all autoblogs + unlink($lockfile); + } } + // else we need to update some autoblogs + } + if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) { + echo "Merci d'ajouter des droits d'écriture sur le fichier."; + die; } - $subdirs = glob(AUTOBLOGS_FOLDER . "*"); - foreach($subdirs as $unit) { + if(!empty($lockfile_contents)) { + $subdirs = unserialize($lockfile_contents); + unset($lockfile_contents); + }else{ + $subdirs = glob(AUTOBLOGS_FOLDER . "*"); + } + $todo_subdirs = $subdirs; + foreach($subdirs as $key => $unit) { if(is_dir($unit)) { if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) { file_get_contents(serverUrl() . substr($_SERVER['PHP_SELF'], 0, -9) . $unit . '/index.php'); + unset($todo_subdirs[$key]); } } + if(time() >= $max_exec_time){ + break; + } } + if(!empty($todo_subdirs)){ + // if update is not finish + // save list of autoblogs who need update + file_put_contents($lockfile, serialize($todo_subdirs), LOCK_EX); + echo "Not finish"; + }else{ + echo "Done"; + } + exit; } $antibot = generate_antibot(); From ff30a9b5df119c8450640d0f0caaf14892808e29 Mon Sep 17 00:00:00 2001 From: mitsukarenai Date: Sun, 5 May 2013 03:32:11 +0300 Subject: [PATCH 005/105] Create LICENSE.md --- LICENSE.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..700f763 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +LICENCE +=============== + +- domaine public + +LICENSE +=============== + +- public domain From 36d9c2373289764981d2376514c0e176b2026c38 Mon Sep 17 00:00:00 2001 From: mitsukarenai Date: Sun, 5 May 2013 03:33:08 +0300 Subject: [PATCH 006/105] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 02d5b2e..db13a6b 100755 --- a/README.md +++ b/README.md @@ -29,3 +29,8 @@ Pré-requis techniques ===================== - serveur web avec PHP 5.3 et son support SQLite + +Licence +===================== + +- domaine public From 66b432b1242cb40a7455833effad9bc1a7bd8142 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 10 May 2013 13:17:27 +0200 Subject: [PATCH 007/105] =?UTF-8?q?support=20twitterbridge;=20lisez-moi=20?= =?UTF-8?q?!=20-=20contr=C3=B4le=20twitterbridge=20distante=20avec=20heade?= =?UTF-8?q?r=20d'erreur=20-=20ajout=20lien=20vers=20status=20de=20la=20twi?= =?UTF-8?q?tterbridge=20NB:=20Autoblog=20ne=20devrait=20PAS=20manipuler=20?= =?UTF-8?q?la=20twitterbridge:=20seul=20l'admin=20de=20la=20twitterbridge?= =?UTF-8?q?=20doit=20avoir=20le=20contr=C3=B4le=20sur=20sa=20whitelist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php.example | 1 + index.php | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config.php.example b/config.php.example index 84d6fa9..1493324 100644 --- a/config.php.example +++ b/config.php.example @@ -29,6 +29,7 @@ /** * More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge + * replace FALSE with the twitterbridge request URL (example: 'http://www.suumitsu.eu/twitter/?u=' ) **/ // define( 'API_TWITTER', FALSE ); diff --git a/index.php b/index.php index 03b1bc4..ae4a066 100755 --- a/index.php +++ b/index.php @@ -519,6 +519,9 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO $sitetype = 'twitter'; $siteurl = 'http://twitter.com/'. $socialaccount; $rssurl = API_TWITTER.$socialaccount; + // check + $twitterbridge = get_headers($rssurl, 1); + if ($twitterbridge['0'] == 'HTTP/1.1 403 Forbidden') { $error[] = "La twitterbridge a refusé ce nom d'utilisateur:
\n
".htmlentities($twitterbridge['X-twitterbridge']).'
'; } } else $error[] = 'Vous devez définir une API Twitter -> RSS dans votre fichier de configuration (see TwitterBridge).'; @@ -555,14 +558,9 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO if( empty($error) ) { try { - // TwitterBridge user will be allowed after Autoblog creation - // TODO: Twitter user does not exist ? - // TODO: get remote like http://wwz.suumitsu.eu/twitter/whitelist.json, decode, check if is in array, return error or continue - if($sitetype != 'twitter') { $headers = get_headers($rssurl, 1); if (strpos($headers[0], '200') === FALSE) throw new Exception('Flux inaccessible (compte inexistant ?)'); - } createAutoblog($sitetype, ucfirst($socialinstance) .' - '. $socialaccount, $siteurl, $rssurl); $success[] = ' @@ -788,7 +786,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
Twitter
'; + echo 'Twitter (via twitterbridge)
'; else echo 'Twitter
'; ?> Identica
From 2838ceb46653af07ad062732035090529493422d Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 17 May 2013 11:42:42 +0200 Subject: [PATCH 008/105] fix: liens flux changements --- functions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/functions.php b/functions.php index da867ca..b8c9d87 100755 --- a/functions.php +++ b/functions.php @@ -262,17 +262,17 @@ function displayXMLstatus($status, $response_code, $autoblog_url, $autoblog_titl switch ($status) { case 'unavailable': - return 'Autoblog "'.$autoblog_title.'": site distant inaccessible (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'": site distant inaccessible (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; case 'moved': - return 'Autoblog "'.$autoblog_title.'": site distant redirigé (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'": site distant redirigé (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; case 'not_found': - return 'Autoblog "'.$autoblog_title.'": site distant introuvable (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'": site distant introuvable (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; case 'remote_error': - return 'Autoblog "'.$autoblog_title.'": site distant a problème serveur (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'": site distant a problème serveur (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; case 'available': - return 'Autoblog "'.$autoblog_title.'": site distant à nouveau opérationnel (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'": site distant à nouveau opérationnel (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; case 'new_autoblog_added': - return 'Autoblog "'.$autoblog_title.'" ajouté (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" ajouté (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; } } @@ -288,7 +288,7 @@ if(file_exists(RESOURCES_FOLDER.'rss.json')) foreach ($json as $item) { $description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']); - $link = serverUrl(true).AUTOBLOGS_FOLDER.$item['autoblog_url']; + $link = serverUrl(true).$item['autoblog_url']; $date = date("r", $item['timestamp']); print << Date: Sun, 2 Jun 2013 21:40:29 +0200 Subject: [PATCH 009/105] Fix LOCAL_URL selon http/http --- autoblogs/autoblog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 16b8063..1e78385 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -41,7 +41,7 @@ if (!defined('MEDIA_DIR')) define('MEDIA_DIR', ROOT_DIR . '/media'); if (!defined('LOCAL_URL')) { // Automagic URL discover - define('LOCAL_URL', 'http' . (!empty($_SERVER['HTTPS']) ? 's' : '')."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"); + define('LOCAL_URL', 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '')."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"); } if (!defined('LOCAL_URI')) From ff4fae57e90023efafb2ddba1f8391423cbed39e Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 2 Jun 2013 21:52:24 +0200 Subject: [PATCH 010/105] =?UTF-8?q?Inclure=20titre=20=C3=A0=20la=20recherc?= =?UTF-8?q?he?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoblogs/autoblog.php | 1 + 1 file changed, 1 insertion(+) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 1e78385..90071cc 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -466,6 +466,7 @@ class VroumVroum_Blog $res = $this->articles->query('SELECT id, uri, title, content FROM articles WHERE content LIKE \'%'.$this->articles->escapeString($query).'%\' + OR title LIKE \'%'.$this->articles->escapeString($query).'%\' ORDER BY id DESC LIMIT 0,100;'); From a840a715e6392ef8321a8f1de5d9507c037184a3 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 17 Jun 2013 12:22:29 +0200 Subject: [PATCH 011/105] beta: media import --- autoblogs/autoblog.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 90071cc..b61afa3 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -550,6 +550,45 @@ class VroumVroum_Blog } } +// MEDIA IMPORT PROCESSING + +if(file_exists('import.json')) + { + if(!file_exists('import.lock')) + { + $json = json_decode(file_get_contents('import.json'), true); + $count = count($json['files']); + file_put_contents('import.lock', $count); /* one-process locking */ + $remoteurl = $json['url']; + if (!file_exists('media')) { mkdir('media'); } + $time = time(); + $maxtime = $time + 3; /* max exec time: 3 seconds */ + while ($time <= $maxtime) + { + $file = array_shift($json['files']); /* get first element while unstacking */ + if(!empty($file)) + { copy($remoteurl.$file, "media/$file"); file_put_contents('import.json', json_encode($json)); } /* TOCHECK: get_headers() & filesize() when header "content-lenght" */ + else { unlink('import.json'); } /* first element empty: import finished */ + $time = time(); + } + $count = count($json['files']); + unlink('import.lock'); + } +/* return import information page */ ?> + + + + + +Autoblog media import + + +Import running: files remaining.
+The page should refresh every second. If not, refresh manually. + + + Date: Mon, 17 Jun 2013 12:31:05 +0200 Subject: [PATCH 012/105] =?UTF-8?q?beta:=20d=C3=A9l=C3=A9gation=20import?= =?UTF-8?q?=20medias=20dans=20XSAF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xsaf3.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index 417f63f..c32f457 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -112,20 +112,13 @@ function xsafimport($xsafremote, $max_exec_time) { $remote_db = str_replace("?export", $foldername."/articles.db", $xsafremote); copy($remote_db, './'. $foldername .'/articles.db'); } - + /* préparation à la récupération des médias distants */ if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) { $remote_media=str_replace("?export", $foldername."/?media", $xsafremote); $json_media_import = file_get_contents($remote_media); if(!empty($json_media_import)) - { - mkdir('./'.$foldername.'/media/'); - $json_media_import = json_decode($json_media_import, true); - $media_path=$json_media_import['url']; - if(!empty($json_media_import['files'])) { - foreach ($json_media_import['files'] as $value) { - copy($media_path.$value, './'.$foldername.'/media/'.$value); - } - } + { + file_put_contents('./'. $foldername .'/import.json', $json_media_import); } } From 42e6cc26ae97f5d1f25c2f081c3514c0dd6fc112 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 26 Jun 2013 09:32:27 +0200 Subject: [PATCH 013/105] sitemap indent --- index.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index ae4a066..39cf47c 100755 --- a/index.php +++ b/index.php @@ -351,17 +351,17 @@ if (isset($_GET['sitemap'])) { header('Content-Type: application/xml'); $proto=(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')?"https://":"http://"; - echo ''; - echo ''.$proto."{$_SERVER['HTTP_HOST']}".str_replace('?sitemap', '', $_SERVER['REQUEST_URI'])."\n"; - echo ''.date('c', time())."\n"; - echo 'daily'; + echo ''."\n".''."\n"; + echo "\n ".$proto."{$_SERVER['HTTP_HOST']}".str_replace('?sitemap', '', $_SERVER['REQUEST_URI'])."\n"; + echo ' '.date('c', time())."\n"; + echo " daily\n\n"; $subdirs = glob(AUTOBLOGS_FOLDER . "*"); foreach($subdirs as $unit) { if(is_dir($unit)) { $unit=substr($unit, 2); - echo ''.$proto.$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, -9)."$unit/"."\n"; - echo ''.date('c', filemtime($unit))."\n"; - echo 'hourly'; + echo "\n ".$proto.$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, -9)."$unit/"."\n"; + echo ' '.date('c', filemtime($unit))."\n"; + echo " hourly\n\n\n"; } } echo ''; From 584c0888dd99d4ba45b7b5b6a675767feddaea67 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 26 Jun 2013 13:35:19 +0200 Subject: [PATCH 014/105] experimental: twitter2rss (not included) --- twitter2rss.php | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 twitter2rss.php diff --git a/twitter2rss.php b/twitter2rss.php new file mode 100755 index 0000000..9bcf177 --- /dev/null +++ b/twitter2rss.php @@ -0,0 +1,115 @@ +> suggéré pour Projet Autoblog + */ + + if (!isset($_GET["name"])) + die (); + + $name = $_GET["name"]; + $str = file_get_contents("https://twitter.com/$name"); + + $nb = preg_match_all('%
\d+)"(.*)'. + '(data-retweet-id="(?P\d+)"(.*))?'. + 'data-screen-name="(?P[^"]+)"(.*)'. + '(?P<fullname>[^(.*)'. + 'data-time="(?P\d+)"(.*)'. + '

(?P.*)

'. + '%sU', $str, $arr); + + function parsemessage($message) + { + $message = preg_replace('%]+)>%', ']+)>https?://([^/]+)/[^<]*%', '[$2]', $message); + $message = strip_tags($message); + return $message; + } + + $fullname = "?"; + $updated = ""; + if ($nb !== false) + { + for ($i = 0; $i < $nb; $i++) + { + $mname = $arr["name"][$i]; + $mfullname = $arr["fullname"][$i]; + if ($updated == "") + $updated = date(DATE_ATOM, $arr["created"][$i]); + + if ($mname == $name) + { + $fullname = $mfullname; + break; + } + } + } + + header('Content-type: application/xml; charset=UTF-8', true); + echo '' . PHP_EOL; +?> + + Twitter / <?php echo $name ?> + tag:twitter.com,2013:Status: + + "> + + Twitter de . +@$mname : "; + + $title = htmlspecialchars(parsetitle($rt . $message)); + + $header = "\"$mname\"/ $mfullname (@$mname)
\r\n"; + $footer = "
\r\nAfficher la conversation"; + $message = "$header$rt$message$footer"; + $message = htmlspecialchars($message); + if(substr($title, 0, 1) !== '@') { // exclude response + echo << + $title + $message + tag:twitter.com,2013:https://twitter.com/$name/status/$id + $created + $created + + + + $name + https://twitter.com/$name + + +HTML; + } // end exclude response + } + } + +?> +
+ From 6c6d25154d1ba85c90f414afa6ad23ece220fba2 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 26 Jun 2013 13:39:28 +0200 Subject: [PATCH 015/105] fix filename: its ATOM, not RSS --- twitter2rss.php => twitter2feed.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename twitter2rss.php => twitter2feed.php (100%) diff --git a/twitter2rss.php b/twitter2feed.php similarity index 100% rename from twitter2rss.php rename to twitter2feed.php From 7861c9b091e30445204e188f37945796a922ad1b Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 28 Jun 2013 11:33:17 +0200 Subject: [PATCH 016/105] fix: source url in feed --- autoblogs/autoblog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index b61afa3..97ba062 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -622,7 +622,7 @@ if (isset($_GET['feed'])) // FEED '.date(DATE_ATOM, $art['date']).' - source)
'.escape_content($art['content']).']]> + source)
'.escape_content($art['content']).']]>
'; } From 1a9248b003d37b762619c15f44e9b16643968f1d Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 28 Jun 2013 11:43:54 +0200 Subject: [PATCH 017/105] add social: Youtube --- index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 39cf47c..116e09a 100755 --- a/index.php +++ b/index.php @@ -554,8 +554,11 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO $rssurl = $siteurl."?do=rss"; $socialaccount = get_title_from_feed($rssurl); } - - + elseif($socialinstance === 'youtube') { + $sitetype = 'generic'; + $siteurl = 'https://www.youtube.com/user/'.$socialaccount; + $rssurl = 'https://gdata.youtube.com/feeds/base/users/'.$socialaccount.'/uploads?alt=atom&orderby=published'; + } if( empty($error) ) { try { $headers = get_headers($rssurl, 1); @@ -791,6 +794,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY Identica

+ Youtube

From 238ead52073f1eef0bde13ce971c513fe56fd368 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 13:53:50 +0200 Subject: [PATCH 018/105] Missing config.php doesnt print an error anymore. --- index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.php b/index.php index 116e09a..e33b7fa 100755 --- a/index.php +++ b/index.php @@ -26,8 +26,6 @@ $success = array(); if(file_exists("config.php")){ require_once "config.php"; -}else{ - $error[] = "config.php not found !"; } if(file_exists("functions.php")){ require_once "functions.php"; From e9ee51a8d2f19a7716a0b678ec3dc001ed13bfba Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 14:15:21 +0200 Subject: [PATCH 019/105] Minor changes in readme --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index db13a6b..040b438 100755 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ Projet Autoblog =============== -Création, gestion et échange de blogs automatiques contre la censure (à propos: http://sebsauvage.net/streisand.me/fr/ ). +Création, gestion et échange de blogs automatiques contre la censure (à propos: http://sebsauvage.net/streisand.me/fr/). Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). Nouveautés majeures =================== -- "ferme" d'autoblogs avec ajout facile par différents formulaires (générique, microblogging, OPML, marque-pages) -- échange de références entre fermes avec XSAF (Cross-Site Autoblog Farming) -- vérification du statut des sites distants, et flux de suivi des changements -- export facile des références, articles et médias -- contrôle de version et alerte de mise à jour -- apparence de l'autoblog selon son type -- CSS utilisateur personnalisable -- hébergement de documents spécifiques +- Ferme d'autoblogs avec ajout facile par différents formulaires (générique, microblogging, OPML, marque-pages). +- Échange de références entre fermes avec XSAF ([Cross-Site Autoblog Farming](https://github.com/mitsukarenai/Projet-Autoblog/wiki/XSAF---Cross-Site-Autoblog-Farming)). +- Vérification du statut des sites distants, et flux de suivi des changements. +- Export des références, articles et médias. +- Contrôle de version de la ferme et alerte de mise à jour. +- Identification du type d'autoblog. +- CSS utilisateur personnalisable. +- Hébergement de documents divers (PDF, images, réplique de site web, etc.). -Branches : +Branches =================== - [master](https://github.com/mitsukarenai/Projet-Autoblog/tree/master/) _(développement)_ : Autoblog Project serie 0.3 par Mitsu, Oros, Arthur Hoaro @@ -28,9 +28,11 @@ Branches : Pré-requis techniques ===================== -- serveur web avec PHP 5.3 et son support SQLite +- Serveur web (Apache, nginx, etc.) +- PHP 5.3 ou supérieur +- Support SQLite 3 pour PHP Licence ===================== -- domaine public +Domaine public. From 905f314a9bb2448d9f596ab9a960763ef1a5a524 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 15:07:26 +0200 Subject: [PATCH 020/105] Fixes #35 --- functions.php | 49 +++++++++++++++++++++++++++---------------------- index.php | 4 ++-- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/functions.php b/functions.php index b8c9d87..0097e5f 100755 --- a/functions.php +++ b/functions.php @@ -39,7 +39,7 @@ if( !defined('FOOTER')) define( 'FOOTER', 'D\'après les premières versions de * Functions **/ function NoProtocolSiteURL($url) { - $protocols = array("http://", "https://"); + $protocols = array("http://", "https://"); $siteurlnoproto = str_replace($protocols, "", $url); // Remove the / at the end of string @@ -262,35 +262,40 @@ function displayXMLstatus($status, $response_code, $autoblog_url, $autoblog_titl switch ($status) { case 'unavailable': - return 'Autoblog "'.$autoblog_title.'": site distant inaccessible (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" : site distant inaccessible (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'moved': - return 'Autoblog "'.$autoblog_title.'": site distant redirigé (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" : site distant redirigé (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'not_found': - return 'Autoblog "'.$autoblog_title.'": site distant introuvable (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" : site distant introuvable (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'remote_error': - return 'Autoblog "'.$autoblog_title.'": site distant a problème serveur (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" : site distant a problème serveur (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'available': - return 'Autoblog "'.$autoblog_title.'": site distant à nouveau opérationnel (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" : site distant à nouveau opérationnel (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'new_autoblog_added': - return 'Autoblog "'.$autoblog_title.'" ajouté (code '.$response_code.')
Autoblog: '.$autoblog_title.'
Site: '. $autoblog_sourceurl .'
RSS: '.$autoblog_sourcefeed.''; + return 'Autoblog "'.$autoblog_title.'" ajouté.
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; } } function displayXML() { -header('Content-type: application/rss+xml; charset=utf-8'); -echo ' -'.serverUrl(true).''; -echo 'Projet Autoblog'. ((strlen(HEAD_TITLE)>0) ? ' | '. HEAD_TITLE : '').''.serverUrl(true),"Projet Autoblog - RSS : Ajouts et changements de disponibilité.".''; -if(file_exists(RESOURCES_FOLDER.'rss.json')) -{ - $json = json_decode(file_get_contents(RESOURCES_FOLDER.'rss.json'), true); - rsort($json); - foreach ($json as $item) + header('Content-type: application/rss+xml; charset=utf-8'); + echo ' + '.serverUrl(true).''; + echo 'Projet Autoblog'. ((strlen(HEAD_TITLE)>0) ? ' | '. HEAD_TITLE : '').'Projet Autoblog - RSS : Ajouts et changements de disponibilité.'; + if(file_exists(RESOURCES_FOLDER.'rss.json')) { - $description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']); - $link = serverUrl(true).$item['autoblog_url']; - $date = date("r", $item['timestamp']); - print << $Value) { + $item[$Key] = escape($Value); + } + + $description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']); + $link = serverUrl(true).$item['autoblog_url']; + $date = date("r", $item['timestamp']); + print << {$item['autoblog_title']} @@ -301,8 +306,8 @@ if(file_exists(RESOURCES_FOLDER.'rss.json')) {$date} EOT; + } } -} -echo ''; + echo ''; } ?> diff --git a/index.php b/index.php index e33b7fa..d2e0e43 100755 --- a/index.php +++ b/index.php @@ -72,7 +72,7 @@ function get_link_from_datafeed($data) { return $link->item(0)->nodeValue; } else { - return $channel['link']; + return escape($channel['link']); } } @@ -685,7 +685,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?> - + Date: Sun, 30 Jun 2013 16:04:54 +0200 Subject: [PATCH 021/105] minor... --- README.md | 2 +- functions.php | 13 +++++-------- index.php | 10 ++++------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 040b438..3406889 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Projet Autoblog =============== -Création, gestion et échange de blogs automatiques contre la censure (à propos: http://sebsauvage.net/streisand.me/fr/). +Création, gestion et échange de blogs automatiques contre la censure ([plus d'info](http://sebsauvage.net/streisand.me/fr/)). Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). diff --git a/functions.php b/functions.php index 0097e5f..d8e6822 100755 --- a/functions.php +++ b/functions.php @@ -145,6 +145,8 @@ function getArticlesPerPage( $type ) { return 20; case 'shaarli': return 20; + case 'youtube': + return 10; default: return 5; } @@ -167,14 +169,6 @@ function getInterval( $type ) { function getTimeout( $type ) { switch( $type ) { - case 'microblog': - return 30; - case 'twitter': - return 30; - case 'identica': - return 30; - case 'shaarli': - return 30; default: return 30; } @@ -190,6 +184,9 @@ function updateType($siteurl) { elseif( strpos( $siteurl, 'shaarli' ) !== FALSE ) { return array('type' => 'shaarli', 'name' => 'shaarli'); } + elseif( strpos( $siteurl, 'youtube.com' ) !== FALSE ) { + return array('type' => 'youtube', 'name' => 'youtube'); + } else return array('type' => 'generic', 'name' => ''); } diff --git a/index.php b/index.php index d2e0e43..53d5e25 100755 --- a/index.php +++ b/index.php @@ -116,7 +116,7 @@ function create_from_opml($opml) { throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.'); $sitetype = escape($outline['text']); - if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'identica' ) + if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'identica' && $sitetype != 'youtube') $sitetype = 'generic'; $rssurl = DetectRedirect(escape($outline['xmlUrl'])); @@ -185,7 +185,6 @@ if (isset($_GET['rss'])) { **/ if (isset($_GET['check'])) { - //echo "1"; header('Content-type: image/svg+xml'); $randomtime=rand(86400, 259200); /* intervalle de mise à jour: de 1 à 3 jours (pour éviter que le statut de tous les autoblogs soit rafraichi en bloc et bouffe le CPU) */ $expire=time() -$randomtime ; @@ -504,13 +503,12 @@ if(!empty($_GET['via_button']) && $_GET['number'] === '17' && ALLOW_NEW_AUTOBLOG * ADD BY SOCIAL / SHAARLI **/ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) -{; +{ $socialinstance = strtolower(escape($_POST['socialinstance'])); $socialaccount = (!empty($_POST['socialaccount'])) ? strtolower(escape($_POST['socialaccount'])) : false; if( $socialaccount === false && $socialinstance !== 'shaarli') $error[] = 'Le compte social doit être renseigné.'; - - if( !empty($_POST['number']) && !empty($_POST['antibot']) && check_antibot($_POST['number'], $_POST['antibot']) && empty($error)) { + elseif( !empty($_POST['number']) && !empty($_POST['antibot']) && check_antibot($_POST['number'], $_POST['antibot'])) { if($socialinstance === 'twitter') { if( API_TWITTER !== FALSE ) { @@ -553,7 +551,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO $socialaccount = get_title_from_feed($rssurl); } elseif($socialinstance === 'youtube') { - $sitetype = 'generic'; + $sitetype = 'youtube'; $siteurl = 'https://www.youtube.com/user/'.$socialaccount; $rssurl = 'https://gdata.youtube.com/feeds/base/users/'.$socialaccount.'/uploads?alt=atom&orderby=published'; } From 028d58e87bc594dc5a6881d97cb9dbdb4f725383 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 16:08:44 +0200 Subject: [PATCH 022/105] oops --- functions.php | 6 +++--- index.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index d8e6822..ff91c34 100755 --- a/functions.php +++ b/functions.php @@ -184,9 +184,9 @@ function updateType($siteurl) { elseif( strpos( $siteurl, 'shaarli' ) !== FALSE ) { return array('type' => 'shaarli', 'name' => 'shaarli'); } - elseif( strpos( $siteurl, 'youtube.com' ) !== FALSE ) { - return array('type' => 'youtube', 'name' => 'youtube'); - } + //elseif( strpos( $siteurl, 'youtube.com' ) !== FALSE ) { + // return array('type' => 'youtube', 'name' => 'youtube'); + //} else return array('type' => 'generic', 'name' => ''); } diff --git a/index.php b/index.php index 53d5e25..9f6a96c 100755 --- a/index.php +++ b/index.php @@ -551,7 +551,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO $socialaccount = get_title_from_feed($rssurl); } elseif($socialinstance === 'youtube') { - $sitetype = 'youtube'; + $sitetype = 'generic'; $siteurl = 'https://www.youtube.com/user/'.$socialaccount; $rssurl = 'https://gdata.youtube.com/feeds/base/users/'.$socialaccount.'/uploads?alt=atom&orderby=published'; } From 042b9b95765ea1b01242c4b111f0ee5ddb7774f0 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 16:40:02 +0200 Subject: [PATCH 023/105] Youtube type added --- autoblogs/autoblog.php | 2 +- functions.php | 6 +++--- index.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 97ba062..eb21765 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -717,7 +717,7 @@ $css=' * { margin: 0; padding: 0; } #error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; } '; -if($site_type == 'generic') // custom CSS for generic +if($site_type == 'generic' || $site_type == 'youtube') // custom CSS for generic { $css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; } .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } diff --git a/functions.php b/functions.php index ff91c34..d0ec234 100755 --- a/functions.php +++ b/functions.php @@ -184,9 +184,9 @@ function updateType($siteurl) { elseif( strpos( $siteurl, 'shaarli' ) !== FALSE ) { return array('type' => 'shaarli', 'name' => 'shaarli'); } - //elseif( strpos( $siteurl, 'youtube.com' ) !== FALSE ) { - // return array('type' => 'youtube', 'name' => 'youtube'); - //} + elseif( strpos( $siteurl, 'youtube.com' ) !== FALSE ) { + return array('type' => 'youtube', 'name' => ''); + } else return array('type' => 'generic', 'name' => ''); } diff --git a/index.php b/index.php index 9f6a96c..53d5e25 100755 --- a/index.php +++ b/index.php @@ -551,7 +551,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO $socialaccount = get_title_from_feed($rssurl); } elseif($socialinstance === 'youtube') { - $sitetype = 'generic'; + $sitetype = 'youtube'; $siteurl = 'https://www.youtube.com/user/'.$socialaccount; $rssurl = 'https://gdata.youtube.com/feeds/base/users/'.$socialaccount.'/uploads?alt=atom&orderby=published'; } From 8e8797457d9a426329c8a63ec7248ade37663617 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 16:52:53 +0200 Subject: [PATCH 024/105] Fixes #5 --- .gitignore | 2 ++ index.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 79c93a2..452c5e3 100755 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ resources/rss.json resources/user.css autoblogs/* !autoblogs/autoblog.php +docs/* +!docs/docs.txt diff --git a/index.php b/index.php index 53d5e25..4cf4579 100755 --- a/index.php +++ b/index.php @@ -861,7 +861,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY foreach($subdirs as $unit) { if(!is_dir($unit) || file_exists( $unit . '/index.html' ) || file_exists( $unit . '/index.htm' ) || file_exists( $unit . '/index.php' ) ) { - $docs[] = ''. substr($unit, (strrpos($unit, '/')) + 1 ) .''; + $docs[] = ''. substr($unit, (strrpos($unit, '/')) + 1 ) .''; } } } From 9b357fa43a600b64f9abdbd4374144c0d0b82296 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 30 Jun 2013 17:04:23 +0200 Subject: [PATCH 025/105] change icon status type --- index.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index 4cf4579..5939e57 100755 --- a/index.php +++ b/index.php @@ -183,6 +183,47 @@ if (isset($_GET['rss'])) { /** * SVG **/ +if (isset($_GET['icon'])) +{ +header('Content-type: image/svg+xml'); +function svg_base($color) + { + $svg = ''; + return $svg; + } + + $svg_twitter=svg_base('#3aaae1'); + $svg_youtube=svg_base('#a00000'); + $svg_statusnet=svg_base('#ff6a00'); + $svg_shaarli=svg_base('#008000'); + $svg_generic=svg_base('#000000'); + +$svg_type = ''; + + switch ($_GET['icon']) { + case "twitter": + $svg_type = $svg_twitter; + break; + case "microblog": + $svg_type = $svg_statusnet; + break; + case "youtube": + $svg_type = $svg_youtube; + break; + case "identica": + $svg_type = $svg_youtube; + break; + case "shaarli": + $svg_type = $svg_shaarli; + break; + case "generic": + $svg_type = $svg_generic; + break; + } + +die($svg_type); +} + if (isset($_GET['check'])) { header('Content-type: image/svg+xml'); @@ -190,12 +231,15 @@ if (isset($_GET['check'])) $expire=time() -$randomtime ; /* SVG minimalistes */ - $svg_vert='OK'; - $svg_jaune='mv'; - $svg_rouge='err'; - $svg_twitter=''; - $svg_identica=''; - $svg_statusnet=''; + +function svg_status($fill, $stroke, $text) + { + $svg = ''.$text.''; + } + + $svg_vert=svg_status('#00ff00', '#008000', 'OK'); + $svg_jaune=svg_status('#ffff00', '#ffcc00', 'mv'); + $svg_rouge=svg_status('#ff0000', '#800000', 'err'); $errorlog="./".escape( $_GET['check'] ) ."/error.log"; @@ -912,7 +956,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY foreach ($autoblogs as $key => $autoblog) { $opml_link='opml'; $autoblogs_display .= '
- +
config ini '.$opml_link.' | '.escape($autoblog->site_type).' source: '.escape($autoblog->site_url).'
'; } From 6e3bac5ea7b0a32964c3a6d611070e374924abc3 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 30 Jun 2013 17:07:35 +0200 Subject: [PATCH 026/105] =?UTF-8?q?(pr=C3=A9cipitation)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.php b/index.php index 5939e57..0de1754 100755 --- a/index.php +++ b/index.php @@ -255,11 +255,6 @@ function svg_status($fill, $stroke, $text) else /* ..sinon, lancer la procédure de contrôle */ { $ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die; - - if(strpos(strtolower($ini['SITE_TITLE']), 'twitter') !== FALSE) { die($svg_twitter); } /* Twitter */ - if(strpos(strtolower($ini['SITE_TITLE']), 'identica') !== FALSE) { die($svg_identica); } /* Identica */ - if(strpos(strtolower($ini['SITE_TYPE']), 'microblog') !== FALSE) { die($svg_statusnet); } /* Statusnet */ - $headers = get_headers($ini['FEED_URL']); /* le flux est indisponible (typiquement: erreur DNS ou possible censure) - à vérifier */ if(empty($headers) || $headers === FALSE ) { From 516cc6e4b411d5939b8f67497aa7fe8f27eb4edc Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 30 Jun 2013 17:11:02 +0200 Subject: [PATCH 027/105] =?UTF-8?q?forc=C3=A9ment,=20si=20la=20base=20n'es?= =?UTF-8?q?t=20pas=20return=C3=A9e..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 0de1754..19eea78 100755 --- a/index.php +++ b/index.php @@ -235,6 +235,7 @@ if (isset($_GET['check'])) function svg_status($fill, $stroke, $text) { $svg = ''.$text.''; + return $svg; } $svg_vert=svg_status('#00ff00', '#008000', 'OK'); From 65c03738ac1489e768b57740fb67395eadac5f5c Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 18:01:48 +0200 Subject: [PATCH 028/105] Bugfix --- xsaf3.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index c32f457..af22667 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -95,7 +95,7 @@ function xsafimport($xsafremote, $max_exec_time) { /* autoblog */ if( $result === true ) { - $foldername = urlToFolder($sitename, $rssurl); + $foldername = urlToFolder($siteurl, $rssurl); try { createAutoblog($sitetype, $sitename, $siteurl, $rssurl); @@ -114,8 +114,12 @@ function xsafimport($xsafremote, $max_exec_time) { } /* préparation à la récupération des médias distants */ if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) { - $remote_media=str_replace("?export", $foldername."/?media", $xsafremote); + $remote_media=str_replace("?export", $foldername."/?media", $xsafremote); + if(DEBUG) + debug("Récupération de la liste des médias à $remote_media
"); $json_media_import = file_get_contents($remote_media); + if(DEBUG) + debug($json_media_import); if(!empty($json_media_import)) { file_put_contents('./'. $foldername .'/import.json', $json_media_import); From 4b86dcf26d4867d000502c7a8598fbf3a588a52f Mon Sep 17 00:00:00 2001 From: Arthur Date: Sun, 30 Jun 2013 18:18:35 +0200 Subject: [PATCH 029/105] Bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (à la volée parce que j'ai supprimé mes fichiers de dev... ><) --- xsaf3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xsaf3.php b/xsaf3.php index af22667..a686279 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -120,7 +120,7 @@ function xsafimport($xsafremote, $max_exec_time) { $json_media_import = file_get_contents($remote_media); if(DEBUG) debug($json_media_import); - if(!empty($json_media_import)) + if(!empty($json_media_import) && !&& !strpos($json_media_import, '[]}"')) { file_put_contents('./'. $foldername .'/import.json', $json_media_import); } From 2b20cf08b7a865c5513c2cce0983d80243a1f9ae Mon Sep 17 00:00:00 2001 From: Arthur Date: Sun, 30 Jun 2013 18:19:21 +0200 Subject: [PATCH 030/105] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (à la volée parce que j'ai supprimé mes fichiers de dev... ><) --- autoblogs/autoblog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index eb21765..ab6f5c1 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -568,7 +568,7 @@ if(file_exists('import.json')) $file = array_shift($json['files']); /* get first element while unstacking */ if(!empty($file)) { copy($remoteurl.$file, "media/$file"); file_put_contents('import.json', json_encode($json)); } /* TOCHECK: get_headers() & filesize() when header "content-lenght" */ - else { unlink('import.json'); } /* first element empty: import finished */ + else { unlink('import.json'); break; } /* first element empty: import finished */ $time = time(); } $count = count($json['files']); From 4c4bae1fc1794e2f3d3b5ee25fd50bd351ad5244 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 30 Jun 2013 18:24:52 +0200 Subject: [PATCH 031/105] ... --- xsaf3.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index a686279..046aaa4 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -1,11 +1,11 @@ Date: Sun, 30 Jun 2013 18:30:30 +0200 Subject: [PATCH 032/105] =?UTF-8?q?Tout=20fonctionne,=20je=20ne=20touche?= =?UTF-8?q?=20=C3=A0=20rien.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xsaf3.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index 046aaa4..0134923 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -1,10 +1,10 @@ "); $json_media_import = file_get_contents($remote_media); if(DEBUG) debug($json_media_import); - if(!empty($json_media_import) && !strpos($json_media_import, '[]}"')) + if(!empty($json_media_import) && !strpos($json_media_import, '[]}')) { - file_put_contents('./'. $foldername .'/import.json', $json_media_import); + file_put_contents('./'. $foldername .'/import.json', $json_media_import); } } From e13089514c667b7dbe2a13a157e6671b40c83f47 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 1 Jul 2013 19:25:30 +0200 Subject: [PATCH 033/105] =?UTF-8?q?status=20SVG;=20twitter2feed=20-=20stat?= =?UTF-8?q?us=20SVG=20plus=20discret=20quand=20c'est=20ok=20-=20support=20?= =?UTF-8?q?twitter2feed=20en=20test=20(valeur=20par=20d=C3=A9faut:=20LOCAL?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php.example | 7 ++++--- index.php | 36 +++++++++++++++++++++++------------- twitter2feed.php | 20 ++++++++++++++------ 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/config.php.example b/config.php.example index 1493324..d82b527 100644 --- a/config.php.example +++ b/config.php.example @@ -28,10 +28,11 @@ // define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE ); /** - * More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge - * replace FALSE with the twitterbridge request URL (example: 'http://www.suumitsu.eu/twitter/?u=' ) + * More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge and twitter2feed: https://github.com/mitsukarenai/twitter2feed + * replace LOCAL with the twitterbridge request URL (example: 'http://www.suumitsu.eu/twitter/?u=' ) or leave LOCAL to use the included twitter2feed.php. + * set to FALSE if you want to fully disable Twitter support **/ -// define( 'API_TWITTER', FALSE ); +// define( 'API_TWITTER', LOCAL ); /** * Import autoblogs from friend's autoblog farm - Add a link to the JSON export diff --git a/index.php b/index.php index 19eea78..d90e2e6 100755 --- a/index.php +++ b/index.php @@ -232,15 +232,15 @@ if (isset($_GET['check'])) /* SVG minimalistes */ -function svg_status($fill, $stroke, $text) +function svg_status($fill, $text, $back) { - $svg = ''.$text.''; + $svg = ''.$back.''.$text.''; return $svg; } - $svg_vert=svg_status('#00ff00', '#008000', 'OK'); - $svg_jaune=svg_status('#ffff00', '#ffcc00', 'mv'); - $svg_rouge=svg_status('#ff0000', '#800000', 'err'); + $svg_ok=svg_status('#008000', 'ok', ''); + $svg_mv=svg_status('#0000ff', 'mv', ''); + $svg_err=svg_status('#000000', 'err', ''); $errorlog="./".escape( $_GET['check'] ) ."/error.log"; @@ -249,9 +249,9 @@ function svg_status($fill, $stroke, $text) if(file_exists($errorlog) && filemtime($errorlog) < $expire) { unlink($errorlog); } /* errorlog périmé ? Suppression. */ if(file_exists($errorlog)) /* errorlog existe encore ? se contenter de lire sa taille pour avoir le statut */ { - if(filesize($errorlog) == "0") {die($svg_vert);} - else if(filesize($errorlog) == "1") {die($svg_jaune);} - else {die($svg_rouge);} + if(filesize($errorlog) == "0") {die($svg_ok);} + else if(filesize($errorlog) == "1") {die($svg_mv);} + else {die($svg_err);} } else /* ..sinon, lancer la procédure de contrôle */ { @@ -263,7 +263,7 @@ function svg_status($fill, $stroke, $text) updateXML('unavailable', 'nxdomain', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, '..'); - die($svg_rouge); + die($svg_err); } $code=explode(" ", $headers[0]); /* code retour 200: flux disponible */ @@ -272,7 +272,7 @@ function svg_status($fill, $stroke, $text) updateXML('available', '200', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, ''); - die($svg_vert); + die($svg_ok); } /* autre code retour: un truc a changé (redirection, changement de CMS, .. bref vvb.ini doit être corrigé) */ else { @@ -280,7 +280,7 @@ function svg_status($fill, $stroke, $text) updateXML('moved', '3xx', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, '.'); - die($svg_jaune); + die($svg_mv); } } } @@ -554,10 +554,15 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO if( API_TWITTER !== FALSE ) { $sitetype = 'twitter'; $siteurl = 'http://twitter.com/'. $socialaccount; - $rssurl = API_TWITTER.$socialaccount; + if ( API_TWITTER === 'LOCAL' ) { + $rssurl = serverUrl(true).'twitter2feed.php?u='.$socialaccount; + } + else { + $rssurl = API_TWITTER.$socialaccount; // check $twitterbridge = get_headers($rssurl, 1); if ($twitterbridge['0'] == 'HTTP/1.1 403 Forbidden') { $error[] = "La twitterbridge a refusé ce nom d'utilisateur:
\n
".htmlentities($twitterbridge['X-twitterbridge']).'
'; } + } } else $error[] = 'Vous devez définir une API Twitter -> RSS dans votre fichier de configuration (see TwitterBridge).'; @@ -825,7 +830,12 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
Twitter (via twitterbridge)
'; + { + if( API_TWITTER === 'LOCAL' ) + echo 'Twitter (local)
'; + else + echo 'Twitter (via twitterbridge)
'; + } else echo 'Twitter
'; ?> Identica
diff --git a/twitter2feed.php b/twitter2feed.php index 9bcf177..2014182 100755 --- a/twitter2feed.php +++ b/twitter2feed.php @@ -3,13 +3,21 @@ * Récupération du flux RSS d'un compte Twitter * Passez le nom du compte en Paramètre. Exemple: http://monsite.com/twit2rss.php?name=Craftbukkit * 2013 - by Tronics - * -- ajout exclusion de réponses par Mitsu >> suggéré pour Projet Autoblog */ - if (!isset($_GET["name"])) - die (); +// ---------------------------- +// Autoblog Project inclusion +// ---------------------------- +if(file_exists("config.php")) require_once "config.php"; +if( !defined('API_TWITTER')) {header("HTTP/1.1 404 Not Found"); die('API_TWITTER is undefined: make it LOCAL in "config.php" if you want me to work for you.');} +if ('API_TWITTER' === FALSE) {header("HTTP/1.1 404 Not Found"); die('Twitter support disabled in "config.php". Sorry.');} +if ('API_TWITTER' !== 'LOCAL') {header("HTTP/1.1 404 Not Found"); die('Custom twitterbridge defined in "config.php": leave me alone.');} +if(!isset($_GET['u'])) {header("HTTP/1.1 404 Not Found"); die('no username provided');} +$exclude_reply = '@'; // if you want twitter2feed to return replies too: $exclude_reply = ''; +// ---------------------------- +// Let's rock ! - $name = $_GET["name"]; + $name = $_GET["u"]; $str = file_get_contents("https://twitter.com/$name"); $nb = preg_match_all('%
\r\nAfficher la conversation"; $message = "$header$rt$message$footer"; $message = htmlspecialchars($message); - if(substr($title, 0, 1) !== '@') { // exclude response + if(substr($title, 0, 1) !== $exclude_reply) { echo << $title @@ -106,7 +114,7 @@ HTML; - } // end exclude response + } } } From 61a6fdf14af9e15c93bfbb58950e132b13c6e6ed Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 1 Jul 2013 19:44:29 +0200 Subject: [PATCH 034/105] =?UTF-8?q?quickfix:=20contr=C3=B4le=20du=20define?= =?UTF-8?q?d;=20valeur=20par=20d=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php.example | 2 +- functions.php | 2 +- twitter2feed.php | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.php.example b/config.php.example index d82b527..0280ded 100644 --- a/config.php.example +++ b/config.php.example @@ -32,7 +32,7 @@ * replace LOCAL with the twitterbridge request URL (example: 'http://www.suumitsu.eu/twitter/?u=' ) or leave LOCAL to use the included twitter2feed.php. * set to FALSE if you want to fully disable Twitter support **/ -// define( 'API_TWITTER', LOCAL ); +// define( 'API_TWITTER', 'LOCAL' ); /** * Import autoblogs from friend's autoblog farm - Add a link to the JSON export diff --git a/functions.php b/functions.php index d0ec234..273c265 100755 --- a/functions.php +++ b/functions.php @@ -29,7 +29,7 @@ if( !defined('ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK')) define( 'ALLOW_NEW_AUTOBLOGS_B if( !defined('ALLOW_NEW_AUTOBLOGS_BY_XSAF')) define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE ); // More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge -if( !defined('API_TWITTER')) define( 'API_TWITTER', FALSE ); +if( !defined('API_TWITTER')) define( 'API_TWITTER', 'LOCAL' ); if( !defined('LOGO')) define( 'LOGO', 'icon-logo.svg' ); if( !defined('HEAD_TITLE')) define( 'HEAD_TITLE', ''); diff --git a/twitter2feed.php b/twitter2feed.php index 2014182..7a0cefa 100755 --- a/twitter2feed.php +++ b/twitter2feed.php @@ -11,7 +11,8 @@ if(file_exists("config.php")) require_once "config.php"; if( !defined('API_TWITTER')) {header("HTTP/1.1 404 Not Found"); die('API_TWITTER is undefined: make it LOCAL in "config.php" if you want me to work for you.');} if ('API_TWITTER' === FALSE) {header("HTTP/1.1 404 Not Found"); die('Twitter support disabled in "config.php". Sorry.');} -if ('API_TWITTER' !== 'LOCAL') {header("HTTP/1.1 404 Not Found"); die('Custom twitterbridge defined in "config.php": leave me alone.');} +$api = API_TWITTER; +if ($api === 'LOCAL') { } else {header("HTTP/1.1 404 Not Found"); die('Custom twitterbridge defined in "config.php": leave me alone.');} if(!isset($_GET['u'])) {header("HTTP/1.1 404 Not Found"); die('no username provided');} $exclude_reply = '@'; // if you want twitter2feed to return replies too: $exclude_reply = ''; // ---------------------------- From 588d6f1540218aa0a1f8d362819414dc41ece266 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 5 Jul 2013 19:06:46 +0200 Subject: [PATCH 035/105] Add ERR SVG on 404 and 500 code status --- index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index d90e2e6..53be771 100755 --- a/index.php +++ b/index.php @@ -257,15 +257,18 @@ function svg_status($fill, $text, $back) { $ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die; $headers = get_headers($ini['FEED_URL']); + + if(!empty($headers)) + $code=explode(" ", $headers[0]); + /* le flux est indisponible (typiquement: erreur DNS ou possible censure) - à vérifier */ - if(empty($headers) || $headers === FALSE ) { + if(empty($headers) || $headers === FALSE || (!empty($code) && ($code[1] == '500' || $code[1] == '404'))) { if( $oldvalue !== null && $oldvalue != '..' ) { updateXML('unavailable', 'nxdomain', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, '..'); die($svg_err); } - $code=explode(" ", $headers[0]); /* code retour 200: flux disponible */ if($code[1] == "200") { if( $oldvalue !== null && $oldvalue != '' ) { From 9c0826f38d54d69d9fe11b02f7dc809a435f87aa Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 5 Jul 2013 19:08:37 +0200 Subject: [PATCH 036/105] Allow XSAF remote by default --- xsaf3.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index 0134923..8cc18df 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -3,8 +3,8 @@ define('DEBUG', false); define('XSAF_VERSION', 3); define('AUTOBLOG_FILE_NAME', 'autoblog.php'); -define('ALLOW_REMOTE_DB_DL', false); -define('ALLOW_REMOTE_MEDIA_DL', false); +define('ALLOW_REMOTE_DB_DL', true); +define('ALLOW_REMOTE_MEDIA_DL', true); define('EXEC_TIME', 10); header("HTTP/1.0 403 Forbidden"); /* Uncivilized method to prevent bot indexing, huh :) */ From 9a125ef44844bde0c19ff94c0529f80b785a218a Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 5 Jul 2013 20:26:45 +0200 Subject: [PATCH 037/105] Fixes regression introduced by 8e8797457d9a426329c8a63ec7248ade37663617 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 53be771..b4e4588 100755 --- a/index.php +++ b/index.php @@ -914,7 +914,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY foreach($subdirs as $unit) { if(!is_dir($unit) || file_exists( $unit . '/index.html' ) || file_exists( $unit . '/index.htm' ) || file_exists( $unit . '/index.php' ) ) { - $docs[] = ''. substr($unit, (strrpos($unit, '/')) + 1 ) .''; + $docs[] = ''. substr($unit, (strrpos($unit, '/')) + 1 ) .''; } } } From a364f2af287ee4c5f528a6e627f1e004553bb727 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 5 Jul 2013 21:13:45 +0200 Subject: [PATCH 038/105] Better integration of XSAF import --- autoblogs/autoblog.php | 101 +++++++++++++++++++++++++++++++++++++++-- functions.php | 9 ++-- 2 files changed, 102 insertions(+), 8 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index ab6f5c1..5715327 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -327,6 +327,17 @@ class VroumVroum_Blog return true; } + + public function mustUpdateXsaf() + { + if( file_exists('import.json') ) { + /*$out = file_get_contents('import.json'); + if( !is_numeric($out)) + return false;*/ + return true; + } + else return false; + } protected function _getStreamContext() { @@ -424,6 +435,36 @@ class VroumVroum_Blog return $updated; } + + public function updateXsaf() { + if($this->mustUpdateXsaf()) { + $json = json_decode(file_get_contents('import.json'), true); + $count = count($json['files']); + file_put_contents('import.lock', $count); /* one-process locking */ + $remoteurl = $json['url']; + if (!file_exists('media')) { + mkdir('media'); + } + $time = time(); + $maxtime = $time + 3; /* max exec time: 3 seconds */ + + while ($time <= $maxtime) { + $file = array_shift($json['files']); /* get first element while unstacking */ + if(!empty($file)) { + $this->_copy($remoteurl.$file, "media/$file"); + file_put_contents('import.json', json_encode($json)); + } /* TOCHECK: get_headers() & filesize() when header "content-lenght" */ + else { + unlink('import.json'); + break; + } /* first element empty: import finished */ + $time = time(); + } + + $count = count($json['files']); + unlink('import.lock'); + } + } public function listArticlesByPage($page = 1) { @@ -526,6 +567,11 @@ class VroumVroum_Blog if (!file_exists(MEDIA_DIR . '/' . $filename)) { try { + $limit = 512000; // 512ko + $fr = fopen($filePath, 'r'); + $limitedContent = fread($fr, $limit); + $fw = fopen($filePath, 'w'); + fwrite($fw, $limitedContent); $copied = $this->_copy($url, MEDIA_DIR . '/' . $filename); } catch (ErrorException $e) @@ -537,6 +583,13 @@ class VroumVroum_Blog } return $content; } + + public function getXsafCounter() { + if($this->mustUpdateXsaf()) { + $json = json_decode(file_get_contents('import.json'), true); + return count($json['files']); + } + } /* copy() is buggy with http streams and safe_mode enabled (which is bad), so here's a workaround */ protected function _copy($from, $to) @@ -551,8 +604,8 @@ class VroumVroum_Blog } // MEDIA IMPORT PROCESSING - -if(file_exists('import.json')) +// A SUPPRIMER +if(false && file_exists('import.json')) { if(!file_exists('import.lock')) { @@ -758,7 +811,11 @@ echo ' + '; + if( $vvb->mustUpdateXsaf()) { + echo ''; + } +echo '
@@ -779,7 +836,19 @@ echo '
'; -if ($vvb->mustUpdate()) +if( $vvb->mustUpdateXsaf()) { + echo ' +
+
+

'.__('Update').'

+
+
+ '.__('Import running: '). $vvb->getXsafCounter() . __(' files remaining').'
+ '.__('The page should refresh every second. If not, refresh manually.').' +
+
'; +} +elseif ($vvb->mustUpdate()) { echo '
@@ -874,7 +943,29 @@ echo '

'.__('Media export').' JSON

'; -if ($vvb->mustUpdate()) +if( $vvb->mustUpdateXsaf() ) { + try { + ob_end_flush(); + flush(); + } + catch (Exception $e) + { + // Silent, not critical + } + + try { + $updated = $vvb->updateXsaf(); + } + catch (VroumVroum_Feed_Exception $e) + { + echo ' +
+ '.escape($e->getMessage()).' +
'; + $updated = 0; + } +} +elseif ($vvb->mustUpdate()) { try { ob_end_flush(); diff --git a/functions.php b/functions.php index 273c265..301fbab 100755 --- a/functions.php +++ b/functions.php @@ -228,11 +228,14 @@ function __($str) return 'Source :'; case '_date_format': return '%A %e %B %Y à %H:%M'; - case 'configuration': - case 'articles': - return $str; case 'Media export': return 'Export fichiers media'; + case 'Import running: ': + return 'Import en cours : '; + case ' files remaining': + return ' fichiers restants'; + case 'The page should refresh every second. If not, refresh manually.': + return 'La page devrait se rafraîchir toutes les secondes. Si non, rafraîchissez là manuellement..'; default: return $str; } From 891a7f4a0e4f220d251afadf9bfc40f68a12992f Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 6 Jul 2013 08:18:37 +0200 Subject: [PATCH 039/105] Status RSS: author tag --- functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 301fbab..179d24d 100755 --- a/functions.php +++ b/functions.php @@ -270,7 +270,6 @@ function displayXMLstatus($status, $response_code, $autoblog_url, $autoblog_titl case 'remote_error': return 'Autoblog "'.$autoblog_title.'" : site distant a problème serveur (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'available': - return 'Autoblog "'.$autoblog_title.'" : site distant à nouveau opérationnel (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'new_autoblog_added': return 'Autoblog "'.$autoblog_title.'" ajouté.
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; } @@ -302,7 +301,7 @@ function displayXML() { {$link} {$item['timestamp']} - admin@{$_SERVER['SERVER_NAME']} + Autoblog {$date} EOT; From 83120ef616208935f815f7591ebedf067b4bf93b Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 6 Jul 2013 08:20:14 +0200 Subject: [PATCH 040/105] status RSS date format --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 179d24d..10244cb 100755 --- a/functions.php +++ b/functions.php @@ -293,7 +293,7 @@ function displayXML() { $description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']); $link = serverUrl(true).$item['autoblog_url']; - $date = date("r", $item['timestamp']); + $date = date(DATE_RFC822, $item['timestamp']); print << From 86a34b2044150b0d00970495c848922d3da9ea24 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 6 Jul 2013 08:38:30 +0200 Subject: [PATCH 041/105] =?UTF-8?q?mise=20aux=20normes=20flux=20(RSS,=20je?= =?UTF-8?q?=20te=20#$!$@*~=C2=A7=C2=A4=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 10244cb..0fa3618 100755 --- a/functions.php +++ b/functions.php @@ -278,7 +278,7 @@ function displayXMLstatus($status, $response_code, $autoblog_url, $autoblog_titl function displayXML() { header('Content-type: application/rss+xml; charset=utf-8'); echo ' - '.serverUrl(true).''; + '.serverUrl(true).''; echo 'Projet Autoblog'. ((strlen(HEAD_TITLE)>0) ? ' | '. HEAD_TITLE : '').'Projet Autoblog - RSS : Ajouts et changements de disponibilité.'; if(file_exists(RESOURCES_FOLDER.'rss.json')) { @@ -293,7 +293,7 @@ function displayXML() { $description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']); $link = serverUrl(true).$item['autoblog_url']; - $date = date(DATE_RFC822, $item['timestamp']); + $date = date(DATE_RSS, $item['timestamp']); print << From 03d9f29a2861e52d513a35e139ee6ba7412f5ccb Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 6 Jul 2013 11:52:13 +0200 Subject: [PATCH 042/105] Cleanup --- autoblogs/autoblog.php | 60 +++--------------------------------------- 1 file changed, 4 insertions(+), 56 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 5715327..d694168 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -329,14 +329,8 @@ class VroumVroum_Blog } public function mustUpdateXsaf() - { - if( file_exists('import.json') ) { - /*$out = file_get_contents('import.json'); - if( !is_numeric($out)) - return false;*/ - return true; - } - else return false; + { + return file_exists('import.json'); } protected function _getStreamContext() @@ -453,15 +447,13 @@ class VroumVroum_Blog if(!empty($file)) { $this->_copy($remoteurl.$file, "media/$file"); file_put_contents('import.json', json_encode($json)); - } /* TOCHECK: get_headers() & filesize() when header "content-lenght" */ + } else { unlink('import.json'); break; } /* first element empty: import finished */ $time = time(); - } - - $count = count($json['files']); + } unlink('import.lock'); } } @@ -567,11 +559,6 @@ class VroumVroum_Blog if (!file_exists(MEDIA_DIR . '/' . $filename)) { try { - $limit = 512000; // 512ko - $fr = fopen($filePath, 'r'); - $limitedContent = fread($fr, $limit); - $fw = fopen($filePath, 'w'); - fwrite($fw, $limitedContent); $copied = $this->_copy($url, MEDIA_DIR . '/' . $filename); } catch (ErrorException $e) @@ -603,45 +590,6 @@ class VroumVroum_Blog } } -// MEDIA IMPORT PROCESSING -// A SUPPRIMER -if(false && file_exists('import.json')) - { - if(!file_exists('import.lock')) - { - $json = json_decode(file_get_contents('import.json'), true); - $count = count($json['files']); - file_put_contents('import.lock', $count); /* one-process locking */ - $remoteurl = $json['url']; - if (!file_exists('media')) { mkdir('media'); } - $time = time(); - $maxtime = $time + 3; /* max exec time: 3 seconds */ - while ($time <= $maxtime) - { - $file = array_shift($json['files']); /* get first element while unstacking */ - if(!empty($file)) - { copy($remoteurl.$file, "media/$file"); file_put_contents('import.json', json_encode($json)); } /* TOCHECK: get_headers() & filesize() when header "content-lenght" */ - else { unlink('import.json'); break; } /* first element empty: import finished */ - $time = time(); - } - $count = count($json['files']); - unlink('import.lock'); - } -/* return import information page */ ?> - - - - - -Autoblog media import - - -Import running: files remaining.
-The page should refresh every second. If not, refresh manually. - - - Date: Sat, 6 Jul 2013 12:10:33 +0200 Subject: [PATCH 043/105] Fixes #36 --- xsaf3.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index 8cc18df..257756b 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -75,8 +75,8 @@ function xsafimport($xsafremote, $max_exec_time) { $get_remote_media = ($json_import['meta']['xsaf-media_transfer'] == "true") ? true : false; if(!empty($json_import['autoblogs'])) { - foreach ($json_import['autoblogs'] as $value) { - + foreach ($json_import['autoblogs'] as $remote_folder => $value) { + if(DEBUG) debug('remote = '. $remote_folder); if(count($value)==4 && !empty($value['SITE_TYPE']) && !empty($value['SITE_TITLE']) && !empty($value['SITE_URL']) && !empty($value['FEED_URL'])) { $sitetype = escape($value['SITE_TYPE']); $sitename = escape($value['SITE_TITLE']); @@ -108,13 +108,13 @@ function xsafimport($xsafremote, $max_exec_time) { /* ============================================================================================================================================================================== */ /* récupération de la DB distante */ - if($get_remote_db == true && ALLOW_REMOTE_DB_DL ) { - $remote_db = str_replace("?export", $foldername."/articles.db", $xsafremote); + if($get_remote_db == true && ALLOW_REMOTE_DB_DL ) { + $remote_db = str_replace("?export", $remote_folder."/articles.db", $xsafremote); copy($remote_db, './'. $foldername .'/articles.db'); } /* préparation à la récupération des médias distants */ if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) { - $remote_media=str_replace("?export", $foldername."?media", $xsafremote); + $remote_media=str_replace("?export", $remote_folder."?media", $xsafremote); if(DEBUG) debug("Récupération de la liste des médias à $remote_media
"); $json_media_import = file_get_contents($remote_media); From bb80e0a5b88026287e0bf9e57fda5607e6b801b2 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 7 Jul 2013 11:25:36 +0200 Subject: [PATCH 044/105] REMOVE: Identica support --- autoblogs/autoblog.php | 2 +- functions.php | 7 ------- index.php | 11 +---------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index d694168..8f1ce78 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -727,7 +727,7 @@ if($site_type == 'generic' || $site_type == 'youtube') // custom CSS for generic .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } .footer { text-align:center; font-size: small; color:#333; clear: both; }'; } - else if($site_type == 'microblog' || $site_type == 'twitter' || $site_type == 'identica') // custom CSS for microblog + else if($site_type == 'microblog' || $site_type == 'twitter') // custom CSS for microblog { $css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } .article .title h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } diff --git a/functions.php b/functions.php index 0fa3618..2d94169 100755 --- a/functions.php +++ b/functions.php @@ -141,8 +141,6 @@ function getArticlesPerPage( $type ) { return 20; case 'twitter': return 20; - case 'identica': - return 20; case 'shaarli': return 20; case 'youtube': @@ -158,8 +156,6 @@ function getInterval( $type ) { return 300; case 'twitter': return 300; - case 'identica': - return 300; case 'shaarli': return 1800; default: @@ -178,9 +174,6 @@ function updateType($siteurl) { if( strpos($siteurl, 'twitter.com') !== FALSE ) { return array('type' => 'twitter', 'name' => 'twitter'); } - elseif ( strpos( $siteurl, 'identi.ca') !== FALSE ) { - return array('type' => 'identica', 'name' => 'identica'); - } elseif( strpos( $siteurl, 'shaarli' ) !== FALSE ) { return array('type' => 'shaarli', 'name' => 'shaarli'); } diff --git a/index.php b/index.php index b4e4588..d18f390 100755 --- a/index.php +++ b/index.php @@ -116,7 +116,7 @@ function create_from_opml($opml) { throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.'); $sitetype = escape($outline['text']); - if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'identica' && $sitetype != 'youtube') + if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'youtube') $sitetype = 'generic'; $rssurl = DetectRedirect(escape($outline['xmlUrl'])); @@ -210,9 +210,6 @@ $svg_type = ''; case "youtube": $svg_type = $svg_youtube; break; - case "identica": - $svg_type = $svg_youtube; - break; case "shaarli": $svg_type = $svg_shaarli; break; @@ -570,11 +567,6 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO else $error[] = 'Vous devez définir une API Twitter -> RSS dans votre fichier de configuration (see TwitterBridge).'; } - elseif($socialinstance === 'identica') { - $sitetype = 'identica'; - $siteurl = 'http://identi.ca/'.$socialaccount; - $rssurl = 'http://identi.ca/api/statuses/user_timeline/'.$socialaccount.'.rss'; - } elseif($socialinstance === 'statusnet' && !empty($_POST['statusneturl'])) { $sitetype = 'microblog'; $siteurl= NoProtocolSiteURL(escape($_POST['statusneturl'])); @@ -840,7 +832,6 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY echo 'Twitter (via twitterbridge)
'; } else echo 'Twitter
'; ?> - Identica

Youtube
From f59a6d320b7a25f1c3e58840d7b703c7c47b8da6 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 7 Jul 2013 12:38:10 +0200 Subject: [PATCH 045/105] cleanup css elseif --- autoblogs/autoblog.php | 58 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 8f1ce78..a2aff27 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -718,35 +718,35 @@ $css=' * { margin: 0; padding: 0; } #error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; } '; -if($site_type == 'generic' || $site_type == 'youtube') // custom CSS for generic - { - $css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; } - .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } - .article .title h2 a { color:#000; text-decoration:none; } - .article .source { font-size: 0.8em; color: #666; } - .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } - .footer { text-align:center; font-size: small; color:#333; clear: both; }'; - } - else if($site_type == 'microblog' || $site_type == 'twitter') // custom CSS for microblog - { - $css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } - .article .title h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } - .article .title h2 a { color:#333; text-decoration:none; } - .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:0 auto;box-shadow:0px 5px 7px #aaa; } - .article .source { font-size: 0.8em; color: #666; } - .footer { margin-top:1em;text-align:center; font-size: small; color:#333; clear: both; } - .content {font-size:0.9em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}'; - } - else if($site_type == 'shaarli') // custom CSS for shaarli - { - $css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } - .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } - .article .title h2 a { color:#000; text-decoration:none; } - .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } - .article .source { margin-top:1em;font-size: 0.8em; color: #666; } - .footer { text-align:center; font-size: small; color:#333; clear: both; }'; - } - +switch($site_type) { + case 'microblog': + case 'twitter': + $css .= '.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } + .article .title h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } + .article .title h2 a { color:#333; text-decoration:none; } + .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:0 auto;box-shadow:0px 5px 7px #aaa; } + .article .source { font-size: 0.8em; color: #666; } + .footer { margin-top:1em;text-align:center; font-size: small; color:#333; clear: both; } + .content {font-size:0.9em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}'; + break; + case 'shaarli': + $css .= '.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } + .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } + .article .title h2 a { color:#000; text-decoration:none; } + .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } + .article .source { margin-top:1em;font-size: 0.8em; color: #666; } + .footer { text-align:center; font-size: small; color:#333; clear: both; }'; + break; + case 'generic': + case 'youtube': + default: + $css .= '.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; } + .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } + .article .title h2 a { color:#000; text-decoration:none; } + .article .source { font-size: 0.8em; color: #666; } + .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } + .footer { text-align:center; font-size: small; color:#333; clear: both; }'; +} // HTML HEADER echo ' From 4ebb5ac90a82b743b65a90043d800d89e0fd2ddd Mon Sep 17 00:00:00 2001 From: mitsukarenai Date: Thu, 11 Jul 2013 12:41:48 +0200 Subject: [PATCH 046/105] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3406889..e0844b9 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ Projet Autoblog =============== -Création, gestion et échange de blogs automatiques contre la censure ([plus d'info](http://sebsauvage.net/streisand.me/fr/)). +Création, gestion et échange de blogs automatiques contre la censure ([plus d'info sur le projet](http://sebsauvage.net/streisand.me/fr/)). Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). +"bleeding edge" demo: [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/) + Nouveautés majeures =================== From 960ab022d791fa591bbccc27e8701488ef7bf8f0 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Thu, 11 Jul 2013 13:04:17 +0200 Subject: [PATCH 047/105] minifix: URL XSAF de mon instance --- config.php.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.php.example b/config.php.example index 0280ded..31808ca 100644 --- a/config.php.example +++ b/config.php.example @@ -40,7 +40,7 @@ $friends_autoblog_farm = array( 'https://raw.github.com/mitsukarenai/xsaf-bootstrap/master/3.json', // 'https://www.ecirtam.net/autoblogs/?export', - // 'https://autoblog.suumitsu.eu/?export', + // 'http://autoblog.suumitsu.eu/?export', // 'http://streisand.hoa.ro/?export', ); ?> From edb75a5f4b6db1ad3d872aaf1e19c700d2037b41 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Thu, 11 Jul 2013 13:38:29 +0200 Subject: [PATCH 048/105] =?UTF-8?q?trial:=20ne=20pas=20=C3=A9crire=20impor?= =?UTF-8?q?t.json=20si=20d=C3=A9codage=20JSON=20=C3=A9chou=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xsaf3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xsaf3.php b/xsaf3.php index 257756b..5479ff6 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -120,7 +120,7 @@ function xsafimport($xsafremote, $max_exec_time) { $json_media_import = file_get_contents($remote_media); if(DEBUG) debug($json_media_import); - if(!empty($json_media_import) && !strpos($json_media_import, '[]}')) + if(!empty($json_media_import) && !strpos($json_media_import, '[]}') && json_decode($json_media_import) !== null) { file_put_contents('./'. $foldername .'/import.json', $json_media_import); } From 7030352d2466eb7ea1d9ea18a91a839dc0efbddb Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 13 Jul 2013 18:00:32 +0200 Subject: [PATCH 049/105] =?UTF-8?q?d=C3=A9sactivation=20autoblog=20(test)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoblogs/autoblog.php | 23 +++++++++++++---------- index.php | 2 ++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index a2aff27..5a7895e 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -350,16 +350,19 @@ class VroumVroum_Blog { if (!$this->mustUpdate()) return false; - - try { - $body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext()); - } - catch (ErrorException $e) - { - $this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : '')); - throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage()); - } - + if(isset($this->config->off)) { + throw new VroumVroum_Feed_Exception('This autoblog has been turned off'); + } + else { + try { + $body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext()); + } + catch (ErrorException $e) + { + $this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : '')); + throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage()); + } + } libxml_use_internal_errors(true); $xml = @simplexml_load_string($body); diff --git a/index.php b/index.php index d18f390..4b70e10 100755 --- a/index.php +++ b/index.php @@ -236,6 +236,7 @@ function svg_status($fill, $text, $back) } $svg_ok=svg_status('#008000', 'ok', ''); + $svg_off=svg_status('#00158F', 'off', ''); $svg_mv=svg_status('#0000ff', 'mv', ''); $svg_err=svg_status('#000000', 'err', ''); @@ -253,6 +254,7 @@ function svg_status($fill, $text, $back) else /* ..sinon, lancer la procédure de contrôle */ { $ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die; + if(isset($ini['OFF'])) { die($svg_off); } $headers = get_headers($ini['FEED_URL']); if(!empty($headers)) From 1cda22292528a29afbda4a0d6cb867f4c4197476 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 13 Jul 2013 18:13:07 +0200 Subject: [PATCH 050/105] =?UTF-8?q?Revert=20"d=C3=A9sactivation=20autoblog?= =?UTF-8?q?=20(test)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7030352d2466eb7ea1d9ea18a91a839dc0efbddb. --- autoblogs/autoblog.php | 23 ++++++++++------------- index.php | 2 -- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 5a7895e..a2aff27 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -350,19 +350,16 @@ class VroumVroum_Blog { if (!$this->mustUpdate()) return false; - if(isset($this->config->off)) { - throw new VroumVroum_Feed_Exception('This autoblog has been turned off'); - } - else { - try { - $body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext()); - } - catch (ErrorException $e) - { - $this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : '')); - throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage()); - } - } + + try { + $body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext()); + } + catch (ErrorException $e) + { + $this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : '')); + throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage()); + } + libxml_use_internal_errors(true); $xml = @simplexml_load_string($body); diff --git a/index.php b/index.php index 4b70e10..d18f390 100755 --- a/index.php +++ b/index.php @@ -236,7 +236,6 @@ function svg_status($fill, $text, $back) } $svg_ok=svg_status('#008000', 'ok', ''); - $svg_off=svg_status('#00158F', 'off', ''); $svg_mv=svg_status('#0000ff', 'mv', ''); $svg_err=svg_status('#000000', 'err', ''); @@ -254,7 +253,6 @@ function svg_status($fill, $text, $back) else /* ..sinon, lancer la procédure de contrôle */ { $ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die; - if(isset($ini['OFF'])) { die($svg_off); } $headers = get_headers($ini['FEED_URL']); if(!empty($headers)) From b1ebc3563bb8a24d7a050b15c42ba2ba6c09d52f Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 19 Jul 2013 12:22:01 +0200 Subject: [PATCH 051/105] Fixes #37 --- xsaf3.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index 257756b..63c9571 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -2,7 +2,7 @@ define('DEBUG', false); define('XSAF_VERSION', 3); -define('AUTOBLOG_FILE_NAME', 'autoblog.php'); +define('AUTOBLOG_FILE_NAME', 'autoblog.php'); // useless ? define('ALLOW_REMOTE_DB_DL', true); define('ALLOW_REMOTE_MEDIA_DL', true); define('EXEC_TIME', 10); @@ -114,7 +114,7 @@ function xsafimport($xsafremote, $max_exec_time) { } /* préparation à la récupération des médias distants */ if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) { - $remote_media=str_replace("?export", $remote_folder."?media", $xsafremote); + $remote_media=str_replace("?export", $remote_folder."/?media", $xsafremote); if(DEBUG) debug("Récupération de la liste des médias à $remote_media
"); $json_media_import = file_get_contents($remote_media); From 7be56daca7a6e951aa59aae21a07bfaeee0f1abc Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 19 Jul 2013 12:39:35 +0200 Subject: [PATCH 052/105] #37 slightly improved --- xsaf3.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xsaf3.php b/xsaf3.php index ae10ae4..8ad26a6 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -120,7 +120,10 @@ function xsafimport($xsafremote, $max_exec_time) { $json_media_import = file_get_contents($remote_media); if(DEBUG) debug($json_media_import); - if(!empty($json_media_import) && !strpos($json_media_import, '[]}') && json_decode($json_media_import) !== null) + $media_data = json_decode($json_media_import, true); + if(DEBUG) + debug($media_data); + if(!empty($json_media_import) && $media_data !== null && !empty($media_data['files'])) { file_put_contents('./'. $foldername .'/import.json', $json_media_import); } From ee002462693b45456df3c34c7eb81fb43ce84492 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 19 Jul 2013 13:06:51 +0200 Subject: [PATCH 053/105] minor fix --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index d18f390..a0a9aa6 100755 --- a/index.php +++ b/index.php @@ -82,7 +82,8 @@ function serverUrl($return_subfolder = false) $serverport = ($_SERVER["SERVER_PORT"]=='80' || ($https && $_SERVER["SERVER_PORT"]=='443') ? '' : ':'.$_SERVER["SERVER_PORT"]); if($return_subfolder === true) { $path = pathinfo( $_SERVER['PHP_SELF'] ); - $subfolder = $path['dirname'] .'/'; + if( !empty( $_SERVER['PHP_SELF'] )) + $subfolder = $path['dirname'] .'/'; } else $subfolder = ''; return 'http'.($https?'s':'').'://'.$_SERVER["SERVER_NAME"].$serverport.$subfolder; } From 2971897bd427cf2fb952f869b4e866f8e526a669 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 19 Jul 2013 13:12:54 +0200 Subject: [PATCH 054/105] fixing fix --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index a0a9aa6..224acb7 100755 --- a/index.php +++ b/index.php @@ -82,7 +82,7 @@ function serverUrl($return_subfolder = false) $serverport = ($_SERVER["SERVER_PORT"]=='80' || ($https && $_SERVER["SERVER_PORT"]=='443') ? '' : ':'.$_SERVER["SERVER_PORT"]); if($return_subfolder === true) { $path = pathinfo( $_SERVER['PHP_SELF'] ); - if( !empty( $_SERVER['PHP_SELF'] )) + if( $path['dirname'] != '/' ) $subfolder = $path['dirname'] .'/'; } else $subfolder = ''; return 'http'.($https?'s':'').'://'.$_SERVER["SERVER_NAME"].$serverport.$subfolder; From 7158eeeb76fe1ab94f848d5f479d72f97b83b67a Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 19 Jul 2013 13:14:24 +0200 Subject: [PATCH 055/105] gitignore updataalllock --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 452c5e3..0baea2b 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ config.php .versionlock .xsaflock +.updatealllock resources/rss.xml resources/rss.json .project From e64097ae1d11b5ca4adf67b8bf13f75ae0362782 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 19 Jul 2013 13:16:25 +0200 Subject: [PATCH 056/105] =?UTF-8?q?=C3=A7a=20m'agace=20ce=20truc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 224acb7..084e81e 100755 --- a/index.php +++ b/index.php @@ -82,8 +82,8 @@ function serverUrl($return_subfolder = false) $serverport = ($_SERVER["SERVER_PORT"]=='80' || ($https && $_SERVER["SERVER_PORT"]=='443') ? '' : ':'.$_SERVER["SERVER_PORT"]); if($return_subfolder === true) { $path = pathinfo( $_SERVER['PHP_SELF'] ); - if( $path['dirname'] != '/' ) - $subfolder = $path['dirname'] .'/'; + $finalslash = ( $path['dirname'] != '/' ) ? '/' : ''; + $subfolder = $path['dirname'] . $finalslash; } else $subfolder = ''; return 'http'.($https?'s':'').'://'.$_SERVER["SERVER_NAME"].$serverport.$subfolder; } From c33902654ad8faa7ce8551c48f2c84e260f0689a Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 19 Jul 2013 15:38:27 +0200 Subject: [PATCH 057/105] limite pour l'historique des changements --- functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/functions.php b/functions.php index 2d94169..0a98f03 100755 --- a/functions.php +++ b/functions.php @@ -246,6 +246,7 @@ $json[] = array( 'status'=>$status, 'response_code'=>$response_code ); +$json = array_slice($json, -50, 50); if(file_put_contents(RESOURCES_FOLDER.'rss.json', json_encode($json), LOCK_EX) === FALSE) { return FALSE; } else { return TRUE; } From 63f43ac4cec58caf4094f41a1edc84e53dd79f7a Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 19 Jul 2013 15:48:10 +0200 Subject: [PATCH 058/105] =?UTF-8?q?cas=20manquant:=20site=20=C3=A0=20nouve?= =?UTF-8?q?au=20accessible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/functions.php b/functions.php index 0a98f03..6a6859c 100755 --- a/functions.php +++ b/functions.php @@ -264,6 +264,7 @@ function displayXMLstatus($status, $response_code, $autoblog_url, $autoblog_titl case 'remote_error': return 'Autoblog "'.$autoblog_title.'" : site distant a problème serveur (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'available': + return 'Autoblog "'.$autoblog_title.'" : site distant à nouveau accessible (code '.$response_code.')
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; case 'new_autoblog_added': return 'Autoblog "'.$autoblog_title.'" ajouté.
Autoblog : '.$autoblog_title.'
Site : '. $autoblog_sourceurl .'
RSS : '.$autoblog_sourcefeed.''; } From 7f11c12ee5a72391c9b2c6ee8b7bac9bf092f525 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 20 Jul 2013 09:28:45 +0200 Subject: [PATCH 059/105] Update README.md --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e0844b9..155e01f 100755 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ Projet Autoblog =============== -Création, gestion et échange de blogs automatiques contre la censure ([plus d'info sur le projet](http://sebsauvage.net/streisand.me/fr/)). +> This project is historically in French. See [our english README](https://github.com/mitsukarenai/Projet-Autoblog/wiki/Autoblog-Project). + +Réplication automatique de contenu à partir de flux RSS/Atom, avec partage des ajouts entre les fermes d'Autoblog. + +L'objectif premier du projet Autoblog est de lutter contre la censure et toute autre forme de pression allant à l'encontre de la liberté d'expression en favorisant l'[effet Streisand](http://fr.wikipedia.org/wiki/Effet_Streisand). + +Le projet a été initialement lancé par Sébastien Sauvage : [plus d'info par ici](http://sebsauvage.net/streisand.me/fr/). + +Démo : [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/) + Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). -"bleeding edge" demo: [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/) - -Nouveautés majeures +Fonctionnalités majeures =================== - Ferme d'autoblogs avec ajout facile par différents formulaires (générique, microblogging, OPML, marque-pages). @@ -34,6 +41,13 @@ Pré-requis techniques - PHP 5.3 ou supérieur - Support SQLite 3 pour PHP +Documentation +===================== + +La documentation du projet est sur le [Wiki du repo](https://github.com/mitsukarenai/Projet-Autoblog/wiki). + +Accès hors ligne : `git clone https://github.com/mitsukarenai/Projet-Autoblog.wiki.git` + Licence ===================== From c2a0093d626e7b6a22e6a7a846fe46f0c6420600 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 22 Jul 2013 18:06:47 +0200 Subject: [PATCH 060/105] RELEASE 0.3.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 4cb2afc..0d91a54 100755 --- a/version +++ b/version @@ -1 +1 @@ -0.3.0-DEV Build 1 \ No newline at end of file +0.3.0 From ac97bffe5c1342874eef65ea49742d009667760b Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 25 Jul 2013 19:42:19 +0200 Subject: [PATCH 061/105] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 155e01f..1ee8c8d 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![logo](http://streisand.hoa.ro/resources/icon-logo.svg) + Projet Autoblog =============== From c7c7f520449dffcfc9673070b7dc36cee06770eb Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 25 Jul 2013 19:42:35 +0200 Subject: [PATCH 062/105] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ee8c8d..5b7ce67 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![logo](http://streisand.hoa.ro/resources/icon-logo.svg) + Projet Autoblog =============== @@ -16,6 +16,7 @@ Démo : [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/) Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). +![logo](http://streisand.hoa.ro/resources/icon-logo.svg) Fonctionnalités majeures =================== From 184803b40c26c5d0e160a579a2dbe76aed2a4b12 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 29 Jul 2013 15:04:18 +0200 Subject: [PATCH 063/105] =?UTF-8?q?licence:=20texte=20l=C3=A9gal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/LICENSE.md b/LICENSE.md index 700f763..a91b07e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -7,3 +7,28 @@ LICENSE =============== - public domain + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to From 2b11ae4cbbc863a9db5c085a4e9a1136994d6b3e Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 30 Jul 2013 12:37:16 +0200 Subject: [PATCH 064/105] twitter2feed fixed --- twitter2feed.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twitter2feed.php b/twitter2feed.php index 7a0cefa..d6ffd6f 100755 --- a/twitter2feed.php +++ b/twitter2feed.php @@ -9,6 +9,7 @@ // Autoblog Project inclusion // ---------------------------- if(file_exists("config.php")) require_once "config.php"; +if(file_exists("functions.php")) require_once "functions.php"; if( !defined('API_TWITTER')) {header("HTTP/1.1 404 Not Found"); die('API_TWITTER is undefined: make it LOCAL in "config.php" if you want me to work for you.');} if ('API_TWITTER' === FALSE) {header("HTTP/1.1 404 Not Found"); die('Twitter support disabled in "config.php". Sorry.');} $api = API_TWITTER; @@ -25,7 +26,7 @@ $exclude_reply = '@'; // if you want twitter2feed to return replies too: $exclu 'data-tweet-id="(?P\d+)"(.*)'. '(data-retweet-id="(?P\d+)"(.*))?'. 'data-screen-name="(?P[^"]+)"(.*)'. - '(?P<fullname>[^(.*)'. + '(?P<fullname>[^(.*)'. 'data-time="(?P\d+)"(.*)'. '

(?P.*)

'. '%sU', $str, $arr); From d394a977aae2c789ae3ab23ce991b7e9c02c79c5 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Tue, 30 Jul 2013 12:53:22 +0200 Subject: [PATCH 065/105] add changelog --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 5b7ce67..9d4ff30 100755 --- a/README.md +++ b/README.md @@ -55,3 +55,10 @@ Licence ===================== Domaine public. + +Changelog +===================== + +2013-07-30 +- twitter2feed.php fixed (regex on class "avatar"; ``````) +2013-07-22 MILESTONE 3.0 From 8095c4b6e527403956b04d7c982d73d7fbb121ed Mon Sep 17 00:00:00 2001 From: mitsukarenai Date: Tue, 30 Jul 2013 12:55:23 +0200 Subject: [PATCH 066/105] (fix changelog LOL) *honte* --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d4ff30..0f4e54e 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - Projet Autoblog =============== @@ -59,6 +58,6 @@ Domaine public. Changelog ===================== -2013-07-30 -- twitter2feed.php fixed (regex on class "avatar"; ``````) -2013-07-22 MILESTONE 3.0 +- 2013-07-30 + - twitter2feed.php fixed (regex on class "avatar"; ``````) +- 2013-07-22 MILESTONE 3.0 From 090550672ee01d681e0b0a6f5c2ee19e22dd9b1d Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 1 Aug 2013 14:58:49 +0200 Subject: [PATCH 067/105] ignore robots.txt --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0baea2b..bf36f6b 100755 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ autoblogs/* !autoblogs/autoblog.php docs/* !docs/docs.txt +robots.txt From 75156b282775348ab8936d36272fd23274de3a1e Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 14 Aug 2013 11:55:13 +0200 Subject: [PATCH 068/105] test: rss-bridge info --- config.php.example | 9 +++++++-- index.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.php.example b/config.php.example index 31808ca..1c884e9 100644 --- a/config.php.example +++ b/config.php.example @@ -28,8 +28,13 @@ // define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE ); /** - * More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge and twitter2feed: https://github.com/mitsukarenai/twitter2feed - * replace LOCAL with the twitterbridge request URL (example: 'http://www.suumitsu.eu/twitter/?u=' ) or leave LOCAL to use the included twitter2feed.php. + * TwitterBridge: https://github.com/mitsukarenai/twitterbridge + * twitter2feed : https://github.com/mitsukarenai/twitter2feed + * rss-bridge : https://github.com/sebsauvage/rss-bridge + * replace LOCAL with: + - the twitterbridge request URL (example: 'http://www.some.website/twitterbridge/?u=' ) + - or the rss-bridge request URL (example: 'http://www.some.website/rss-bridge/?action=display&bridge=TwitterBridge&format=AtomFormat&u=' ) + - or leave LOCAL to use the included twitter2feed.php. * set to FALSE if you want to fully disable Twitter support **/ // define( 'API_TWITTER', 'LOCAL' ); diff --git a/index.php b/index.php index 084e81e..f645c9c 100755 --- a/index.php +++ b/index.php @@ -830,7 +830,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY if( API_TWITTER === 'LOCAL' ) echo 'Twitter (local)
'; else - echo 'Twitter (via twitterbridge)
'; + echo 'Twitter (via bridge)
'; } else echo 'Twitter
'; ?> From d2d75b657f5a20c01dbcd36053046a530e0bfff3 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 14 Aug 2013 12:01:17 +0200 Subject: [PATCH 069/105] =?UTF-8?q?fix:=20..=20je=20faisais=20quoi=20l?= =?UTF-8?q?=C3=A0=20=3F..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index f645c9c..484ead8 100755 --- a/index.php +++ b/index.php @@ -830,7 +830,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY if( API_TWITTER === 'LOCAL' ) echo 'Twitter (local)
'; else - echo 'Twitter (via bridge)
'; + echo 'Twitter (via bridge)
'; } else echo 'Twitter
'; ?> From 0a17a2d4cfcb76ea20022d4462c6db4bb5c4715e Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 15 Aug 2013 12:58:31 +0200 Subject: [PATCH 070/105] Handle content in non escaped ATOM feeds --- autoblogs/autoblog.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index a2aff27..660aafa 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -379,9 +379,12 @@ class VroumVroum_Blog { $date = isset($item->published) ? (string) $item->published : (string) $item->updated; $guid = !empty($item->id) ? (string)$item->id : (string)$item->link['href']; - + + if( count($item->content->children()) > 0 ) $content = (string)$item->content->asXML(); + else $content = (string)$item->content; + $id = $this->insertOrUpdateArticle($guid, (string)$item->title, - (string)$item->link['href'], strtotime($date), (string)$item->content); + (string)$item->link['href'], strtotime($date), $content ); if ($id !== false) $updated++; From 58323178c1a61201003f1f51413c34647d3065b1 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 16 Aug 2013 16:21:11 +0200 Subject: [PATCH 071/105] =?UTF-8?q?Support=20des=20URL=20=C3=A0=20query=20?= =?UTF-8?q?multiples=20(=3Ftruc=3Dmachin&chose=3Dbidule&etc=3Dblabla)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100755 => 100644 index.php diff --git a/index.php b/index.php old mode 100755 new mode 100644 index 484ead8..054a08e --- a/index.php +++ b/index.php @@ -56,7 +56,7 @@ function get_link_from_datafeed($data) { // ATOM feed && RSS 1.0 /RDF && RSS 2.0 if (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item)) - die('le flux n\'a pas une syntaxe valide'); + { die('le flux n\'a pas une syntaxe valide');} $check = substr($data, 0, 5); if($check !== ' Date: Sat, 31 Aug 2013 17:02:06 +0200 Subject: [PATCH 072/105] Ajout du poids des documents --- index.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 054a08e..a8b0e66 100644 --- a/index.php +++ b/index.php @@ -76,6 +76,14 @@ function get_link_from_datafeed($data) { } } +function get_size($doc) { + $symbol = array('o', 'Kio', 'Mio', 'Gio', 'Tio'); + $size = filesize($doc); + $exp = floor(log($size) / log(1024)); + $nicesize = $size / pow(1024, floor($exp)); + return sprintf('%d %s', $nicesize, $symbol[$exp]); +} + function serverUrl($return_subfolder = false) { $https = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS'])=='on')) || $_SERVER["SERVER_PORT"]=='443'; // HTTPS detection. @@ -907,14 +915,21 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY foreach($subdirs as $unit) { if(!is_dir($unit) || file_exists( $unit . '/index.html' ) || file_exists( $unit . '/index.htm' ) || file_exists( $unit . '/index.php' ) ) { - $docs[] = ''. substr($unit, (strrpos($unit, '/')) + 1 ) .''; + $size = ''; + if ( is_file($unit) ) { $size = get_size($unit); } + $docs[] = array(''. substr($unit, (strrpos($unit, '/')) + 1 ) .'', $size); } } } if(!empty( $docs )) { echo '

Autres documents

    '; - foreach( $docs as $value ) - echo '
  • '. $value .'
  • '; + foreach( $docs as $value ) { + $str = $value[0]; + if ( !empty($value[1]) ) { + $str = sprintf('%s (%s)', $value[0], $value[1]); + } + echo '
  • '. $str . '
  • '; + } echo '
'; } ?> From 83717f9ef2ed09f4ef529290302b5783edc47706 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 7 Oct 2013 12:32:20 +0200 Subject: [PATCH 073/105] update readme --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f4e54e..4468466 100755 --- a/README.md +++ b/README.md @@ -10,12 +10,20 @@ L'objectif premier du projet Autoblog est de lutter contre la censure et toute a Le projet a été initialement lancé par Sébastien Sauvage : [plus d'info par ici](http://sebsauvage.net/streisand.me/fr/). -Démo : [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/) +Exemples d'instances : +- [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/) +- [streisand.hoa.ro](http://streisand.hoa.ro/) +- [ecirtam.net](https://ecirtam.net/autoblogs/) +- [autoblog.ohax.fr](http://autoblog.ohax.fr/) +- [flamby.aldarone.fr](http://flamby.aldarone.fr/) +- [tcit.fr](http://www.tcit.fr/streisand/) +- [kaelsitoo.fr](http://kaelsitoo.fr/autoblog/) +- [autoblog.postblue.info](http://autoblog.postblue.info/) Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). -![logo](http://streisand.hoa.ro/resources/icon-logo.svg) +![logo](https://raw.github.com/mitsukarenai/Projet-Autoblog/master/resources/icon-logo.svg) Fonctionnalités majeures =================== From 862d349e7b2db775a67a890b522fad50d79832fe Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 7 Oct 2013 12:35:35 +0200 Subject: [PATCH 074/105] fix readme orz --- README.md | 2 +- resources/icon-logo.png | Bin 0 -> 2990 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 resources/icon-logo.png diff --git a/README.md b/README.md index 4468466..9ce73bb 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Exemples d'instances : Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro). -![logo](https://raw.github.com/mitsukarenai/Projet-Autoblog/master/resources/icon-logo.svg) +![logo](https://raw.github.com/mitsukarenai/Projet-Autoblog/master/resources/icon-logo.png) Fonctionnalités majeures =================== diff --git a/resources/icon-logo.png b/resources/icon-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..62c632040fd00a05e7b6f6f0075893d09251e59c GIT binary patch literal 2990 zcmeH}`!~~%AIFD^Hj=y9QlC)RRQR}r<~kHHBMkfGw&pgMHn%8rAxaA~icb;agQ>jT z@>v)1aT_ZwZIKa@7*p<-%E$M7&*yyqhVMC_*Lj`S>vdk|buW^!tRTho&l7Ra zg`~UB?5&<&&NJ?NCAYslx!W_Nc{N4ji0l+!V1Pmif%s0k4Px%+8f2OOskfK z``pWnKX~d`vC8ZPoA-S6(|=e5#_l6*P91KQ*W?bKzvI`qw4#%3aP{b+i=~2^?*ZPo zafUx3XHo}@ezjY0M)w1@KdxiHj6Y&n&>$+$gwvTiA1M%ieCjmcGT>}dVd9rqrWNhKnf6{^lb39pdMEsLIV1iu{8L1tp9!!R@~;_D`Ywzh>f_q&f`! zuB`s^%K%N09u(7zWn<3=@8-GFvx4*ktP}~MW@DEQ%ziZPWLEUt1to8wLt*YsJ=sOVWcBSL5*1cF+L!?lO` zhP!U2Qs(Jr#4H+_fYD0ui=RfAPXWLz$M?kfpF2KYaFU&Qp`*C#^=1+s>Cnle<#Af3 zy&7QMVLfs;m_vHHpfR(okd}tlGac#hpNNJcv6ou#qpKJ$t8$y+DD-EV8d%)v7ENLkZzTwF?4S~n(Q@M%K{qSzw~Dy^&WlP zPh&8Y!*!fE!NuiBy=w_Q$M>y-Te8D)6W3gxUiB=sx$yRsgU4E`<)C4VRyGLRD8T#dsuEh5}GZbd5DswC$d_pOK;W8k5&!gGD6Nnygi zqq&A}w~~Z;w)tdT__#n2{Uy3y7_fmS=7gj#z2ZUyCYDXc7#@tAKVH?)#QYN9SA9tI zY$=JT|CWmWGmf=ExkFQ(dxUemfpED0opZ6rjiYve71`k9rBQ>zpTey^)bHz>bsbjm zC=eMTIu7&ahQ2=0&;DWUiN<D5oZXXo?~q7f@&c39S;l+yP3+~ev_&y{zkVCcCD z>PzGUR6qJ;9Evdg$Mo2l>LCx$(<**V?(|!u86G=EE0FsJcP`BK(ir1BO3r{L8yoYh z8~l+$t5B7unW0{ZRO0m>yp&RcRO)zrJwmS>sdUB-h^KE;yP0Us7_qr>*{O9(G{&cB z=S&QJp6dy4$Kw^<=vlvrMKzC;hez~;GH@mZCVLW>9pIYVroOSaLn9NX@nNd#$WvRM z_{|C=$>FaW8{8?doGZ>J^2xpO5@v;W_9BfjIoW_^2a?{;Sj3PI6LeZ=a#_i2?zf_` z-1u>x1SvENfu?D*xxg^2ORX`V=`mZ1m=I6?xBtU<-Y;O CWK&H5 literal 0 HcmV?d00001 From d429e29c27bf25f63f920e6366424a46f7293605 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Sun, 13 Oct 2013 19:11:15 +0200 Subject: [PATCH 075/105] =?UTF-8?q?S=C3=A9mantisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alors j’ai fait énoooooormément de modifications… La principale est : un code source (HTML5) *beau* et sémantique. C’est à dire que j’utilise les balises sémantique HTML5, que le code est plus simple, qu’il est correctement indenté (2 espaces à chaque fois, c’est ce que je trouve de plus beau) et *valide*. Ça m’a pris une nuit et un aprèm’ de nettoyer ça, assez simple et très satisfaisant :). Bon après j’ai fait plusieurs autres modifications de genre divers aussi : j’ai supprimé des balises inutiles, j’ai remplacé la recherche Google par une recherche Startpage, des traits d’union par des tirets, fusion des lignes séparées par des
(horrible) en un paragraphe (bien plus joli, organisé, sémantique, etc.), et d’autres choses encore. Par conséquent j’imagine que peut-être qu’il sera nécessaire de regarder la diff des changements. Mais pour voir le résultat final il y a mon instance : . --- index.php | 559 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 285 insertions(+), 274 deletions(-) diff --git a/index.php b/index.php index a8b0e66..8ec5f9e 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,7 @@ (by default, database and media transfer via XSAF is allowed) - upload all files on your server (PHP 5.3+ required) - - PROFIT ! + - PROFIT! */ @@ -30,7 +30,7 @@ if(file_exists("config.php")){ if(file_exists("functions.php")){ require_once "functions.php"; }else{ - echo "functions.php not found !"; + echo "functions.php not found!"; die; } @@ -122,7 +122,7 @@ function create_from_opml($opml) { // Lighten process by checking folderExists first // A CHANGER SELON ISSUE #20 if(folderExists($siteurl)) - throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.'); + throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.'); $sitetype = escape($outline['text']); if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'youtube') @@ -252,8 +252,8 @@ function svg_status($fill, $text, $back) $oldvalue = null; if(file_exists($errorlog)) { $oldvalue = file_get_contents($errorlog); }; - if(file_exists($errorlog) && filemtime($errorlog) < $expire) { unlink($errorlog); } /* errorlog périmé ? Suppression. */ - if(file_exists($errorlog)) /* errorlog existe encore ? se contenter de lire sa taille pour avoir le statut */ + if(file_exists($errorlog) && filemtime($errorlog) < $expire) { unlink($errorlog); } /* errorlog périmé ? Suppression. */ + if(file_exists($errorlog)) /* errorlog existe encore ? se contenter de lire sa taille pour avoir le statut */ { if(filesize($errorlog) == "0") {die($svg_ok);} else if(filesize($errorlog) == "1") {die($svg_mv);} @@ -471,11 +471,11 @@ if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) { } $antibot = generate_antibot(); -$form = '
-
-
- - +$form = ''."\n".' +
+
+ +
'; /** @@ -608,7 +608,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO try { $headers = get_headers($rssurl, 1); if (strpos($headers[0], '200') === FALSE) - throw new Exception('Flux inaccessible (compte inexistant ?)'); + throw new Exception('Flux inaccessible (compte inexistant ?)'); createAutoblog($sitetype, ucfirst($socialinstance) .' - '. $socialaccount, $siteurl, $rssurl); $success[] = ' @@ -620,7 +620,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO } } else - $error[] = 'Antibot : Chiffres incorrects.'; + $error[] = 'Antibot : chiffres incorrects.'; } /** @@ -630,9 +630,9 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L if(empty($_POST['rssurl'])) {$error[] = "Veuillez entrer l'adresse du flux.";} if(empty($_POST['number']) || empty($_POST['antibot']) ) - {$error[] = "Vous êtes un bot ?";} + {$error[] = "Vous êtes un bot ?";} elseif(! check_antibot($_POST['number'], $_POST['antibot'])) - {$error[] = "Antibot : Ce n'est pas le bon nombre.";} + {$error[] = "Antibot : ce n'est pas le bon nombre.";} if(empty($error)) { try { @@ -682,9 +682,9 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L **/ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) { if(empty($_POST['number']) || empty($_POST['antibot']) ) - {$error[] = "Vous êtes un bot ?";} + {$error[] = "Vous êtes un bot ?";} elseif(! check_antibot($_POST['number'], $_POST['antibot'])) - {$error[] = "Antibot : Ce n'est pas le bon nombre.";} + {$error[] = "Antibot : ce n'est pas le bon nombre.";} if( empty( $error)) { if (is_uploaded_file($_FILES['file']['tmp_name'])) { @@ -706,9 +706,9 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY **/ if( !empty($_POST['opml_link']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) { if(empty($_POST['number']) || empty($_POST['antibot']) ) - {$error[] = "Vous êtes un bot ?";} + {$error[] = "Vous êtes un bot ?";} elseif(! check_antibot($_POST['number'], $_POST['antibot'])) - {$error[] = "Antibot : Ce n'est pas le bon nombre.";} + {$error[] = "Antibot : ce n'est pas le bon nombre.";} if( empty( $_POST['opml_url'] )) {$error[] = 'Le lien est incorrect.';} @@ -729,10 +729,14 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY ?> - - - + + Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?> + + + + + '; } ?> - - -

- PROJET AUTOBLOG - 0) echo " | " . HEAD_TITLE; ?> -

- -
- '; - ?> -

Présentation

- -

- Le Projet Autoblog a pour objectif de répliquer les articles d'un blog ou d'un site site web.
- Si l'article source est supprimé, et même si le site d'origine disparaît, les articles restent lisibles sur l'autoblog.
- L'objectif premier de ce projet est de lutter contre la censure et toute sorte de pression... -

- -

- Voici une liste d'autoblogs hébergés sur - (plus d'infos sur le projet). -

- -

- Autres fermes - → Rechercher -

-
- - -
-

Mise à jour

-

- Une mise à jour du Projet Autoblog est disponible !
- → Télécharger la dernière version
- → Important : Consulter la documentation - mise à jour -

-
- - - -
- -

Ajouter un autoblog

- - Message'. (count($error) ? 's' : '') .' :

    '; - foreach ( $error AS $value ) { - echo '
  • '. $value .'
  • '; - } - foreach ( $success AS $value ) { - echo '
  • '. $value .'
  • '; - } - echo '
'; - } - - $button_list = '

Ajouter un autoblog via : '; - if(ALLOW_NEW_AUTOBLOGS_BY_LINKS) - $button_list .= 'Flux RSS '; - if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) { - $button_list .= 'Compte réseau social '; - $button_list .= 'Shaarli '; - } - if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) - $button_list .= 'Fichier OPML '; - if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) - $button_list .= 'Lien vers OPML '; - if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON) - $button_list .= 'Marque page '; - $button_list .= '

'; - echo $button_list; - - if(ALLOW_NEW_AUTOBLOGS_BY_LINKS == TRUE) { ?> -
-

Ajouter un site web

-

- Si vous souhaitez que héberge un autoblog d'un site,
- remplissez le formulaire suivant: -

- - -
- -
-

Ajouter un compte social

- -
-
- Twitter (local)
'; - else - echo 'Twitter (via bridge)
'; - } - else echo 'Twitter
'; ?> - -
- Youtube
-
- - -
-
- -
-

Ajouter un Shaarli

- -
- -
-
- - -
-
- -
-

Ajouter par fichier OPML

- -
- -
-
- - -
-
- - - - - - - -
- - + + +
+

Projet Autoblog0) echo " | " . HEAD_TITLE; ?>

+
+ +
+
'. substr($unit, (strrpos($unit, '/')) + 1 ) .'', $size); - } + if (defined('LOGO')) + echo ''."\n"; + ?> +

Présentation

+
+ +

Le Projet Autoblog a pour objectif de répliquer les articles d'un blog ou d'un site site web. Si l'article source est supprimé, et même si le site d'origine disparaît, les articles restent lisibles sur l'autoblog. L'objectif premier de ce projet est de lutter contre la censure et toute sorte de pression…

+ +

Voici une liste d'autoblogs hébergés sur (plus d'infos sur le projet).

+ +

Autres fermesRechercher

+
+ +
+
+

Mise à jour

+
+ +

Une mise à jour du Projet Autoblog est disponible !

+ +
+ + +
+
+

Ajouter un autoblog

+
+ + Message'. (count($error) ? 's' : '') ." :

\n"; + echo "
    \n"; + foreach ( $error AS $value ) { + echo '
  • '. $value ."
  • \n"; + } + foreach ( $success AS $value ) { + echo '
  • '. $value ."
  • \n"; + } + echo "
\n"; + echo " \n"; + echo ' '; + } + + $button_list = '

Ajouter un autoblog via :'."\n"; + if(ALLOW_NEW_AUTOBLOGS_BY_LINKS) + $button_list .= ' Flux RSS'."\n"; + if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) { + $button_list .= ' Compte réseau social'."\n"; + $button_list .= ' Shaarli'."\n"; + } + if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) + $button_list .= ' Fichier OPML'."\n"; + if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) + $button_list .= ' Lien vers OPML'."\n"; + if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON) + $button_list .= ' Marque page'."\n"; + $button_list .= "

\n"; + echo $button_list; + + if(ALLOW_NEW_AUTOBLOGS_BY_LINKS == TRUE) { ?> +
+
+

Ajouter un site web

+
+ +

Si vous souhaitez que héberge un autoblog d'un site, remplissez le formulaire suivant :

+ + +
+ +
+
+

Ajouter un compte social

+
+ +
+
+ Twitter (local)
'; + else + echo 'Twitter (via bridge)
'; } + else echo 'Twitter
'; ?> + +
+ Youtube
+
+ + +
+
+
+
+

Ajouter un Shaarli

+
+ +
+ +
+
+ + +
+
+ +
+
+

Ajouter par fichier OPML

+
+ +
+ +
+
+ + +
+
+ + + +
+
+

Marque page

+
+ +

Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages → ";var%20popup=window.open("","Add%20autoblog",'height=180,width=670');popup.document.writeln('');popup.document.write('Url%20feed%20%20:%20
');var%20feed_links=new%20Array();var%20links=document.getElementsByTagName('link');if(links.length>0){for(var%20i=0;i'+links[i].title+"%20(%20"+links[i].href+"%20)
");}}}popup.document.writeln("");popup.document.writeln("");popup.document.writeln("
");popup.document.writeln("");})();">Projet Autoblog
+

+ +
+ + '. substr($unit, (strrpos($unit, '/')) + 1 ) .'', $size); + } + } } if(!empty( $docs )) { - echo '

Autres documents

    '; - foreach( $docs as $value ) { - $str = $value[0]; - if ( !empty($value[1]) ) { - $str = sprintf('%s (%s)', $value[0], $value[1]); - } - echo '
  • '. $str . '
  • '; + echo '
    +
    +

    Autres documents

    +
    + +
      '."\n"; + foreach( $docs as $value ) { + $str = $value[0]; + if ( !empty($value[1]) ) { + $str = sprintf('%s (%s)', $value[0], $value[1]); } - echo '
'; + echo '
  • '. $str . "
  • \n"; + } + echo ' + '."\n"; } - ?> - -
    -

    Autoblogs hébergés rss

    - - -
    - $value) - { - $key = strtolower($key); - $config->$key = $value; - } - $autoblogs[$unit] = $config; - unset($ini); - } - } - } - } + ?> +
    +
    +

    Autoblogs hébergés rss

    +
    + + + +
      + $value) { + $key = strtolower($key); + $config->$key = $value; + } + $autoblogs[$unit] = $config; + unset($ini); } - - uasort($autoblogs, "objectCmp"); - $autoblogs_display = ''; - - if(!empty($autoblogs)){ - foreach ($autoblogs as $key => $autoblog) { - $opml_link='opml'; - $autoblogs_display .= '
      - -
      config ini '.$opml_link.' | '.escape($autoblog->site_type).' source: '.escape($autoblog->site_url).'
      -
      '; + } + } + } + } + + uasort($autoblogs, "objectCmp"); + $autoblogs_display = ''; + + if(!empty($autoblogs)){ + foreach ($autoblogs as $key => $autoblog) { + $opml_link='opml'; + $autoblogs_display .= '
    • +
      + + + +

      '.escape($autoblog->site_title).'

      +
      +
      +
      config ini '.$opml_link.' | '.escape($autoblog->site_type).' source : '.escape($autoblog->site_url).'
      +
    • '; } } echo $autoblogs_display; ?> -
    -
    - + ".count($autoblogs)." autoblogs hébergés

    "; ?> -
    - Propulsé par Projet Autoblog 0.3 de Mitsu, Oros et Arthur Hoaro (Domaine Public) - 0 ){ echo "
    ".FOOTER; } ?> - - - - - + + + + + + + From 1769559c32bca1bae6ff81138bc289a9372ee387 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Sun, 13 Oct 2013 19:21:49 +0200 Subject: [PATCH 076/105] =?UTF-8?q?Adaptation=20=C3=A0=20la=20s=C3=A9manti?= =?UTF-8?q?sation=20du=20pull=2041?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alors mon gros changement du pull 41 (pull request à peine faite), il faut évidemment adapter le CSS, pour les nouveaux éléments HTML5, comme le nettoyage du code. J’utilise ainsi les sélecteurs avancés (>, :target) de CSS2.1, mais c’est pas plus avancé que :hover, et la spécification date du XXe siècle, et les sélecteurs avancés fonctionnent partout, même sur IE, à l’exception de Netscape et Mozaic. J’ai aussi supprimé plusieurs id du coup, pour ne spécifier les id que sémantiquement et clairement, sans superflu. J’ai aussi ajouté un max-height à img par défaut, parce que chez moi mon image de 713px dépasse largement le bloc (et évidemment « max-height:100% » ne donne pas le résultat voulu, et ne fait rien), mais il faudrait mettre ça en px dans un conditionnel en fonction de la taille de l’écran, ou trouver un moyen de lui faire faire la hauteur du block de la section. J’ai aussi supprimé une propriété CSS de gradiant MS, déjà parce que IE est en train de tomber (et tout le monde il est content, et tout le monde il va faire du standard, et le fait-pou-IE est mort, etc.), et puis parce que c’est non seulement pas standard, mais que ça rend le CSS invalide pour le validateur du W3C (et ça pourrait donc créer des problèmes avec certains navigateurs, et diminuer l’expérience de certains à cause d’IE, je sais pas pour les autres, mais moi JAMAIS). --- resources/autoblog.css | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/resources/autoblog.css b/resources/autoblog.css index 259e2e8..5a51309 100644 --- a/resources/autoblog.css +++ b/resources/autoblog.css @@ -9,40 +9,42 @@ body {background-color:#efefef;text-align:center;color:#333;font-family:sans-serif;} a {color:black;text-decoration:none;font-weight:bold;} a:hover {color:darkred;} -h1 {text-align:center;font-size:40pt;text-shadow: #ccc 0px 5px 5px;} +h1 {text-transform:uppercase;text-align:center;font-size:40pt;text-shadow: #ccc 0px 5px 5px;} h2 {text-align:center;font-size: 16pt;margin:0 0 1em 0;font-style:italic;text-shadow: #ccc 0px 5px 5px; } -.pbloc {background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;text-align:justify;box-shadow:0px 5px 7px #aaa;} +body > section {background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;text-align:justify;box-shadow:0px 5px 7px #aaa;} +li {list-style-type:none;} input[type="text"]{width:20em;} input[type="radio"] {width:1em;} input[type="submit"] {width:8em;} -div.form {padding:0.2em;border:1px solid #fff;} -div.form:hover {background-color:#FAF4DA;border:1px dotted;} -#contentVignette {text-align: center;} -.vignette {width:27%;height:2em;display: inline-block;text-align:justify;margin:0; padding:20px;background-color:#eee;border: 1px solid #888;} -.vignette:hover {background-color:#fff;} -.vignette .title {font-size: 14pt;text-shadow: #ccc 0px 5px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} -.vignette .title a:hover {color:darkred; text-decoration:none;} -.vignette .source {font-size:x-small;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} -.vignette .source a:hover {color:darkred; text-decoration:none;} +section.form {padding:0.2em;border:1px solid #fff;} +section.form:hover {background-color:#FAF4DA;border:1px dotted;} +section#autoblogs > ul {text-align: center;padding:0;} +section#autoblogs > ul > li {width:27%;height:2em;display: inline-block;text-align:justify;margin:0; padding:20px;background-color:#eee;border: 1px solid #888;} +section#autoblogs > ul > li:hover {background-color:#fff;} +section#autoblogs > ul > li header, section#autoblogs > ul > li h3 {font-size: large;text-shadow: #ccc 0px 5px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +section#autoblogs > ul > li h3 {display:inline;font-size:large;text-overflow:ellipsis;width:100%;} +section#autoblogs > ul > li header a:hover {color:darkred; text-decoration:none;} +section#autoblogs > ul > li .source {font-size:x-small;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +section#autoblogs > ul > li .source a:hover {color:darkred; text-decoration:none;} .clear {clear:both;text-align:right;font-size:small;} #logo {float: right;} -.bouton{background: -moz-linear-gradient(center top , #EDEDED 5%, #DFDFDF 100%) repeat scroll 0 0 #EDEDED;border: 1px none;padding: 10px;border: 1px solid #7777777;border-radius: 8px 8px 8px 8px;box-shadow: 0 1px 0 0 #FFFFFF inset;display: inline-block;} +.bouton{background: -moz-linear-gradient(center top , #EDEDED 5%, #DFDFDF 100%) repeat scroll 0 0 #EDEDED;border: 1px none;padding: 10px;border: 1px solid #777777;border-radius: 8px 8px 8px 8px;box-shadow: 0 1px 0 0 #FFFFFF inset;display: inline-block;} .success {color: green;} .error {color: red;} .button_list{display:none;} -.button{-moz-box-shadow:inset 0 1px 0 0 #d9fbbe;-webkit-box-shadow:inset 0 1px 0 0 #d9fbbe;box-shadow:inset 0 1px 0 0 #d9fbbe;background:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356',endColorstr='#a5cc52');background-color:#b8e356;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} -.button:hover{background:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#a5cc52',endColorstr='#b8e356');background-color:#a5cc52;} +.button{-moz-box-shadow:inset 0 1px 0 0 #d9fbbe;-webkit-box-shadow:inset 0 1px 0 0 #d9fbbe;box-shadow:inset 0 1px 0 0 #d9fbbe;background:0;background-color:#b8e356;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} +.button:hover{background:0;background-color:#a5cc52;} .button:active{position:relative;top:1px;} .buttonactive{background-color:#aaa;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} @media screen and (max-width:1024px) { - .vignette { width: 40%; } + section#autoblogs > ul > li { width: 40%; } } @media screen and (max-width:640px) { h1 { font-size:20pt; } .button, .button:hover, .button:active, .buttonactive { display: block; margin: auto; text-align:center; } - .vignette { width: 80%; } + section#autoblogs > ul > li { width: 80%; } } @media screen and (max-width:480px) { #logo { max-width: 250px; } input[type="text"]{width:15em;} -} \ No newline at end of file +} From 845b8b4cfb5d8027e91714bd965607eea94e05d4 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 01:01:44 +0200 Subject: [PATCH 077/105] =?UTF-8?q?S=C3=A9mantisation=20d=E2=80=99autoblog?= =?UTF-8?q?.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sensiblement les même type de changement que le pull 41 (sauf que là le CSS est changé aussi du même coup), que je résumerais avec presque le même résumé : Alors j’ai fait énoooooormément de modifications… La principale est : un code source (HTML5) beau et sémantique. C’est à dire que j’utilise les balises sémantique HTML5, que le code est plus simple, qu’il est correctement indenté (2 espaces à chaque fois, c’est ce que je trouve de plus beau) et valide. Ça m’a pris une nuit et un aprèm’ (la nuit pour index.php, l’aprèm’ pour autoblog.php) de nettoyer ça, assez simple et très satisfaisant :). Bon après j’ai fait plusieurs autres modifications de genre divers aussi : j’ai supprimé des balises inutiles, des traits d’union par des tirets, fusion des lignes séparées par des (horrible) en un paragraphe (bien plus joli, organisé, sémantique, etc.), et d’autres choses encore. Par conséquent j’imagine que peut-être qu’il sera nécessaire de regarder la diff des changements. Mais pour voir le résultat final il y a mon instance : . Dans ce deuxième pull request quasiment identique au premier, les deux espaces insécables qui rendait le code inopérant ont été retirés. --- autoblogs/autoblog.php | 289 +++++++++++++++++++++-------------------- 1 file changed, 146 insertions(+), 143 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index 660aafa..f499471 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -8,7 +8,7 @@ - Source feed MUST be valid UTF-8 - Source feed MUST contain article body - This program is public domain. COPY COPY COPY ! + This program is public domain. COPY COPY COPY! */ $vvbversion = '0.3.0'; if (!version_compare(phpversion(), '5.3.0', '>=')) @@ -121,7 +121,7 @@ function exception_handler($e) exit; } - $error = "Error happened !\n\n". + $error = "Error happened!\n\n". $e->getCode()." - ".$e->getMessage()."\n\nIn: ". $e->getFile() . ":" . $e->getLine()."\n\n"; @@ -692,163 +692,167 @@ if (!$search && !empty($_SERVER['QUERY_STRING']) && !is_numeric($_SERVER['QUERY_ } // common CSS -$css=' * { margin: 0; padding: 0; } - body { font-family:sans-serif; background-color: #efefef; padding: 1%; color: #333; } - img { max-width: 100%; height: auto; } - a { text-decoration: none; color: #000;font-weight:bold; } - .header a { text-decoration: none; color: #000;font-weight:bold; } - .header { text-align:center; padding: 30px 3%; max-width:70em;margin:0 auto; } - .article .title { margin-bottom: 1em; } - .article .title h2 a:hover { color:#403976; } - .article h4 { font-weight: normal; font-size: small; color: #666; } - .article .source a { color: #666; } - .searchForm { float:right; } - .searchForm input { } - .pagination { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } - .pagination b { font-size: 1.2em; color: #333; } - .pagination a { color:#000; margin: 0 0.5em; } - .pagination a:hover { color:#333; } - .footer a { color:#000; } - .footer a:hover { color:#333; } - .content ul, .content ol { margin-left: 2em; } - .content h1, .content h2, .content h3, .content h4, .content h5, .content h6, - .content ul, .content ol, .content p, .content object, .content div, .content blockquote, - .content dl, .content pre { margin-bottom: 0.8em; } - .content pre, .content blockquote { background: #ddd; border: 1px solid #999; padding: 0.2em; max-width: 100%; overflow: auto; } - .content h1 { font-size: 1.5em; } - .content h2 { font-size: 1.4em;color:#000; } - .result h3 a { color: darkblue; text-decoration: none; text-shadow: 1px 1px 1px #fff; } - #error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; } +$css='* { margin: 0; padding: 0; } + body { font-family:sans-serif; background-color: #efefef; padding: 1%; color: #333; } + img { max-width: 100%; height: auto; } + a { text-decoration: none; color: #000;font-weight:bold; } + body > header a { text-decoration: none; color: #000;font-weight:bold; } + body > header { text-align:center; padding: 30px 3%; max-width:70em;margin:0 auto; } + body > article > header { margin-bottom: 1em; } + body > article > header h2 a:hover { color:#403976; } + body > article h4 { font-weight: normal; font-size: small; color: #666; } + body > article .source a { color: #666; } + body > header > form { float:right; } + body > header > form input { } + body > nav { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } + body > nav strong { font-size: 1.2em; color: #333; } + body > nav a { color:#000; margin: 0 0.5em; } + body > nav a:hover { color:#333; } + body > footer a { color:#000; } + body > footer a:hover { color:#333; } + .content ul, .content ol { margin-left: 2em; } + .content h1, .content h2, .content h3, .content h4, .content h5, .content h6, + .content ul, .content ol, .content p, .content object, .content div, .content blockquote, + .content dl, .content pre { margin-bottom: 0.8em; } + .content pre, .content blockquote { background: #ddd; border: 1px solid #999; padding: 0.2em; max-width: 100%; overflow: auto; } + .content h1 { font-size: 1.5em; } + .content h2 { font-size: 1.4em;color:#000; } + .result h3 a { color: darkblue; text-decoration: none; text-shadow: 1px 1px 1px #fff; } + #error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; } '; switch($site_type) { case 'microblog': case 'twitter': - $css .= '.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } - .article .title h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } - .article .title h2 a { color:#333; text-decoration:none; } - .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:0 auto;box-shadow:0px 5px 7px #aaa; } - .article .source { font-size: 0.8em; color: #666; } - .footer { margin-top:1em;text-align:center; font-size: small; color:#333; clear: both; } - .content {font-size:0.9em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}'; + $css .= "\n".' /* twitter/microblog style */ + body > header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } + body > article > header h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } + body > article > header h2 a { color:#333; text-decoration:none; } + body > article { background-color:white;padding: 12px 10px 33px;border:1px solid #aaa;max-width:70em;margin:0 auto;box-shadow:0px 5px 7px #aaa; } + body > article .source { font-size: 0.8em; color: #666; } + body > footer { margin-top:1em;text-align:center; font-size: small; color:#333; clear: both; } + .content {font-size:0.9em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}'; break; case 'shaarli': - $css .= '.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } - .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } - .article .title h2 a { color:#000; text-decoration:none; } - .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } - .article .source { margin-top:1em;font-size: 0.8em; color: #666; } - .footer { text-align:center; font-size: small; color:#333; clear: both; }'; + $css .= "\n".' /* shaarli style */ + body > header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; } + body > article > header title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } + body > article > header h2 a { color:#000; text-decoration:none; } + body > article { background-color:white;padding: 12px 10px 33px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } + body > article footer.source { margin-top:1em;font-size: 0.8em; color: #666; } + body > footer { text-align:center; font-size: small; color:#333; clear: both; }'; break; case 'generic': case 'youtube': default: - $css .= '.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; } - .article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } - .article .title h2 a { color:#000; text-decoration:none; } - .article .source { font-size: 0.8em; color: #666; } - .article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } - .footer { text-align:center; font-size: small; color:#333; clear: both; }'; + $css .= "\n".' /* youtube style */ + body > header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; } + body > article > header h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; } + body > article > header h2 a { color:#000; text-decoration:none; } + body > article footer.source { font-size: 0.8em; color: #666; } + body > article { background-color:white;padding: 12px 10px 33px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; } + body > footer { text-align:center; font-size: small; color:#333; clear: both; }'; } // HTML HEADER -echo ' - - - +echo ' + + '.escape($config->site_title).' '; if( $vvb->mustUpdateXsaf()) { - echo ''; + echo ' '; } echo ' - - -
    -

    PROJET AUTOBLOG'. (strlen(HEAD_TITLE) > 0 ? ' ~ '. HEAD_TITLE : '') .'

    -
    -

    '.escape($config->site_title).'

    '; - -if (!empty($config->site_description)) - echo '

    '.$config->site_description.'
    ⇐ retour index

    '; + + +
    +

    PROJET AUTOBLOG'. (strlen(HEAD_TITLE) > 0 ? ' ~ '. HEAD_TITLE : '') .'

    +
    +

    '.escape($config->site_title).'

    '; + + if (!empty($config->site_description)) + echo ' +

    '.$config->site_description.'

    +

    ⇐ retour index

    '; echo ' -
    -
    - - -
    -
    -
    +
    + + +
    + '; if( $vvb->mustUpdateXsaf()) { echo ' -
    -
    -

    '.__('Update').'

    -
    -
    - '.__('Import running: '). $vvb->getXsafCounter() . __(' files remaining').'
    - '.__('The page should refresh every second. If not, refresh manually.').' -
    -
    '; +
    +
    +

    '.__('Update').'

    +
    +
    + '.__('Import running: '). $vvb->getXsafCounter() . __(' files remaining').'
    + '.__('The page should refresh every second. If not, refresh manually.').' +
    +
    '; } elseif ($vvb->mustUpdate()) { echo ' -
    -
    -

    '.__('Update').'

    -
    -
    - '.__('Updating database... Please wait.').' -
    -
    '; +
    +
    +

    '.__('Update').'

    +
    +
    + '.__('Updating database... Please wait.').' +
    +
    '; } if (!empty($search)) { $results = $vvb->searchArticles($search); - $text = sprintf(__('%d results for %s'), count($results), escape($search)); + $text = sprintf(__('%d results for %s'), count($results), escape($search)); echo ' -
    -
    -

    '.__('Search').'

    - '.$text.' -
    -
    '; +
    +
    +

    '.__('Search').'

    + '.$text.' +
    +
    '; foreach ($results as $art) { echo ' -
    -

    '.escape($art['title']).'

    -

    '.$art['content'].'

    -
    '; + '; } } elseif (!is_null($article)) { if (!$article) { - echo ' -
    -
    -

    '.__('Not Found').'

    - '.(!empty($uri) ? '

    '.escape($vvb->getLocalURL($uri)) . '

    ' : '').' - '.__('Article not found.').' -
    -
    '; + echo ' +
    +
    +

    '.__('Not Found').'

    + '.(!empty($uri) ? '

    '.escape($vvb->getLocalURL($uri)) . '

    ' : '').' + '.__('Article not found.').' +
    +
    '; } else { - display_article($article); + display_article($article); } } else @@ -868,31 +872,31 @@ else $max = $vvb->countArticles(); if ($max > $config->articles_per_page) { - echo ''; + echo ' '; } } echo ' -'; + '; if( $vvb->mustUpdateXsaf() ) { try { @@ -910,9 +914,9 @@ if( $vvb->mustUpdateXsaf() ) { catch (VroumVroum_Feed_Exception $e) { echo ' -
    - '.escape($e->getMessage()).' -
    '; +
    + '.escape($e->getMessage()).' +
    '; $updated = 0; } } @@ -933,34 +937,34 @@ elseif ($vvb->mustUpdate()) catch (VroumVroum_Feed_Exception $e) { echo ' -
    +
    '.escape($e->getMessage()).' -
    '; +
    '; $updated = 0; } if ($updated > 0) { echo ' - '; + '; } else { echo ' - '; + '; } } echo ' - + '; @@ -976,15 +980,14 @@ function display_article($article) { global $vvb, $config; echo ' -
    -
    -

    '.escape($article['title']).'

    - '.strftime(__('_date_format'), $article['date']).' -
    -
    '.escape_content($article['content']).'
    -

    '.__('Source:').' '.escape($article['url']).'

    -
    -
    '; + '; } ?> From 8431683eea0d7ee2976ec786416ecd50dca8bf5d Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 14 Oct 2013 10:30:42 +0200 Subject: [PATCH 078/105] Milestone 0.3.1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 0d91a54..9e11b32 100755 --- a/version +++ b/version @@ -1 +1 @@ -0.3.0 +0.3.1 From a29ab08a23cfe917691bac675af0d219d0619bcc Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Mon, 14 Oct 2013 10:36:15 +0200 Subject: [PATCH 079/105] Milestone 0.3.1 -- changelog update --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ce73bb..234cbaa 100755 --- a/README.md +++ b/README.md @@ -65,7 +65,11 @@ Domaine public. Changelog ===================== - +- 2013-10-14 MILESTONE 0.3.1 + - code semantics + - "docs" filesize + - robots.txt + - bugfixes - 2013-07-30 - twitter2feed.php fixed (regex on class "avatar"; ``````) -- 2013-07-22 MILESTONE 3.0 +- 2013-07-22 MILESTONE 0.3 From c2e8fc035cf97de78a4e97fc30b11eac3218d891 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:02:53 +0200 Subject: [PATCH 080/105] =?UTF-8?q?Cr=C3=A9ation=20d=E2=80=99un=20fichier?= =?UTF-8?q?=20s=C3=A9par=C3=A9=20pour=20l=E2=80=99ic=C3=B4ne=20du=20type?= =?UTF-8?q?=20generic.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Voilà la version en fichier unique du logo des autoblogs génériques ! J’ai maté le code source et… ’fin ça se voit que ça a été fait vite fait sur Inkscape quoi… déjà que c’était pas un cercle parfait mais une presque-ellipse, mais en plus il utilisait `path` (l’élément à tout faire, qui fonctionne avec des commandes en lignes brisées et courbes de bezier), alors qu’il existe en svg un élément `circle` et même un élément `ellipse` ! Bon du coup j’ai refait ça à la main, retiré tout ce que le validateur voulait bien que je retire sans gueuler (je ne compte pas les warnings : la spécification de l’encodage osef, ya que de l’ASCII), et voilà un joli résultat on-ne-peut-plus-court (et la désindentation ne le rend même pas moins lisible tellement il est petit) en one-liner ! --- resources/icon-generic.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 resources/icon-generic.svg diff --git a/resources/icon-generic.svg b/resources/icon-generic.svg new file mode 100644 index 0000000..93dbf87 --- /dev/null +++ b/resources/icon-generic.svg @@ -0,0 +1 @@ + From 9144987e275526f97a87c93dbf6002f49003d030 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:06:16 +0200 Subject: [PATCH 081/105] =?UTF-8?q?Cr=C3=A9ation=20d=E2=80=99un=20fichier?= =?UTF-8?q?=20s=C3=A9par=C3=A9=20pour=20l=E2=80=99ic=C3=B4ne=20du=20type?= =?UTF-8?q?=20microblog.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Voilà la version en fichier unique du logo des autoblogs statusnet/GNU Social ! J’ai maté le code source et… ’fin ça se voit que ça a été fait vite fait sur Inkscape quoi… déjà que c’était pas un cercle parfait mais une presque-ellipse, mais en plus il utilisait `path` (l’élément à tout faire, qui fonctionne avec des commandes en lignes brisées et courbes de bezier), alors qu’il existe en svg un élément `circle` et même un élément `ellipse` ! Bon du coup j’ai refait ça à la main, retiré tout ce que le validateur voulait bien que je retire sans gueuler (je ne compte pas les warnings : la spécification de l’encodage osef, ya que de l’ASCII), et voilà un joli résultat on-ne-peut-plus-court (et la désindentation ne le rend même pas moins lisible tellement il est petit) en one-liner ! Pour utiliser la notation chromatique courte, j’ai un peu arrondi la couleur, mais aucune différence n’est visible à l’œil nu (de toute façon la couleur a été piochée dans Inkscape avec la précision d’une souris ou je me trompe ?). --- resources/icon-microblog.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 resources/icon-microblog.svg diff --git a/resources/icon-microblog.svg b/resources/icon-microblog.svg new file mode 100644 index 0000000..9084b4c --- /dev/null +++ b/resources/icon-microblog.svg @@ -0,0 +1 @@ + From 39f8ad6681ff819e4a2f3a098892fd4962873f80 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:08:21 +0200 Subject: [PATCH 082/105] =?UTF-8?q?Cr=C3=A9ation=20d=E2=80=99un=20fichier?= =?UTF-8?q?=20s=C3=A9par=C3=A9=20pour=20l=E2=80=99ic=C3=B4ne=20du=20type?= =?UTF-8?q?=20shaarli.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Voilà la version en fichier unique du logo des autoblogs shaarli ! J’ai maté le code source et… ’fin ça se voit que ça a été fait vite fait sur Inkscape quoi… déjà que c’était pas un cercle parfait mais une presque-ellipse, mais en plus il utilisait `path` (l’élément à tout faire, qui fonctionne avec des commandes en lignes brisées et courbes de bezier), alors qu’il existe en svg un élément `circle` et même un élément `ellipse` ! Bon du coup j’ai refait ça à la main, retiré tout ce que le validateur voulait bien que je retire sans gueuler (je ne compte pas les warnings : la spécification de l’encodage osef, ya que de l’ASCII), et voilà un joli résultat on-ne-peut-plus-court (et la désindentation ne le rend même pas moins lisible tellement il est petit) en one-liner ! Pour utiliser la notation chromatique courte, j’ai un peu arrondi la couleur (mais de vraiment peu), mais aucune différence n’est visible à l’œil nu (de toute façon la couleur a été piochée dans Inkscape avec la précision d’une souris ou je me trompe ?). --- resources/icon-shaarli.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 resources/icon-shaarli.svg diff --git a/resources/icon-shaarli.svg b/resources/icon-shaarli.svg new file mode 100644 index 0000000..f9b7ae9 --- /dev/null +++ b/resources/icon-shaarli.svg @@ -0,0 +1 @@ + From 597de6602ee8a590f6e571e2e4efd7bf7ff6ae91 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:11:24 +0200 Subject: [PATCH 083/105] =?UTF-8?q?Cr=C3=A9ation=20d=E2=80=99un=20fichier?= =?UTF-8?q?=20s=C3=A9par=C3=A9=20pour=20l=E2=80=99ic=C3=B4ne=20du=20type?= =?UTF-8?q?=20twitter.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Voilà la version en fichier unique du logo des autoblogs twitter ! J’ai maté le code source et… ’fin ça se voit que ça a été fait vite fait sur Inkscape quoi… déjà que c’était pas un cercle parfait mais une presque-ellipse, mais en plus il utilisait `path` (l’élément à tout faire, qui fonctionne avec des commandes en lignes brisées et courbes de bezier), alors qu’il existe en svg un élément `circle` et même un élément `ellipse` ! Bon du coup j’ai refait ça à la main, retiré tout ce que le validateur voulait bien que je retire sans gueuler (je ne compte pas les warnings : la spécification de l’encodage osef, ya que de l’ASCII), et voilà un joli résultat on-ne-peut-plus-court (et la désindentation ne le rend même pas moins lisible tellement il est petit) en one-liner ! Pour utiliser la notation chromatique courte, j’ai un peu arrondi la couleur, mais aucune différence n’est visible à l’œil nu (de toute façon la couleur a été piochée dans Inkscape avec la précision d’une souris ou je me trompe ?). --- resources/icon-twitter.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 resources/icon-twitter.svg diff --git a/resources/icon-twitter.svg b/resources/icon-twitter.svg new file mode 100644 index 0000000..1ccd3cf --- /dev/null +++ b/resources/icon-twitter.svg @@ -0,0 +1 @@ + From 2d035ccd7a8ed192d8b931db45d72ac3460337ed Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:13:27 +0200 Subject: [PATCH 084/105] =?UTF-8?q?Cr=C3=A9ation=20d=E2=80=99un=20fichier?= =?UTF-8?q?=20s=C3=A9par=C3=A9=20pour=20l=E2=80=99ic=C3=B4ne=20du=20type?= =?UTF-8?q?=20youtube.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Voilà la version en fichier unique du logo des autoblogs twitter ! J’ai maté le code source et… ’fin ça se voit que ça a été fait vite fait sur Inkscape quoi… déjà que c’était pas un cercle parfait mais une presque-ellipse, mais en plus il utilisait `path` (l’élément à tout faire, qui fonctionne avec des commandes en lignes brisées et courbes de bezier), alors qu’il existe en svg un élément `circle` et même un élément `ellipse` ! Bon du coup j’ai refait ça à la main, retiré tout ce que le validateur voulait bien que je retire sans gueuler (je ne compte pas les warnings : la spécification de l’encodage osef, ya que de l’ASCII), et voilà un joli résultat on-ne-peut-plus-court (et la désindentation ne le rend même pas moins lisible tellement il est petit) en one-liner ! Pour utiliser la notation chromatique courte, j’ai un peu arrondi la couleur (mais de vraiment peu), mais aucune différence n’est visible à l’œil nu (de toute façon la couleur a été piochée dans Inkscape avec la précision d’une souris ou je me trompe ?). --- resources/icon-youtube.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 resources/icon-youtube.svg diff --git a/resources/icon-youtube.svg b/resources/icon-youtube.svg new file mode 100644 index 0000000..b7c423c --- /dev/null +++ b/resources/icon-youtube.svg @@ -0,0 +1 @@ + From a20e82bf1701c2d43c3e3bcf498b43647fea641a Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:14:14 +0200 Subject: [PATCH 085/105] =?UTF-8?q?Appel=20des=20ic=C3=B4nes=20de=20type?= =?UTF-8?q?=20d=E2=80=99autoblog=20vers=20des=20fichiers=20externes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cette pull request fait la modification pour qu’index.php mette en URL celle des images externes situées dans le répertoire des ressources. --- index.php | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/index.php b/index.php index 8ec5f9e..0502400 100644 --- a/index.php +++ b/index.php @@ -192,44 +192,6 @@ if (isset($_GET['rss'])) { /** * SVG **/ -if (isset($_GET['icon'])) -{ -header('Content-type: image/svg+xml'); -function svg_base($color) - { - $svg = ''; - return $svg; - } - - $svg_twitter=svg_base('#3aaae1'); - $svg_youtube=svg_base('#a00000'); - $svg_statusnet=svg_base('#ff6a00'); - $svg_shaarli=svg_base('#008000'); - $svg_generic=svg_base('#000000'); - -$svg_type = ''; - - switch ($_GET['icon']) { - case "twitter": - $svg_type = $svg_twitter; - break; - case "microblog": - $svg_type = $svg_statusnet; - break; - case "youtube": - $svg_type = $svg_youtube; - break; - case "shaarli": - $svg_type = $svg_shaarli; - break; - case "generic": - $svg_type = $svg_generic; - break; - } - -die($svg_type); -} - if (isset($_GET['check'])) { header('Content-type: image/svg+xml'); @@ -980,7 +942,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY $autoblogs_display .= '
  • - +

    '.escape($autoblog->site_title).'

    From c88e26bbf766fcdc41ad3b949cbadd51655531d3 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 17:19:21 +0200 Subject: [PATCH 086/105] =?UTF-8?q?R=C3=A9duction=20du=20fichier=20du=20lo?= =?UTF-8?q?go=20d=E2=80=99autoblog.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alors là ça se voyait clairement que c’était Inkscape, c’était écrit en commentaire. Donc j’ai pris le temps de supprimer les méta-données inutiles, les id inutiles, les styles inutiles, le nombre de décimales inutiles, les groupes inutiles, etc. avec python-scour (je le recommande, le fichier doit être environ 3× plus petit maintenant), j’ai supprimé l’indentation, tout ce que le validateur du W3C me laisse retirer sans gueuler, et voilou ! Bon après on comprend toujours rien, mais bon allez comprendre des courbes de bezier instantanément… que ce soit réduit ou non, c’est du pareil au même. --- resources/icon-logo.svg | 254 ++++++---------------------------------- 1 file changed, 36 insertions(+), 218 deletions(-) diff --git a/resources/icon-logo.svg b/resources/icon-logo.svg index e3045dd..93f9c2d 100644 --- a/resources/icon-logo.svg +++ b/resources/icon-logo.svg @@ -1,218 +1,36 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +<\ +/g><\ +path d="m-143.4 102.9c-0.9741 0-1.712-0.4105-2.214-1.231-0.5019-0.8252-0.7529-2.016-0.7529-3.573 0-3.199 0.989-4.798 2.967-4.798 0.9868 0.00001 1.731 0.4126 2.233 1.238 0.5062 0.821 0.7593 2.008 0\ +.7593 3.56-0.00001 3.203-0.9975 4.804-2.992 4.804m0-0.989c0.6253 0 1.085-0.2978 1.378-0.8933 0.2935-0.5998 0.4402-1.574 0.4402-2.922-0.00001-1.34-0.1468-2.308-0.4402-2.903-0.2935-0.5998-0.7529-0.8\ +996-1.378-0.8996-0.6168 0.000008-1.07 0.2978-1.359 0.8933-0.285 0.5913-0.4275 1.561-0.4275 2.91-0.00001 1.353 0.1425 2.327 0.4275 2.922 0.2892 0.5955 0.7422 0.8933 1.359 0.8933"/><\ +path d="m77.81 118.1c-2.224 0-3.908-0.937-5.054-2.811-1.146-1.884-1.719-4.602-1.719-8.156-0.000002-7.302 2.258-10.95 6.772-10.95 2.253 0.000021 3.952 0.9418 5.098 2.826 1.155 1.874 1.733 4.583 1.7\ +33 8.127-0.000016 7.311-2.277 10.97-6.831 10.97m0-2.258c1.427 0 2.476-0.6797 3.146-2.039 0.6699-1.369 1.005-3.592 1.005-6.67-0.000013-3.058-0.335-5.267-1.005-6.627-0.67-1.369-1.719-2.054-3.146-2.0\ +54-1.408 0.00002-2.442 0.6797-3.102 2.039-0.6505 1.35-0.9758 3.563-0.9758 6.641-0.000005 3.088 0.3253 5.311 0.9758 6.67 0.6602 1.359 1.694 2.039 3.102 2.039"/> From 5754acee1899ef88b40e5d7787f28d8b4865fbc9 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 20:11:42 +0200 Subject: [PATCH 087/105] =?UTF-8?q?Ajout=20d=E2=80=99un=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout d’un système de cache de la génération de l’index des documents comme de la liste d’autoblog stockés respectivement dans `/docs.cache` et `/autoblogs.cache`. La durée est paramétrable avec les variables `DOCS_CACHE_DURATION` et `AUTOBLOGS_CACHE_DURATION`, à ajouter dans `config.php.example`. Merci au Hollandais volant pour cette astuce qui réduit par trois le temps de génération du code d’`index.php` et considérablement la charge processeur ;) . --- index.php | 165 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 106 insertions(+), 59 deletions(-) diff --git a/index.php b/index.php index 0502400..d2a574d 100644 --- a/index.php +++ b/index.php @@ -209,7 +209,7 @@ function svg_status($fill, $text, $back) $svg_ok=svg_status('#008000', 'ok', ''); $svg_mv=svg_status('#0000ff', 'mv', ''); $svg_err=svg_status('#000000', 'err', ''); - + $errorlog="./".escape( $_GET['check'] ) ."/error.log"; $oldvalue = null; @@ -265,8 +265,8 @@ if (isset($_GET['export'])) { foreach($subdirs as $unit) { if(is_dir($unit)) { - $unit=substr($unit, 2); $ini = parse_ini_file($unit.'/vvb.ini'); + $unit=substr($unit, 2); $config = new stdClass; foreach ($ini as $key=>$value) { @@ -331,7 +331,7 @@ if (isset($_GET['exportopml'])) // OPML foreach($subdirs as $unit) { if(is_dir($unit)) { - $unit=substr($unit, 2); + $unit=substr($unit, 2); $ini = parse_ini_file($unit.'/vvb.ini'); $config = new stdClass; @@ -366,7 +366,7 @@ if (isset($_GET['sitemap'])) $subdirs = glob(AUTOBLOGS_FOLDER . "*"); foreach($subdirs as $unit) { if(is_dir($unit)) { - $unit=substr($unit, 2); + $unit=substr($unit, 2); echo "\n ".$proto.$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, -9)."$unit/"."\n"; echo ' '.date('c', filemtime($unit))."\n"; echo " hourly\n\n\n"; @@ -825,7 +825,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY -
    @@ -840,7 +840,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
    - -
    @@ -866,37 +866,59 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
    - - '. substr($unit, (strrpos($unit, '/')) + 1 ) .'', $size); } } - } - if(!empty( $docs )) { - echo '
    + if(!empty( $docs )) { + echo '

    Autres documents

      '."\n"; - foreach( $docs as $value ) { - $str = $value[0]; - if ( !empty($value[1]) ) { - $str = sprintf('%s (%s)', $value[0], $value[1]); + + foreach( $docs as $value ) { + $str = $value[0]; + if ( !empty($value[1]) ) { + $str = sprintf('%s (%s)', $value[0], $value[1]); + } + echo '
    • '. $str . "
    • \n"; } - echo '
    • '. $str . "
    • \n"; - } - echo '
    + + echo '
    '."\n"; + } + } + // on recuperre le contenu du buffer + $contenuCache = ob_get_contents(); + ob_end_flush(); // on termine la bufferisation + $fd = fopen("$fichierCache", "w"); // on ouvre le fichier cache + if ($fd) { + fwrite($fd,$contenuCache); // on écrit le contenu du buffer dans le fichier cache + fclose($fd); } + // sinon le fichier cache existe déjà, on ne génère pas la page + // et on envoie le fichier statique à la place + } else { + readfile($fichierCache); // affichage du contenu du fichier + echo ' '."\n"; // et un petit message + } ?>
    @@ -909,37 +931,44 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY exportOPML -
      - $value) { - $key = strtolower($key); - $config->$key = $value; + + '; + $subdirs = glob(AUTOBLOGS_FOLDER . "*"); + $autoblogs = array(); + foreach($subdirs as $unit) { + if(is_dir($unit)) { + if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) { + if( file_exists(ROOT_DIR . '/' . $unit . '/vvb.ini')) { + $ini = parse_ini_file(ROOT_DIR . '/' . $unit . '/vvb.ini'); + if($ini) { + $config = new stdClass; + foreach ($ini as $key=>$value) { + $key = strtolower($key); + $config->$key = $value; + } + $autoblogs[$unit] = $config; + unset($ini); } - $autoblogs[$unit] = $config; - unset($ini); } } } } - } - - uasort($autoblogs, "objectCmp"); - $autoblogs_display = ''; - - if(!empty($autoblogs)){ - foreach ($autoblogs as $key => $autoblog) { - $opml_link='opml'; - $autoblogs_display .= '
    • + + uasort($autoblogs, "objectCmp"); + $autoblogs_display = ''; + + if(!empty($autoblogs)){ + foreach ($autoblogs as $key => $autoblog) { + $opml_link='opml'; + $autoblogs_display .= '
    • @@ -949,12 +978,30 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
      config ini '.$opml_link.' | '.escape($autoblog->site_type).' source : '.escape($autoblog->site_url).'
    • '; - } - } - echo $autoblogs_display; - ?> -
    - ".count($autoblogs)." autoblogs hébergés

    "; ?> + } + } + echo $autoblogs_display; + + echo ' + +

    '.count($autoblogs).' autoblogs hébergés

    '; + + // on recuperre le contenu du buffer + $contenuCache = ob_get_contents(); + ob_end_flush(); // on termine la bufferisation + $fd = fopen("$fichierCache", "w"); // on ouvre le fichier cache + if ($fd) { + fwrite($fd,$contenuCache); // on écrit le contenu du buffer dans le fichier cache + fclose($fd); + } + // sinon le fichier cache existe déjà, on ne génère pas la page + // et on envoie le fichier statique à la place + } else { + echo ''."\n".' '; // un message de début + readfile($fichierCache); // affichage du contenu du fichier + echo "\n".' '."\n"; // et un petit message + } + ?>
    From 46d26c3c06ac87020cf403237444e5965a603475 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 14 Oct 2013 23:52:26 +0200 Subject: [PATCH 088/105] =?UTF-8?q?Am=C3=A9lioration=20de=20la=20liste=20d?= =?UTF-8?q?es=20liens=20de=20pagination.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lien inutile redirigeant vert la page actuelle retiré, code plus simple (selon moi) et ajout des attributs `rel=prev` et `rel=next` (plus sémantique). --- autoblogs/autoblog.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index f499471..add20f0 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -870,23 +870,20 @@ else } $max = $vvb->countArticles(); - if ($max > $config->articles_per_page) - { - echo "\n".' '; } } From 2068947e61e6961026fae84e7d0bcf133537774f Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 19 Oct 2013 14:05:33 +0200 Subject: [PATCH 089/105] syntaxes SVG --- resources/icon-generic.svg | 2 +- resources/icon-logo.svg | 100 ++++++++++++++++++++++------------- resources/icon-microblog.svg | 2 +- resources/icon-shaarli.svg | 2 +- resources/icon-twitter.svg | 2 +- resources/icon-youtube.svg | 2 +- 6 files changed, 69 insertions(+), 41 deletions(-) diff --git a/resources/icon-generic.svg b/resources/icon-generic.svg index 93dbf87..6e8e68b 100644 --- a/resources/icon-generic.svg +++ b/resources/icon-generic.svg @@ -1 +1 @@ - + diff --git a/resources/icon-logo.svg b/resources/icon-logo.svg index 93f9c2d..f4692f5 100644 --- a/resources/icon-logo.svg +++ b/resources/icon-logo.svg @@ -1,36 +1,64 @@ -<\ -/g><\ -path d="m-143.4 102.9c-0.9741 0-1.712-0.4105-2.214-1.231-0.5019-0.8252-0.7529-2.016-0.7529-3.573 0-3.199 0.989-4.798 2.967-4.798 0.9868 0.00001 1.731 0.4126 2.233 1.238 0.5062 0.821 0.7593 2.008 0\ -.7593 3.56-0.00001 3.203-0.9975 4.804-2.992 4.804m0-0.989c0.6253 0 1.085-0.2978 1.378-0.8933 0.2935-0.5998 0.4402-1.574 0.4402-2.922-0.00001-1.34-0.1468-2.308-0.4402-2.903-0.2935-0.5998-0.7529-0.8\ -996-1.378-0.8996-0.6168 0.000008-1.07 0.2978-1.359 0.8933-0.285 0.5913-0.4275 1.561-0.4275 2.91-0.00001 1.353 0.1425 2.327 0.4275 2.922 0.2892 0.5955 0.7422 0.8933 1.359 0.8933"/><\ -path d="m77.81 118.1c-2.224 0-3.908-0.937-5.054-2.811-1.146-1.884-1.719-4.602-1.719-8.156-0.000002-7.302 2.258-10.95 6.772-10.95 2.253 0.000021 3.952 0.9418 5.098 2.826 1.155 1.874 1.733 4.583 1.7\ -33 8.127-0.000016 7.311-2.277 10.97-6.831 10.97m0-2.258c1.427 0 2.476-0.6797 3.146-2.039 0.6699-1.369 1.005-3.592 1.005-6.67-0.000013-3.058-0.335-5.267-1.005-6.627-0.67-1.369-1.719-2.054-3.146-2.0\ -54-1.408 0.00002-2.442 0.6797-3.102 2.039-0.6505 1.35-0.9758 3.563-0.9758 6.641-0.000005 3.088 0.3253 5.311 0.9758 6.67 0.6602 1.359 1.694 2.039 3.102 2.039"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icon-microblog.svg b/resources/icon-microblog.svg index 9084b4c..6c93dc1 100644 --- a/resources/icon-microblog.svg +++ b/resources/icon-microblog.svg @@ -1 +1 @@ - + diff --git a/resources/icon-shaarli.svg b/resources/icon-shaarli.svg index f9b7ae9..e90e3e8 100644 --- a/resources/icon-shaarli.svg +++ b/resources/icon-shaarli.svg @@ -1 +1 @@ - + diff --git a/resources/icon-twitter.svg b/resources/icon-twitter.svg index 1ccd3cf..fb032ef 100644 --- a/resources/icon-twitter.svg +++ b/resources/icon-twitter.svg @@ -1 +1 @@ - + diff --git a/resources/icon-youtube.svg b/resources/icon-youtube.svg index b7c423c..5799688 100644 --- a/resources/icon-youtube.svg +++ b/resources/icon-youtube.svg @@ -1 +1 @@ - + From dd931b07ffe9213f3f893fed825be6de508d9b46 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Thu, 24 Oct 2013 01:28:13 +0200 Subject: [PATCH 090/105] Update functions.php --- functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions.php b/functions.php index 6a6859c..875e980 100755 --- a/functions.php +++ b/functions.php @@ -16,6 +16,9 @@ if (!defined('FOLDER_MAX_LENGTH')) define('FOLDER_MAX_LENGTH', 80); date_default_timezone_set('Europe/Paris'); setlocale(LC_TIME, 'fr_FR.UTF-8', 'fr_FR', 'fr'); +if( !defined('DOCS_CACHE_DURATION')) define( 'DOCS_CACHE_DURATION', 1800 ); +if( !defined('AUTOBLOGS_CACHE_DURATION')) define( 'AUTOBLOGS_CACHE_DURATION', 1800 ); + if( !defined('ALLOW_FULL_UPDATE')) define( 'ALLOW_FULL_UPDATE', TRUE ); if( !defined('ALLOW_CHECK_UPDATE')) define( 'ALLOW_CHECK_UPDATE', TRUE ); From 949dd8fbee9416e1621c4c61c68e98558d7b417e Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Thu, 24 Oct 2013 01:29:12 +0200 Subject: [PATCH 091/105] Update config.php.example --- config.php.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.php.example b/config.php.example index 1c884e9..acc54e3 100644 --- a/config.php.example +++ b/config.php.example @@ -13,6 +13,9 @@ // define( 'HEAD_TITLE', ''); // define( 'FOOTER', 'D\'après les premières versions de SebSauvage et Bohwaz.'); +// define( 'DOCS_CACHE_DURATION', 1800); +// define( 'AUTOBLOGS_CACHE_DURATION', 1800); + // define( 'ALLOW_FULL_UPDATE', TRUE ); // define( 'ALLOW_CHECK_UPDATE', TRUE ); From dd1b754994e24020dd86a99c958c2dc05535d4bc Mon Sep 17 00:00:00 2001 From: BoboTiG Date: Thu, 21 Nov 2013 00:59:11 +0100 Subject: [PATCH 092/105] Fix PHP warning date() --- xsaf3.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/xsaf3.php b/xsaf3.php index 8ad26a6..b95c62d 100755 --- a/xsaf3.php +++ b/xsaf3.php @@ -7,25 +7,27 @@ define('ALLOW_REMOTE_DB_DL', true); define('ALLOW_REMOTE_MEDIA_DL', true); define('EXEC_TIME', 10); +date_default_timezone_set('UTC'); + header("HTTP/1.0 403 Forbidden"); /* Uncivilized method to prevent bot indexing, huh :) */ header('X-Robots-Tag: noindex'); /* more civilized method, but bots may not all take into account */ //header('Content-type: text/plain'); -$expire = time() -7200 ; +$expire = time() -7200 ; $lockfile = ".xsaflock"; /* defaut delay: 7200 (2 hours) */ if (file_exists($lockfile) && filemtime($lockfile) > $expire) { echo "too early"; die; -} +} else { if( file_exists($lockfile) ) unlink($lockfile); - + if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) { echo "Merci d'ajouter des droits d'écriture sur le dossier."; die; - } + } } define('ROOT_DIR', __DIR__); @@ -57,7 +59,7 @@ function xsafimport($xsafremote, $max_exec_time) { echo "\n*Traitement $xsafremote en maximum $max_exec_time secondes"; $max_exec_time+=time()-1; // -1 car l'import prend environ 1 seconde - + /* détection de ferme autoblog */ $json_import = file_get_contents($xsafremote); if(!empty($json_import)) { @@ -73,7 +75,7 @@ function xsafimport($xsafremote, $max_exec_time) { $get_remote_db = ($json_import['meta']['xsaf-db_transfer'] == "true") ? true : false; $get_remote_media = ($json_import['meta']['xsaf-media_transfer'] == "true") ? true : false; - + if(!empty($json_import['autoblogs'])) { foreach ($json_import['autoblogs'] as $remote_folder => $value) { if(DEBUG) debug('remote = '. $remote_folder); @@ -90,7 +92,7 @@ function xsafimport($xsafremote, $max_exec_time) { /* TOO SLOW $xml = simplexml_load_file($rssurl); // quick feed check // ATOM feed && RSS 1.0 /RDF && RSS 2.0 - $result = (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item)) ? false : true; */ + $result = (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item)) ? false : true; */ $result = true; /* autoblog */ @@ -109,8 +111,8 @@ function xsafimport($xsafremote, $max_exec_time) { /* ============================================================================================================================================================================== */ /* récupération de la DB distante */ if($get_remote_db == true && ALLOW_REMOTE_DB_DL ) { - $remote_db = str_replace("?export", $remote_folder."/articles.db", $xsafremote); - copy($remote_db, './'. $foldername .'/articles.db'); + $remote_db = str_replace("?export", $remote_folder."/articles.db", $xsafremote); + copy($remote_db, './'. $foldername .'/articles.db'); } /* préparation à la récupération des médias distants */ if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) { @@ -144,19 +146,19 @@ function xsafimport($xsafremote, $max_exec_time) { if(time() >= $max_exec_time) { if( DEBUG ) echo "

    Time out !

    "; - break; + break; } } - } + } else { if( DEBUG ) echo "Format JSON incorrect."; return false; } } - return; + return; } - + if( DEBUG ) echo ''; if( ALLOW_NEW_AUTOBLOGS and ALLOW_NEW_AUTOBLOGS_BY_XSAF && !empty($friends_autoblog_farm) ) { foreach( $friends_autoblog_farm AS $value ) { From 8f3f91ea62f1c33c030106b6f689d77a3c6b5abd Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 2 Dec 2013 20:50:37 +0100 Subject: [PATCH 093/105] Fixes #64 --- index.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index 0502400..2018010 100644 --- a/index.php +++ b/index.php @@ -118,12 +118,7 @@ function create_from_opml($opml) { try { $sitename = escape( $outline['title'] ); $siteurl = escape($outline['htmlUrl']); - - // Lighten process by checking folderExists first - // A CHANGER SELON ISSUE #20 - if(folderExists($siteurl)) - throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.'); - + $sitetype = escape($outline['text']); if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'youtube') $sitetype = 'generic'; @@ -228,6 +223,7 @@ function svg_status($fill, $text, $back) if(!empty($headers)) $code=explode(" ", $headers[0]); + else $code = array(); /* le flux est indisponible (typiquement: erreur DNS ou possible censure) - à vérifier */ if(empty($headers) || $headers === FALSE || (!empty($code) && ($code[1] == '500' || $code[1] == '404'))) { @@ -862,7 +858,12 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY

    Marque page

    -

    Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages → ";var%20popup=window.open("","Add%20autoblog",'height=180,width=670');popup.document.writeln('');popup.document.write('Url%20feed%20%20:%20
    ');var%20feed_links=new%20Array();var%20links=document.getElementsByTagName('link');if(links.length>0){for(var%20i=0;i'+links[i].title+"%20(%20"+links[i].href+"%20)
    ");}}}popup.document.writeln("");popup.document.writeln("");popup.document.writeln("
    ");popup.document.writeln("");})();">Projet Autoblog
    +

    + Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages → + marque-page sur ce lien)'); + return false;" + href="javascript:(function(){var%20autoblog_url="";var%20popup=window.open("","Add%20autoblog",'height=180,width=670');popup.document.writeln('');popup.document.write('Url%20feed%20%20:%20
    ');var%20feed_links=new%20Array();var%20links=document.getElementsByTagName('link');if(links.length>0){for(var%20i=0;i'+links[i].title+"%20(%20"+links[i].href+"%20)
    ");}}}popup.document.writeln("");popup.document.writeln("");popup.document.writeln("
    ");popup.document.writeln("");})();">Projet Autoblog
    From fbb381ff5b23c4944e4d6add62b189814a1cc878 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 4 Jan 2014 11:44:50 +0100 Subject: [PATCH 094/105] fixes #72 --- .gitignore | 1 + index.php | 61 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index bf36f6b..9fd397e 100755 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ autoblogs/* docs/* !docs/docs.txt robots.txt +.idea \ No newline at end of file diff --git a/index.php b/index.php index 2018010..3c88c78 100644 --- a/index.php +++ b/index.php @@ -376,36 +376,47 @@ if (isset($_GET['sitemap'])) * Update ALL autblogs (except .disabled) * This action can be very slow and consume CPU if you have a lot of autoblogs **/ -if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) { - $max_exec_time=time()+4; // scipt have 4 seconds to update autoblogs - $expire = time() - 84600 ; // 23h30 en secondes - $lockfile = ".updatealllock"; - $lockfile_contents = array(); - if (file_exists($lockfile)){ - $lockfile_contents = file_get_contents($lockfile); - if( !isset($lockfile_contents[0]) || $lockfile_contents[0] != "a") { // détection d'une serialisation - if( filemtime($lockfile) > $expire){ - echo "too early"; - die; - }else{ - // need update of all autoblogs - unlink($lockfile); +if( isset($_GET['updateall']) ) { + if( !isset( $_GET['force']) ) { + $max_exec_time=time()+4; // scipt have 4 seconds to update autoblogs + $expire = time() - 5 ; // 5 seconds + $lockfile = ".updatealllock"; + $lockfile_contents = array(); + if (file_exists($lockfile)){ + $lockfile_contents = file_get_contents($lockfile); + if( !isset($lockfile_contents[0]) || $lockfile_contents[0] != "a") { // détection d'une serialisation + if( filemtime($lockfile) > $expire){ + echo "too early"; + die; + }else{ + // need update of all autoblogs + unlink($lockfile); + } } + // else we need to update some autoblogs } - // else we need to update some autoblogs - } - if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) { - echo "Merci d'ajouter des droits d'écriture sur le fichier."; + if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) { + echo "Merci d'ajouter des droits d'écriture sur le fichier."; + die; + } + + if(!empty($lockfile_contents)) { + $subdirs = unserialize($lockfile_contents); + unset($lockfile_contents); + }else{ + $subdirs = glob(AUTOBLOGS_FOLDER . "*"); + } + } + elseif (ALLOW_FULL_UPDATE) { + $subdirs = glob(AUTOBLOGS_FOLDER . "*"); + $max_exec_time=time() * 2; // workaround to disable max exec time + } + else { + echo "You're not allowed to force full update."; die; } - - if(!empty($lockfile_contents)) { - $subdirs = unserialize($lockfile_contents); - unset($lockfile_contents); - }else{ - $subdirs = glob(AUTOBLOGS_FOLDER . "*"); - } $todo_subdirs = $subdirs; + foreach($subdirs as $key => $unit) { if(is_dir($unit)) { if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) { From 57f1780fb454da8568be979777c87eeb58e6d76f Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 29 Jan 2014 11:42:04 +0100 Subject: [PATCH 095/105] re-fixes #72 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 3c88c78..aa9f22a 100644 --- a/index.php +++ b/index.php @@ -377,10 +377,10 @@ if (isset($_GET['sitemap'])) * This action can be very slow and consume CPU if you have a lot of autoblogs **/ if( isset($_GET['updateall']) ) { + $lockfile = ".updatealllock"; if( !isset( $_GET['force']) ) { $max_exec_time=time()+4; // scipt have 4 seconds to update autoblogs $expire = time() - 5 ; // 5 seconds - $lockfile = ".updatealllock"; $lockfile_contents = array(); if (file_exists($lockfile)){ $lockfile_contents = file_get_contents($lockfile); From d2d1c3003bf12d42e9ca60dad59bc2ff57e60477 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 12 Feb 2014 10:59:04 +0100 Subject: [PATCH 096/105] Milestone 0.3.2 --- README.md | 7 +++++++ version | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 234cbaa..66f8f11 100755 --- a/README.md +++ b/README.md @@ -65,6 +65,13 @@ Domaine public. Changelog ===================== +- 2014-02-12 MILESTONE 0.3.2 + - separate type icons + - cache added + - pagination fixes + - SVG fixes + - fix date() warnings + - bugfixes - 2013-10-14 MILESTONE 0.3.1 - code semantics - "docs" filesize diff --git a/version b/version index 9e11b32..d15723f 100755 --- a/version +++ b/version @@ -1 +1 @@ -0.3.1 +0.3.2 From fdab0b64b76a2168ce6d50ed492bd31b02bb2d09 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Fri, 14 Feb 2014 10:36:31 +0100 Subject: [PATCH 097/105] fix undefined index when adding --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 39afe8b..f3ae23e 100644 --- a/index.php +++ b/index.php @@ -606,6 +606,7 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L if(empty($error)) { try { $rssurl = parse_url($_POST['rssurl']); + if(!isset($rssurl['query'])) $rssurl['query'] = ''; $rssurl = $rssurl['scheme'].'://'.$rssurl['host'].$rssurl['path'].'?'.html_entity_decode($rssurl['query']); $rssurl = DetectRedirect($rssurl); From bc338ff19070e656a68fd1207ad9be12f783fe8c Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 19 Feb 2014 10:50:53 +0100 Subject: [PATCH 098/105] use file_put_contents for cache --- index.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/index.php b/index.php index f3ae23e..ce8f540 100644 --- a/index.php +++ b/index.php @@ -921,11 +921,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY // on recuperre le contenu du buffer $contenuCache = ob_get_contents(); ob_end_flush(); // on termine la bufferisation - $fd = fopen("$fichierCache", "w"); // on ouvre le fichier cache - if ($fd) { - fwrite($fd,$contenuCache); // on écrit le contenu du buffer dans le fichier cache - fclose($fd); - } + file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache // sinon le fichier cache existe déjà, on ne génère pas la page // et on envoie le fichier statique à la place } else { @@ -1002,11 +998,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY // on recuperre le contenu du buffer $contenuCache = ob_get_contents(); ob_end_flush(); // on termine la bufferisation - $fd = fopen("$fichierCache", "w"); // on ouvre le fichier cache - if ($fd) { - fwrite($fd,$contenuCache); // on écrit le contenu du buffer dans le fichier cache - fclose($fd); - } + file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache // sinon le fichier cache existe déjà, on ne génère pas la page // et on envoie le fichier statique à la place } else { From 6b47221093e269a163f5e2f9e83886d16a22aaf7 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 19 Feb 2014 11:06:40 +0100 Subject: [PATCH 099/105] fuck proprietary CSS elements --- resources/autoblog.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/autoblog.css b/resources/autoblog.css index 5a51309..5c736db 100644 --- a/resources/autoblog.css +++ b/resources/autoblog.css @@ -28,14 +28,14 @@ section#autoblogs > ul > li .source {font-size:x-small;white-space:nowrap;overfl section#autoblogs > ul > li .source a:hover {color:darkred; text-decoration:none;} .clear {clear:both;text-align:right;font-size:small;} #logo {float: right;} -.bouton{background: -moz-linear-gradient(center top , #EDEDED 5%, #DFDFDF 100%) repeat scroll 0 0 #EDEDED;border: 1px none;padding: 10px;border: 1px solid #777777;border-radius: 8px 8px 8px 8px;box-shadow: 0 1px 0 0 #FFFFFF inset;display: inline-block;} +.bouton{border: 1px none;padding: 10px;border: 1px solid #777777;border-radius: 8px 8px 8px 8px;box-shadow: 0 1px 0 0 #FFFFFF inset;display: inline-block;} .success {color: green;} .error {color: red;} .button_list{display:none;} -.button{-moz-box-shadow:inset 0 1px 0 0 #d9fbbe;-webkit-box-shadow:inset 0 1px 0 0 #d9fbbe;box-shadow:inset 0 1px 0 0 #d9fbbe;background:0;background-color:#b8e356;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} +.button{box-shadow:inset 0 1px 0 0 #d9fbbe;background:0;background-color:#b8e356;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} .button:hover{background:0;background-color:#a5cc52;} .button:active{position:relative;top:1px;} -.buttonactive{background-color:#aaa;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} +.buttonactive{background-color:#aaa;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;} @media screen and (max-width:1024px) { section#autoblogs > ul > li { width: 40%; } } From db722915d03bfd1ce1762ed33a8722cec74de8ca Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Wed, 19 Feb 2014 11:10:48 +0100 Subject: [PATCH 100/105] change cache files, add gitignore --- .gitignore | 3 ++- index.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9fd397e..2ac4f7c 100755 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ autoblogs/* docs/* !docs/docs.txt robots.txt -.idea \ No newline at end of file +.idea +cache_* diff --git a/index.php b/index.php index ce8f540..6d1e6bc 100644 --- a/index.php +++ b/index.php @@ -880,7 +880,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY Date: Wed, 19 Feb 2014 22:05:37 +0100 Subject: [PATCH 101/105] workaround issue #74 - ob_end_clean() --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 6d1e6bc..15e3440 100644 --- a/index.php +++ b/index.php @@ -920,8 +920,9 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY } // on recuperre le contenu du buffer $contenuCache = ob_get_contents(); - ob_end_flush(); // on termine la bufferisation + ob_end_clean(); // on termine la bufferisation file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache + echo $contenuCache; // et on sort // sinon le fichier cache existe déjà, on ne génère pas la page // et on envoie le fichier statique à la place } else { @@ -997,8 +998,9 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY // on recuperre le contenu du buffer $contenuCache = ob_get_contents(); - ob_end_flush(); // on termine la bufferisation + ob_end_clean(); // on termine la bufferisation file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache + echo $contenuCache; // et on sort // sinon le fichier cache existe déjà, on ne génère pas la page // et on envoie le fichier statique à la place } else { From d2d00e7a1f15ad3220ec16a75ebb75672640ac31 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 20 Feb 2014 12:37:27 +0100 Subject: [PATCH 102/105] =?UTF-8?q?#74=20-=20tu=20as=20l'air=20de=20gal?= =?UTF-8?q?=C3=A9rer=20Mitsu=20:p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 15e3440..4f521cb 100644 --- a/index.php +++ b/index.php @@ -921,7 +921,9 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY // on recuperre le contenu du buffer $contenuCache = ob_get_contents(); ob_end_clean(); // on termine la bufferisation - file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache + if( !empty($contenuCache) ) { + file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache + } echo $contenuCache; // et on sort // sinon le fichier cache existe déjà, on ne génère pas la page // et on envoie le fichier statique à la place @@ -999,7 +1001,9 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY // on recuperre le contenu du buffer $contenuCache = ob_get_contents(); ob_end_clean(); // on termine la bufferisation - file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache + if( !empty($contenuCache) ) { + file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache + } echo $contenuCache; // et on sort // sinon le fichier cache existe déjà, on ne génère pas la page // et on envoie le fichier statique à la place From 002e08c30730f696d34c4d3ec64b4c9fd585a136 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 3 Mar 2014 20:45:18 +0100 Subject: [PATCH 103/105] Indication du charset plus explicite Plus explicite, plus portable, plus compatible. --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 4f521cb..d3c75af 100644 --- a/index.php +++ b/index.php @@ -702,6 +702,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?> + From 681697a41f8a571d25d6a1edd05bc6fd1b5ac8c0 Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 3 Mar 2014 22:03:24 +0100 Subject: [PATCH 104/105] Ajustement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suppression d’une balise oubliée et capitalisation conventionnelle d’un header HTTP. --- index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.php b/index.php index d3c75af..5dcb740 100644 --- a/index.php +++ b/index.php @@ -702,8 +702,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?> - - + From 92fbd461b6d9ee50ad0fab5f07c5796d3414009d Mon Sep 17 00:00:00 2001 From: Garreau Alexandre Date: Mon, 3 Mar 2014 22:05:28 +0100 Subject: [PATCH 105/105] Ajustement. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout de l’attribut charset qui devrait être à l’avenir supporté partout et supplanter l’http-equiv (et fermeture correcte de la balise). --- autoblogs/autoblog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php index add20f0..322d993 100644 --- a/autoblogs/autoblog.php +++ b/autoblogs/autoblog.php @@ -758,7 +758,7 @@ switch($site_type) { echo ' - + '.escape($config->site_title).'