new file: 0.1/README.md

new file:   0.1/index.php
	new file:   0.1/vvb.ini
	new file:   0.2/README.md
	renamed:    autoblog.php -> 0.2/autoblog.php
	renamed:    automicroblog.php -> 0.2/automicroblog.php
	renamed:    config.php -> 0.2/config.php
	renamed:    _experimental/icon-logo.svg -> 0.2/icon-logo.svg
	renamed:    index.php -> 0.2/index.php
	renamed:    xsaf2.php -> 0.2/xsaf2.php
	new file:   0.3-beta/README.md
	renamed:    _experimental/autoblog-0.3.php -> 0.3-beta/autoblog.php
	renamed:    _experimental/config.php -> 0.3-beta/config.php
	renamed:    icon-logo.svg -> 0.3-beta/icon-logo.svg
	renamed:    _experimental/index.php -> 0.3-beta/index.php
	renamed:    _experimental/xsaf3.php -> 0.3-beta/xsaf3.php
	deleted:    README.md
	deleted:    _experimental/README.md
MAJOR reorga, ajout Projets Autoblog 0.1 et 0.2
This commit is contained in:
Mitsukarenai 2013-02-12 11:49:22 +01:00
parent 1c331eee52
commit c7d99f6402
18 changed files with 486 additions and 61 deletions

18
0.1/README.md Executable file
View File

@ -0,0 +1,18 @@
Projet Autoblog serie 0.1
==============
Auteur: Sebastien Sauvage
Licence: Domaine Public
- À propos du Projet Autoblog
lire: http://sebsauvage.net/streisand.me/fr/
- Contraintes techniques
voir: http://sebsauvage.net/streisand.me/fr/tech.html
- Instructions
Personnalisez vvb.ini. Envoyez index.php et vvb.ini sur votre site web, dans le répertoire de votre choix. Terminé !

403
0.1/index.php Executable file
View File

