//http://www.articlesbase.com/resumes-articles/765
// Orizo tis selides
for ($i=0; $i<=51; $i++) {
$linkforparcing[$i] ='http://www.articlesbase.com/resumes-articles/'.($i*15+1+0);
}
$ppages = count($linkforparcing);

///====================================== Diorthosh Articles ======================================
function cleandescription($string){
// Diorthosh description
$quotes = array(""", """, "&rdquo", "“", "‘", "’", "»", "«", "›", "‹", "“", "„", "‘", "‚");
$string = str_replace($quotes, '', $string);
$string = ereg_replace("[^[:space:]a-zA-Z0-9*_.-<>=”‘?!:]”, “”, $string);
$string = str_replace(‘”

‘, ”, $string);
$onclick = array(‘onClick=”javascript:pageTracker._trackPageview’, “‘/outgoing/article_exit_link’”, ‘;” ‘);
$string = str_replace($onclick, ”, $string);
$string = str_replace(“target=_blank>”, ”, $string);
$string = str_replace(“</a>”, ‘ ‘, $string);
$string = str_replace(‘/”gt;’, ”, $string);
$string = str_replace(‘

‘, ‘

‘, $string);
$string = str_replace(‘

‘, ”, $string);
$string = str_replace(‘

‘, ”, $string);
$string = str_replace(‘

‘, ”, $string);
$string = str_replace(‘

‘, ”, $string);
$spaces = array(‘ ‘, ‘ ‘, ‘ ‘, ‘ ‘);
$string = str_replace($spaces, ‘ ‘, $string);
$string = trim($string);
return $string;
}

function cleantitle($string){
// Diorthosh title
$quotes = array(“"”, “"”, “&rdquo”, ““”, “‘”, “’”, “»”, “«”, “›”, “‹”, ““”, “„”, “‘”, “‚”);
$string = str_replace($quotes, ”, $string);
$string = ereg_replace(“[^[:space:]a-zA-Z0-9.?!:-]”, “”, $string);
$spaces = array(‘ ‘, ‘ ‘, ‘ ‘, ‘ ‘);
$string = str_replace($spaces, ‘ ‘, $string);
$string = trim($string);
$string = ucwords($string);
return $string;
}

//====================================== Ean iparxei proxy ======================================
$proxycontent=0;
if ($proxycontent==1){
$proxy_name = ’172.20.60.10′;
$proxy_port = 3128;
}

//====================================== Parcing parapano apo mia selides ======================================
for ($j=0; $j<=($ppages-1); $j++) {

$stringlink = '^

$telos = $telos - $arxh;
$link[$i] = "http://www.articlesbase.com".substr($existpage[$i], $arxh, $telos);
//echo $link[$i];
}

//================================== Arpagma keimenon =======================================================
$count = 0;
for ($i=0; $i<=($items-1); $i++) {
$textbegin = 0;
$textend = 0;
$authorbegin = 0;
$authorend = 0;

// Ean iparxei proxy -----------------------------------------------------------
if ($proxycontent==1){
$proxy_fp = fsockopen($proxy_name, $proxy_port);
if (!$proxy_fp) {return false;}
fputs($proxy_fp, "GET $link[$i] HTTP/1.0rnHost: $proxy_namernrn");
while(!feof($proxy_fp)) {
$buffer = fgets($proxy_fp, 4096000);

//Description
if ($textbegin==1 && $textend==0 ){
if (eregi('