From fdfaa357c508a6967168e5e6508ac5dd333062ef Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 9 Feb 2013 12:40:50 +0100 Subject: [PATCH] modified: _experimental/autoblog-0.3.php deleted: _experimental/gatitac/index.php deleted: _experimental/gatitac/vvb.ini modified: _experimental/index.php modified: _experimental/xsaf3.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MILESTONE: Release Candidate 1 [bugfix] * ajout shaarli * via_button (champs check et écriture INI) * pointage index.php * foldername [mod] * descriptions pareilles --- _experimental/autoblog-0.3.php | 2 +- _experimental/gatitac/index.php | 1 - _experimental/gatitac/vvb.ini | 9 -------- _experimental/index.php | 39 ++++++++++++++++----------------- _experimental/xsaf3.php | 6 +++-- 5 files changed, 24 insertions(+), 33 deletions(-) mode change 100755 => 100644 _experimental/autoblog-0.3.php delete mode 100755 _experimental/gatitac/index.php delete mode 100644 _experimental/gatitac/vvb.ini diff --git a/_experimental/autoblog-0.3.php b/_experimental/autoblog-0.3.php old mode 100755 new mode 100644 index a2f8317..1856f9a --- a/_experimental/autoblog-0.3.php +++ b/_experimental/autoblog-0.3.php @@ -674,7 +674,7 @@ if($site_type == 'generic') // custom CSS for generic } 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;text-transform:uppercase; } + $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; } diff --git a/_experimental/gatitac/index.php b/_experimental/gatitac/index.php deleted file mode 100755 index 2481298..0000000 --- a/_experimental/gatitac/index.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/_experimental/gatitac/vvb.ini b/_experimental/gatitac/vvb.ini deleted file mode 100644 index e7cdee8..0000000 --- a/_experimental/gatitac/vvb.ini +++ /dev/null @@ -1,9 +0,0 @@ -[VroumVroumBlogConfig] -SITE_TYPE="microblog" -SITE_TITLE="identica-gatitac" -SITE_DESCRIPTION="Automicroblog de @gatitac" -SITE_URL="http://identi.ca/gatitac" -FEED_URL="http://identi.ca/api/statuses/user_timeline/gatitac.rss" -ARTICLES_PER_PAGE=10 -UPDATE_INTERVAL=3600 -UPDATE_TIMEOUT=30 diff --git a/_experimental/index.php b/_experimental/index.php index d064ad6..aeca651 100755 --- a/_experimental/index.php +++ b/_experimental/index.php @@ -94,10 +94,6 @@ $svg_twitter=''. $sitename .'" +SITE_DESCRIPTION="source: '. $sitename .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" -ARTICLES_PER_PAGE="'. $articles_per_page .'" -UPDATE_INTERVAL="'. $update_interval .'" -UPDATE_TIMEOUT="'. $update_timeout .'"') ) +ARTICLES_PER_PAGE="5" +UPDATE_INTERVAL="3600" +UPDATE_TIMEOUT="30"') ) {die("Impossible d'écrire le fichier vvb.ini");} fclose($fp); {die('autoblog crée avec succès.afficher l\'autoblog');} @@ -256,7 +255,7 @@ else