@ -0,0 +1,403 @@
<?php
/* VroumVroumBlog 0.1.32
This blog automatically publishes articles from an external RSS 2.0, RSS 1.0/RDF or ATOM feed.
For more information, see: http://sebsauvage.net/steisand.me/
This program is public domain. COPY COPY COPY !
*/
// ==================================================================================================
// Settings:
error_reporting(0); // Fail silentely.
if (!get_cfg_var('safe_mode')) { set_time_limit(240); } // More time to download (images, source feed)
date_default_timezone_set('Europe/Paris');
if (version_compare(PHP_VERSION, '5.2.0') >= 0) { libxml_disable_entity_loader(true); }
$CONFIG=parse_ini_file('vvb.ini') or die('Missing or bad config file vvb.ini'); // Read config file.
$CONFIG['ARTICLES_PER_PAGE']=10;
$CONFIG['DOWNLOAD_MEDIA_TYPES']=array('jpeg','jpg','gif','png','pdf','txt','odt'); // Media types which will be downloaded.
$CONFIG['MEDIA_TO_DOWNLOAD']=array(); // List of media to download in background.
// ==================================================================================================
/* Callback for the preg_replace_callback() function in remapImageUrls() which remaps URLs to point to local cache.
(src=... and href=...) */
function remap_callback($matches)
{
global $CONFIG;
$attr = $matches[1]; $url = $matches[2]; $srchost=parse_url($url,PHP_URL_HOST);
if (!mediaAuthorized($url)) { return $attr.'="'.$url.'"'; } // Not authorized: do not remap URL.
if (!file_exists('media/'.sanitize($url)) ) { $CONFIG['MEDIA_TO_DOWNLOAD'][] = $url; } // If media not present in the cache, add URL to list of media to download in background.
return $attr.'="?m='.$url.'"'; // Return remapped URL.
}
/* Remaps image URL to point to local cache (src= and href=)
eg. src="http://toto.com/..." --> src="?m=http://toto.com/..."
*/
function remapImageUrls($html)
{
return preg_replace_callback("@(src|href)=[\"\'](.+?)[\"\']@i",'remap_callback',$html);
}
/* updateFeed(): Update articles database from a RSS2.0 feed.
Articles deleted from the feed are not deleted from the database.
You can force the refresh by passing ?force_the_refresh in URL.
*/
function updateFeed()
{
global $CONFIG;
// Only update feed if last check was > 60 minutes
// but you can force it with force_the_refresh in GET parameters.
if (@filemtime('store')>time()-(3600) && !isset($_GET['force_the_refresh'])) { return; }
// Read database from disk
$feed_items=(file_exists('store') ? unserialize(file_get_contents('store')) : array() );
// Read the feed and update the database.
$xml = simplexml_load_file($CONFIG['FEED_URL']);
if (isset($xml->entry)) // ATOM feed.
{
foreach ($xml->entry as $item)
{
$pubDate=$item->published; if (!$pubDate) { $pubDate=$item->updated; }
$i=array('title'=>strval($item->title),'link'=>strval($item->link['href']),'guid'=>strval($item->id),'pubDate'=>strval($pubDate),
'description'=>'','content'=>remapImageUrls(strval($item->content)));
$i['dateiso'] = date('Ymd_His', strtotime($i['pubDate']));
$feed_items[$i['dateiso']] = $i;
}
}
elseif (isset($xml->item)) // RSS 1.0 /RDF
{
foreach ($xml->item as $item)
{
$guid =$item->attributes('http://www.w3.org/1999/02/22-rdf-syntax-ns#')->about;
$date =$item->children('http://purl.org/dc/elements/1.1/')->date;
$content = $item->children('http://purl.org/rss/1.0/modules/content/');
$i=array('title'=>strval($item->title),'link'=>strval($item->link),'guid'=>strval($guid),'pubDate'=>strval($date),
'description'=>strval($item->description),'content'=>remapImageUrls(strval($content)));
$i['dateiso'] = date('Ymd_His', strtotime($i['pubDate']));
$feed_items[$i['dateiso']] = $i;
}
}
elseif (isset($xml->channel->item)) // RSS 2.0
{
foreach ($xml->channel->item as $item)
{
$content = strval($item->children('http://purl.org/rss/1.0/modules/content/')); // Get <content:encoded>
if (!$content) { $content = strval($item->description); } // Some feeds put content in the description.
$pubDate = $item->pubDate;
if (!$pubDate) { $pubDate=$item->children('http://purl.org/dc/elements/1.1/')->date; } // To read the <dc:date> tag content.
$i=array('title'=>strval($item->title),'link'=>strval($item->link),'guid'=>strval($item->guid),'pubDate'=>strval($pubDate),
'description'=>strval($item->description),'content'=>remapImageUrls($content));
$i['dateiso'] = date('Ymd_His', strtotime($i['pubDate']));
$feed_items[$i['dateiso']] = $i;
}
}
krsort($feed_items); // Sort array, latest articles first.
file_put_contents('store', serialize($feed_items)); // Write database to disk
}
/* feed(): Returns the feed as an associative array (latest articles first).
Key is timestamp in compact iso format (eg. '20110628_073208')
Value is an associative array (title,link,content,pubDate...)
*/
function feed()
{
$data=file_get_contents('store');
if ($data===FALSE) { $feed_items=array(); } else { $feed_items = unserialize($data); }
return $feed_items;
}
/* Remove accents (é-->e) */
function replace_accents($str) {
$str = htmlentities($str, ENT_COMPAT, "UTF-8");
$str = preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde);/','$1',$str);
return html_entity_decode($str);
}
// Sanitize strings for use in filename or URLs
function sanitize($name)
{
$fname=replace_accents($name);
$replace="_";
$pattern="/([[:alnum:]_\.-]*)/"; // The autorized characters.
$fname=str_replace(str_split(preg_replace($pattern,$replace,$fname)),$replace,$fname);
return $fname;
}
// Tells if a string start with a substring or not.
function startsWith($haystack,$needle,$case=true) {
if($case){return (strcmp(substr($haystack, 0, strlen($needle)),$needle)===0);}
return (strcasecmp(substr($haystack, 0, strlen($needle)),$needle)===0);
}
// Tells if a string ends with a substring or not.
function endsWith($haystack,$needle,$case=true) {
if($case){return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);}
return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
}
/* Returns the CSS stylesheet to include in HTML document */
function css()
{
return <<<HTML
<style type="text/css">
<!--
body { font-family:"Trebuchet MS",Verdana,Arial,Helvetica,sans-serif; font-size:10pt; background-color: #3E4B50; }
img { max-width: 100%;height: auto; }
h1 { margin: 0 0 0 0; font-size:24pt; text-shadow: 2px 2px 2px #000; /* FF3.5+, Opera 9+, Saf1+, Chrome */ }
.pagetitle
{
padding: 10 30 10 30;
color:#eee;
margin-left:10%;
margin-right:10%;
border-bottom: 1px solid #aaa;
background-color: #6A6A6A;
background-image: -webkit-gradient(linear, left top, left bottom, from(#6A6A6A), to(#303030)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #6A6A6A, #303030); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #6A6A6A, #303030); /* FF3.6 */
background-image: -ms-linear-gradient(top, #6A6A6A, #303030); /* IE10 */
background-image: -o-linear-gradient(top, #6A6A6A, #303030); /* Opera 11.10+ */
background-image: linear-gradient(top, #6A6A6A, #303030);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#6A6A6A', EndColorStr='#303030'); /* IE6-IE9 */
}
.pagetitle a:link { color:#bbb; text-decoration:none;}
.pagetitle a:visited { color:#bbb; text-decoration:none;}
.pagetitle a:hover { color:#FFFFC9; text-decoration:none;}
.pagetitle a:active { color:#bbb; text-decoration:none;}
h2 { font-size:22pt; margin:0 0 0 0; color:#666; text-shadow: 1px 1px 1px #fff; /* FF3.5+, Opera 9+, Saf1+, Chrome */ }
h2 a:link { color:#666; text-decoration:none;}
h2 a:visited { color:#666; text-decoration:none;}
h2 a:hover { color:#403976; text-decoration:none;}
h2 a:active { color:#666; text-decoration:none;}
.datearticle { font-size: 8pt; color:#666; }
.pagination
{
margin-left:10%;
margin-right:10%;
padding: 5 10 5 10;
background-color: #6A6A6A;
background-image: -webkit-gradient(linear, left top, left bottom, from(#6A6A6A), to(#303030)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #6A6A6A, #303030); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #6A6A6A, #303030); /* FF3.6 */
background-image: -ms-linear-gradient(top, #6A6A6A, #303030); /* IE10 */
background-image: -o-linear-gradient(top, #6A6A6A, #303030); /* Opera 11.10+ */
background-image: linear-gradient(top, #6A6A6A, #303030);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#6A6A6A', EndColorStr='#303030'); /* IE6-IE9 */
}
.pagination a:link { color:#ccc; text-decoration:none;}
.pagination a:visited { color:#ccc; text-decoration:none;}
.pagination a:hover { color:#FFFFC9; text-decoration:none;}
.pagination a:active { color:#ccc; text-decoration:none;}
.anciens { float:left; }
.recents { float:right; }
.article
{
margin-left:10%;
margin-right:10%;
padding:10 15 10 15;
background-color: #cccccc;
background-image: -webkit-gradient(linear, left top, left bottom, from(#cccccc), to(#ffffff)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #cccccc, #ffffff); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #cccccc, #ffffff); /* FF3.6 */
background-image: -ms-linear-gradient(top, #cccccc, #ffffff); /* IE10 */
background-image: -o-linear-gradient(top, #cccccc, #ffffff); /* Opera 11.10+ */
background-image: linear-gradient(top, #cccccc, #ffffff);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#cccccc', EndColorStr='#ffffff'); /* IE6-IE9 */
border-bottom: 1px solid #888;
}
.search { float:right; }
.search input { border:1px solid black; color:#666; }
.powered { width:100%; text-align:center; font-size:8pt; color:#aaaaaa; }
.powered a:link { color:#cccccc; text-decoration:none;}
.powered a:visited { color:#cccccc; text-decoration:none;}
.powered a:hover { color:#FFFFC9; text-decoration:none;}
.powered a:active { color:#aaaaaa; text-decoration:none;}
.sourcelink a { color:#666; text-decoration:none; }
.sourcelink a:hover { color:#403976; text-decoration:none; }
@media handheld
{
html, body { font: 12px sans-serif; background: #fff; padding: 3px; color: #000; margin: 0; }
img { max-width: 100%;height: auto; }
.pagetitle { padding: 7 7 7 7; margin-left:0; margin-right:0; }
.article { background-color: #eee; margin-left:0; margin-right:0; border-bottom: 3px solid #888; }
.pagination { margin-left:0; margin-right:0;}
h1 { font-size:16pt; margin-bottom:10px;}
h2 { font-size:14pt; line-height:120%; }
ul { padding-left:10px; }
blockquote{margin-left:12px; margin-right:3px; }
pre { width:100%; overflow:auto; }
}
-->
</style>
HTML;
}
/* Render a single article
$article : the article itself (associative array with title,pubDate,content,dateiso keys.)
*/
function renderArticle($article)
{
echo '<div class="article">';
echo '<div class="articletitle"><h2><a href="?'.$article['dateiso'].'_'.sanitize($article['title']).'">'.$article['title'].'</a></h2><div class="datearticle">'.$article['pubDate'];
if ($article['link']!='') { echo ' - <span class="sourcelink">(<a href="'.$article['link'].'">source</a>)</span>'; }
echo '</div></div><div class="articlecontent">'.$article['content'].'</div>';
echo '<br style="clear:both;"></div>';
}
function rssHeaderLink() { return '<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="?feed">'; }
function searchForm() { return '<div class="search"><form method="GET"><input type="text" name="s"><input type="submit" value="search"></form></div>'; }
function powered() { return '<div class="powered">Powered by <a href="http://sebsauvage.net/streisand.me/">VroumVroumBlog</a> 0.1.32 - <a href="?feed">RSS Feed</a><br>Download <a href="vvb.ini">config</a> <a href="store">articles</a></div>'; }
function canonical_metatag($url) { return '<link rel="canonical" href="'.$url.'" />'; }
/* Show a single article
$articleid = article identifier (eg.'20110629_010334')
*/
function showArticle($articleid)
{
global $CONFIG;
header('Content-Type: text/html; charset=utf-8');
$feed=feed();if (!array_key_exists($articleid,$feed)) { die('Article not found.'); }
$a=$feed[$articleid];
echo '<html><head><title>'.$a['title'].' - '.$CONFIG['SITE_TITLE'].'</title>'.canonical_metatag($a['link']).css().rssHeaderLink().'</head><body>';
echo '<div class="pagetitle"><h1>'.$CONFIG['SITE_TITLE'].'</h1>'.$CONFIG['SITE_DESCRIPTION'].searchForm().'</div>';
renderArticle($a);
echo '<div class="pagination"><table width="100%"><tr><td><a href="?page1">See all articles</a></td></tr></table></div>'.powered().'</body></html>';
}
/* Show a list of articles, starting at a specific page.
$page = start page. First page is page 1.
*/
function showArticles($page)
{
global $CONFIG;
header('Content-Type: text/html; charset=utf-8');
$feed=feed();
$keys=array_keys($feed);
echo '<html><head><title>'.$CONFIG['SITE_TITLE'].'</title>'.canonical_metatag($CONFIG['SITE_URL']).css().rssHeaderLink().'</head><body>';
echo '<div class="pagetitle"><h1>'.$CONFIG['SITE_TITLE'].'</h1>'.$CONFIG['SITE_DESCRIPTION'].searchForm().'</div>';
$i = ($page-1)*$CONFIG['ARTICLES_PER_PAGE']; // Start index.
$end = $i+$CONFIG['ARTICLES_PER_PAGE'];
while ($i<$end && $i<count($keys))
{
renderArticle($feed[$keys[$i]]);
$i++;
}
echo '<div class="pagination"><table width="100%"><tr><td>';
if ($i!=count($keys)) { echo '<div class="anciens"><a href="?page'.($page+1).'">&lt; Older</a></div>'; }
echo '</td><td>';
if ($page>1) { echo '<div class="recents"><a href="?page'.($page-1).'">Newer &gt;</a></div>'; }
echo '</td></tr></table></div>'.powered().'</body></html>';
}
/* Search for text in articles content and title.
$textpage = text to search.
*/
function search($text)
{
global $CONFIG;
header('Content-Type: text/html; charset=utf-8');
$txt = urldecode($text);
echo '<html><head><title>'.$CONFIG['SITE_TITLE'].'</title>'.css().rssHeaderLink().'</head><body>';
echo '<div class="pagetitle"><h1>'.$CONFIG['SITE_TITLE'].'</h1>'.$CONFIG['SITE_DESCRIPTION'].searchForm().'</div>';
echo '<div class="pagetitle">Search for <span style="font-weight:bold;color:#FFFFC9;">'.htmlspecialchars($txt).'</span> :</div>';
$feed=feed();
foreach($feed as $article)
{
if (stripos($article['content'],$txt) || stripos($article['title'],$txt)) { renderArticle($article); }
}
echo '<div class="pagination"><table width="100%"><tr><td><a href="?page1">See all articles</a></td></tr></table></div>'.powered().'</body></html>';
}
/* Tells if a media URL should be downloaded or not.
Input: $url = absolute URL of a media (jpeg,pdf...)
Output: true= can download. false= should not download (wrong host, wrong file extension) */
function mediaAuthorized($url)
{
global $CONFIG;
$goodhost=false; $srchost=parse_url($url,PHP_URL_HOST);
foreach( explode(',',$CONFIG['DOWNLOAD_MEDIA_FROM']) as $host) // Does the URL point to an authorized host ?
{ if ($srchost==$host) { $goodhost=true; } }
if (!$goodhost) { return false; } // Wrong host.
$ext = pathinfo($url, PATHINFO_EXTENSION); // Get file extension (eg.'png','gif'...)
if (!in_array(strtolower($ext),$CONFIG['DOWNLOAD_MEDIA_TYPES'])) { return false; } // Not in authorized file extensions.
return true;
}
// Returns the MIME type corresponding to a file extension.
// (I do not trust mime_content_type() because of some dodgy hosting providers with ill-configured magic.mime file.)
function mime_type($filename)
{
$MIME_TYPES=array('.jpg'=>'image/jpeg','.jpeg'=>'image/jpeg','.png'=>'image/png','.gif'=>'image/gif',
'.txt'=>'text/plain','.odt'=>'application/vnd.oasis.opendocument.text');
foreach($MIME_TYPES as $extension=>$mime_type) { if (endswith($filename,$extension,false)) { return $mime_type; } }
return 'application/octet-stream'; // For an unkown extension.
}
// Returns a media from the local cache (and download it if not available).
function showMedia($imgurl)
{
if (!mediaAuthorized($imgurl)) { header('HTTP/1.1 404 Not Found'); return; }
downloadMedia($imgurl); // Will only download if necessary.
$filename = 'media/'.sanitize($imgurl);
header('Content-Type: '.mime_type($filename));
readfile($filename);
}
// Download a media to local cache (if necessary)
function downloadMedia($imgurl)
{
$filename = 'media/'.sanitize($imgurl);
if (!file_exists($filename) ) // Only download image if not present
{
if (!is_dir('media')) { mkdir('media',0705); file_put_contents('media/index.html',' '); }
file_put_contents($filename, file_get_contents($imgurl,NULL, NULL, 0, 4000000)); // We download at most 4 Mb from source.
}
}
/* Output the whole feed in RSS 2.0 format with article content (BIG!) */
function outputFeed()
{
global $CONFIG;
header('Content-Type: application/xhtml+xml; charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">';
echo '<channel><title>'.htmlspecialchars($CONFIG['SITE_TITLE']).'</title><link>'.htmlspecialchars($CONFIG['SITE_URL']).'</link>';
echo '<description></description><language></language><copyright>'.htmlspecialchars($CONFIG['SITE_URL']).'</copyright>'."\n\n";
$feed=feed();
foreach($feed as $a)
{
echo '<item><title>'.$a['title'].'</title><guid>'.$a['guid'].'</guid><link>http://'.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"].'?'.$a['dateiso'].'_'.sanitize($a['title']).'</link><pubDate>'.$a['pubDate'].'</pubDate>';
echo '<description><![CDATA['.$a['description'].']]></description><content:encoded><![CDATA['.$a['content'].']]></content:encoded></item>'."\n\n";
}
echo '</channel></rss>';
}
// ==================================================================================================
// Update feed if necessary. (you can force refresh with ?force_the_refresh in URL)
updateFeed();
// Handle media download requests (eg. http://myserver.com/?m=http___anotherserver.net_images_myimage.jpg)
if (startswith($_SERVER["QUERY_STRING"],'m=')) { showMedia(substr($_SERVER["QUERY_STRING"],2)); }
// Handle single article URI (eg. http://myserver.com/?20110506_224455-chit-chat)
elseif (preg_match('/^(\d{8}_\d{6})/',$_SERVER["QUERY_STRING"],$matches)) { showArticle($matches[1]); }
// Handle page URI (eg. http://myserver.com/?page5)
elseif (preg_match('/^page(\d+)/',$_SERVER["QUERY_STRING"],$matches)) { showArticles($matches[1]); }
// Handle RSS 2.0 feed request (http://myserver.com/?feed)
elseif (startswith($_SERVER["QUERY_STRING"],'feed')) { outputFeed(); }
// Handle search request (eg. http://myserver.com/?s=tuto4pc)
elseif (startswith($_SERVER["QUERY_STRING"],'s=')) { search(substr($_SERVER["QUERY_STRING"],2)); }
// Nothing ? Then render page1.
else { showArticles(1); }
// Force flush, rendered page is fully sent to browser.
ob_end_flush();
flush();
// Now we've finised rendering the page and sending to the user,
// it's time for some background tasks: Are there media to download ?
foreach($CONFIG['MEDIA_TO_DOWNLOAD'] as $url) { downloadMedia($url); }
exit;
?>

6
0.1/vvb.ini Normal file
View File

@ -0,0 +1,6 @@
[VroumVroumBlogConfig]
SITE_TITLE="Autoblog de Sebsauvage"
SITE_DESCRIPTION="Ce site n'est pas le site officiel de Sebsauvage<br>C'est un blog automatis&eacute; qui r&eacute;plique les articles de <a href="http://sebsauvage.net/rhaa/">sebsauvage.net</a>"
SITE_URL=http://sebsauvage.net/rhaa/
FEED_URL=http://sebsauvage.net/rhaa/rss_fulltext.php
DOWNLOAD_MEDIA_FROM=sebsauvage.net

22
0.2/README.md Executable file
View File

@ -0,0 +1,22 @@
Projet Autoblog serie 0.2
==============
Auteurs: BohwaZ (VVB) & Arthur Hoaro, Mitsukarenai, Oros (index ferme d'autoblogs)
Licence: Domaine Public
- À propos du Projet Autoblog
lire: http://sebsauvage.net/streisand.me/fr/
- Présentation et Instructions pour VVB 0.2 (par BohwaZ)
voir: http://blogs.kd2.org/bohwaz/?2011/07/14/369-auto-blog-vroumvroumblog-et-effet-streisand
- Présentation et Instructions pour la ferme d'autoblogs (par Arthur Hoaro)
voir: http://wiki.hoa.ro/doku.php?id=web%3Aferme-autoblog
- Améliorations pour la ferme d'autoblogs et XSAF (par Mitsukarenai et Oros)
voir: https://www.suumitsu.eu/2012/08/autoblogs-petites-ameliorations/

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

18
0.3-beta/README.md Executable file
View File

@ -0,0 +1,18 @@
Projet Autoblog serie 0.3
==============
PHASE BETA ! "git pullez" souvent, et merci pour vos rapports de bugs.
Auteurs: Mitsu (https://www.suumitsu.eu/) & Oros (https://www.ecirtam.net/)
Licence: Domaine Public
- À propos du Projet Autoblog
lire: http://sebsauvage.net/streisand.me/fr/
Instructions
- uploader les fichiers sur un serveur avec PHP 5.3+
- ..c'est tout. Hackez le code pour apprendre comment ça marche et comment le personnaliser :)

View File

@ -3,11 +3,6 @@
VroumVroumBlog 0.3.0
This blog automatically publishes articles from an external RSS 2.0 or ATOM feed.
Installation:
- copy this script (index.php) to a directory on your webserver.
- optionnaly copy the database ('articles.db'). Otherwise, it will be created automatically.
- tweak setting in vvb.ini
Requirement for the source RSS feed:
- Source feed MUST be a valid RSS 2.0, RDF 1.0 or ATOM 1.0 feed.
- Source feed MUST be valid UTF-8
@ -802,7 +797,7 @@ else
echo '
<div class="footer">
<p>Powered by <a href="https://github.com/mitsukarenai/ferme-autoblog">VroumVroumBlog '.$vvbversion.'</a> - <a href="?feed">'.__('RSS Feed').'</a></p>
<p>Propulsé par <a href="https://github.com/mitsukarenai/Projet-Autoblog">Projet Autoblog '.$vvbversion.'</a> - <a href="?feed">'.__('RSS Feed').'</a></p>
<p>'.__('Download:').' <a href="'.LOCAL_URL.basename(CONFIG_FILE).'">'.__('configuration').'</a>
- <a href="'.LOCAL_URL.basename(ARTICLES_DB_FILE).'">'.__('articles').'</a><p/>
<p><a href="'.LOCAL_URL.'?media">'.__('Media export').' <sup> JSON</sup></a></p>

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,7 +1,19 @@
<?php
/*
Projet Autoblog 0.3-beta
Code: https://github.com/mitsukarenai/Projet-Autoblog
Authors: Mitsu https://www.suumitsu.eu/ & Oros https://www.ecirtam.net/
License: Public Domain
/* modtime 2013-02-08 */
Instructions:
(by default, autoblog creation is allowed: you can set this to "FALSE" in config.php)
(by default, Cross-Site Autoblog Farming [XSAF] imports a few autoblogs from https://github.com/mitsukarenai/xsaf-bootstrap/blob/master/3.json you can uncomment and add xsafimports in xsaf3.php (jump at end of file) )
(by default, database and media transfer via XSAF is allowed)
- upload all files on your server (PHP 5.3+ required)
- PROFIT !
*/
define('XSAF_VERSION', 3);
define('ROOT_DIR', __DIR__);
@ -217,7 +229,7 @@ if(!empty($_GET['via_button']) && !empty($_GET['rssurl']) && $_GET['number'] ===
if(file_exists($foldername) || file_exists($foldername2)) { die('Erreur: l\'autoblog <a target="_blank" href="./'.$foldername.'/">existe déjà</a>.'); }
if ( mkdir('./'. $foldername, 0755, false) ) {
$fp = fopen('./'. $foldername .'/index.php', 'w+');
if( !fwrite($fp, "<?php require_once dirname(__DIR__) . '/autoblog-0.3.php'; ?>") )
if( !fwrite($fp, "<?php require_once dirname(__DIR__) . '/autoblog.php'; ?>") )
{die("Impossible d'écrire le fichier index.php");}
fclose($fp);
$fp = fopen('./'. $foldername .'/vvb.ini', 'w+');
@ -279,7 +291,7 @@ if( empty($error) ) {
if( !preg_match('#\.\.|/#', $foldername) ) {
if ( mkdir('./'. $foldername, 0755, false) ) {
$fp = fopen('./'. $foldername .'/index.php', 'w+');
if( !fwrite($fp, "<?php require_once dirname(__DIR__).'/autoblog-0.3.php'; ?>") )
if( !fwrite($fp, "<?php require_once dirname(__DIR__).'/autoblog.php'; ?>") )
$error[] = "Impossible d'écrire le fichier index.php";
fclose($fp);
$fp = fopen('./'. $foldername .'/vvb.ini', 'w+');
@ -328,7 +340,7 @@ if( !empty($_POST) && empty($_POST['socialinstance']) && $allow_new_autoblogs =
if(file_exists($foldername) || file_exists($foldername2)) { die('Erreur: l\'autoblog <a href="./'.$foldername.'/">existe déjà</a>.'); }
if ( mkdir('./'. $foldername, 0755, false) ) {
$fp = fopen('./'. $foldername .'/index.php', 'w+');
if( !fwrite($fp, "<?php require_once dirname(__DIR__) . '/autoblog-0.3.php'; ?>") )
if( !fwrite($fp, "<?php require_once dirname(__DIR__) . '/autoblog.php'; ?>") )
$error[] = "Impossible d'écrire le fichier index.php";
fclose($fp);
$fp = fopen('./'. $foldername .'/vvb.ini', 'w+');
@ -479,7 +491,7 @@ if(!empty($autoblogs)){
<div class="clear"></div>
<?php echo "<br/>".count($autoblogs)." autoblogs hébergés"; ?>
</div>
Propulsé par <a href="https://github.com/mitsukarenai/ferme-autoblog">Ferme d'Autoblogs 0.3.0</a> de Mitsu et Oros (Domaine Public)
Propulsé par <a href="https://github.com/mitsukarenai/Projet-Autoblog">Projet Autoblog 0.3</a> de Mitsu et Oros (Domaine Public)
<?php if(isset($HTML_footer)){ echo "<br/>".$HTML_footer; } ?>
<iframe width="1" height="1" style="display:none" src="xsaf3.php"></iframe>
</body>

View File

@ -1,9 +1,8 @@
<?php
/* modtime 2013-02-04 */
define('DEBUG', true);
define('XSAF_VERSION', 3);
define('AUTOBLOG_FILE_NAME', 'autoblog-0.3.php');
define('AUTOBLOG_FILE_NAME', 'autoblog.php');
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 */

View File

@ -1,43 +0,0 @@
ferme-autoblog
==============
Création, gestion et échange d'autoblogs.
ToDo list: https://www.ecirtam.net/zerobin/?cf6b82ad5427691f#3q0hO9TaJ8BCB/d7Iibjd2NMgpHaR95ONQrg8oKhHIY=
[ À propos du Projet Autoblog ]
lire: http://sebsauvage.net/streisand.me/fr/
[ À propos de VroumVroumBlog 1.x (par Sebsauvage) ]
voir: http://sebsauvage.net/streisand.me/fr/tech.html
[ À propos de VroumVroumBlog 2.x (par BohwaZ) ]
voir: http://blogs.kd2.org/bohwaz/?2011/07/14/369-auto-blog-vroumvroumblog-et-effet-streisand
[ À propos de la ferme d'autoblogs (par Arthur Hoaro) ]
voir: http://wiki.hoa.ro/doku.php?id=web%3Aferme-autoblog
----------
Ce code s'axe autour des codes cités ci-dessus. Nom de code: Ferme d'autoblog, index2.
Instances de développement:
https://autoblog.suumitsu.eu/
https://www.ecirtam.net/autoblogs/
Ferme d'autoblog a pour objectif de faciliter et ergonomiser l'ajout d'autoblogs, grâce à des fonctions d'extraction d'infos à partir de flux, de contrôle et de validation, d'adaptations pour les réseaux sociaux Twitter, Identica et les StatusNet personnels, l'ajout via clic sur un bouton de la barre d'outils du navigateur, ainsi que l'échange entre fermes des informations des autoblogs pour une dissémination virale.
Ferme d'autoblog est développé par Mitsu (aka Mitsukarenai) et Oros, mis à disposition dans le domaine public.
Aucun chaton n'est maltraité durant le développement.

View File

@ -1,5 +0,0 @@
EXPERIMENTAL !!
================
- Don't run this, or kittens will die !
- Ne pas utiliser sinon des chatons vont morfler !