-
+
'; echo $form; die; } @@ -269,25 +268,25 @@ $socialaccount = strtolower(escape($_POST['socialaccount'])); if(escape($_POST['socialinstance']) === 'identica') { $socialinstance = 'identica'; } if(escape($_POST['socialinstance']) === 'statusnet') { $socialinstance = 'statusnet'; } if(escape($_POST['socialinstance']) === 'shaarli') { $socialinstance = 'shaarli'; } - $folder = "$socialinstance-$socialaccount";if(file_exists($folder)) { die('Erreur: l\'autoblog existe déjà.'); } if($socialinstance === 'twitter') { $sitetype = 'microblog'; $update_interval='300'; $siteurl = "http://twitter.com/$socialaccount"; $rssurl = "http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=$socialaccount"; } if($socialinstance === 'identica') { $sitetype = 'microblog'; $update_interval='300'; $siteurl = "http://identi.ca/$socialaccount"; $rssurl = "http://identi.ca/api/statuses/user_timeline/$socialaccount.rss"; } if($socialinstance === 'statusnet' && !empty($_POST['statusneturl'])) { $sitetype = 'microblog'; $update_interval='300'; $siteurl = "http://".escape($_POST['statusneturl'])."/$socialaccount"; $rssurl = "http://".escape($_POST['statusneturl'])."/api/statuses/user_timeline/$socialaccount.rss"; } - if($socialinstance === 'shaarli' && !empty($_POST['shaarliurl'])) { $sitetype = 'shaarli'; $update_interval='1800'; $siteurl = "http://".escape($_POST['shaarliurl']); $rssurl = "http://".escape($_POST['shaarliurl'])."/index.php?do=rss"; } - $headers = get_headers($rssurl, 1); + if($socialinstance === 'shaarli' && !empty($_POST['shaarliurl'])) { $sitetype = 'shaarli'; $update_interval='1800'; $siteurl = "http://".escape($_POST['shaarliurl']); $rssurl = "http://".escape($_POST['shaarliurl'])."/index.php?do=rss";$socialaccount = get_title_from_feed($rssurl); } + $foldername = sha1(NoProtocolSiteURL($siteurl));if(file_exists($foldername)) { die('Erreur: l\'autoblog existe déjà.'); } + $rssurl=DetectRedirect($rssurl); $headers = get_headers($rssurl, 1); if (strpos($headers[0], '200') == FALSE) {$error[] = "Flux inaccessible (compte inexistant ?)";} else { } if( empty($error) ) { - if( !preg_match('#\.\.|/#', $folder) ) { - if ( mkdir('./'. $folder, 0755, false) ) { - $fp = fopen('./'. $folder .'/index.php', 'w+'); + if( !preg_match('#\.\.|/#', $foldername) ) { + if ( mkdir('./'. $foldername, 0755, false) ) { + $fp = fopen('./'. $foldername .'/index.php', 'w+'); if( !fwrite($fp, "") ) $error[] = "Impossible d'écrire le fichier index.php"; fclose($fp); - $fp = fopen('./'. $folder .'/vvb.ini', 'w+'); + $fp = fopen('./'. $foldername .'/vvb.ini', 'w+'); if( !fwrite($fp, '[VroumVroumBlogConfig] SITE_TYPE="'.$sitetype.'" SITE_TITLE="'.$socialinstance.'-'.$socialaccount.'" -SITE_DESCRIPTION="Automicroblog de @'.$socialaccount.'" +SITE_DESCRIPTION="source: '. $socialaccount .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" ARTICLES_PER_PAGE="20" @@ -295,7 +294,7 @@ UPDATE_INTERVAL="'.$update_interval.'" UPDATE_TIMEOUT="30"') ) $error[] = "Impossible d'écrire le fichier vvb.ini"; fclose($fp); - $error[] = 'AutoMicroblog ajouté avec succès.'; + $error[] = 'AutoMicroblog ajouté avec succès.'; } else $error[] = "Impossible de créer le répertoire."; @@ -329,14 +328,14 @@ if( !empty($_POST) && empty($_POST['socialinstance']) ) { if(file_exists($foldername) || file_exists($foldername2)) { die('Erreur: l\'autoblog existe déjà.'); } if ( mkdir('./'. $foldername, 0755, false) ) { $fp = fopen('./'. $foldername .'/index.php', 'w+'); - if( !fwrite($fp, "") ) + if( !fwrite($fp, "") ) $error[] = "Impossible d'écrire le fichier index.php"; fclose($fp); $fp = fopen('./'. $foldername .'/vvb.ini', 'w+'); if( !fwrite($fp, '[VroumVroumBlogConfig] SITE_TYPE="generic" SITE_TITLE="'. $sitename .'" -SITE_DESCRIPTION="Ce site n\'est pas le site officiel de '. $sitename .'
C\'est un blog automatisé qui réplique les articles de '. $sitename .'" +SITE_DESCRIPTION="source: '. $sitename .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" ARTICLES_PER_PAGE="5" diff --git a/_experimental/xsaf3.php b/_experimental/xsaf3.php index b3b0d20..4d6a240 100755 --- a/_experimental/xsaf3.php +++ b/_experimental/xsaf3.php @@ -70,7 +70,9 @@ function xsafimport($xsafremote, $max_exec_time) { else if($sitetype == 'microblog') { $articles_per_page = "20"; $update_interval = "300"; $update_timeout = "30"; } else { $articles_per_page = "5"; $update_interval = "3600"; $update_timeout = "30"; } - $foldername = $sitename;$foldername2 = $sitename; +// $foldername = $sitename;$foldername2 = $sitename; + $foldername = sha1(NoProtocolSiteURL($siteurl)); + if(substr($siteurl, -1) == '/'){ $foldername2 = sha1(NoProtocolSiteURL(substr($siteurl, 0, -1))); }else{ $foldername2 = sha1(NoProtocolSiteURL($siteurl).'/');} if(!file_exists($foldername) && !file_exists($foldername2)) { if ( mkdir('./'. $foldername, 0755, false) ) { @@ -106,7 +108,7 @@ function xsafimport($xsafremote, $max_exec_time) { if( !fwrite($fp, '[VroumVroumBlogConfig] SITE_TYPE="'. $sitetype .'" SITE_TITLE="'. $sitename .'" -SITE_DESCRIPTION="Ce site n\'est pas le site officiel de '. $sitename .'
C\'est un blog automatisé qui réplique les articles de '. $sitename .'" +SITE_DESCRIPTION="source: '. $sitename .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" ARTICLES_PER_PAGE="'. $articles_per_page .'"