Jump to content
synkron

Cumpar site/db

Recommended Posts

Posted (edited)

<?php

function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='UTF-8') {

$title = htmlentities($title,ENT_NOQUOTES,$encoding);

// $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);

$content = array(

'title'=>$title,

'description'=>$body,

'mt_allow_comments'=>0, // 1 to allow comments

'mt_allow_pings'=>0, // 1 to allow trackbacks

'post_type'=>'post',

'mt_keywords'=>$keywords,

'categories'=>array($category)

);

$params = array(0,$username,$password,$content,true);

$request = xmlrpc_encode_request('metaWeblog.newPost',$params);

$ch = curl_init();

curl_setopt($ch, CURLOPT_POSTFIELDS, $request);

curl_setopt($ch, CURLOPT_URL, $rpcurl);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_TIMEOUT, 1);

curl_setopt($ch, CURLOPT_VERBOSE, true); // Display communication with server

$results = curl_exec($ch);

curl_close($ch);

return $results;

}

function keephtml($string){

$res = htmlentities($string);

$res = str_replace("<","<",$res);

$res = str_replace(">",">",$res);

$res = str_replace(""",'"',$res);

$res = str_replace("&",'&',$res);

$res = str_replace("þ","t",$res);

$res = str_replace("º","s",$res);

$res = str_replace("à","a",$res);

$res = str_replace("á","a",$res);

$res = str_replace("â","a",$res);

$res = str_replace("ã","a",$res);

$res = str_replace("ä","a",$res);

$res = str_replace("å","a",$res);

$res = str_replace("æ","ae",$res);

$res = str_replace("ç","c",$res);

$res = str_replace("è","e",$res);

$res = str_replace("é","e",$res);

$res = str_replace("ê","e",$res);

$res = str_replace("ë","e",$res);

$res = str_replace("ð","ed",$res);

$res = str_replace("ì","i",$res);

$res = str_replace("í","i",$res);

$res = str_replace("î","i",$res);

$res = str_replace("ï","i",$res);

$res = str_replace("ñ","n",$res);

$res = str_replace("ò","o",$res);

$res = str_replace("ó","o",$res);

$res = str_replace("ô","o",$res);

$res = str_replace("õ","o",$res);

$res = str_replace("ö","o",$res);

$res = str_replace("ø","o",$res);

$res = str_replace("§","s",$res);

$res = str_replace("ù","u",$res);

$res = str_replace("ú","u",$res);

$res = str_replace("û","u",$res);

$res = str_replace("ü","u",$res);

$res = str_replace("ý","y",$res);

$res = str_replace("ÿ","y",$res);

$res = str_replace("À","A",$res);

$res = str_replace("Á","A",$res);

$res = str_replace("Â","A",$res);

$res = str_replace("Ã","A",$res);

$res = str_replace("Ä","A",$res);

$res = str_replace("Å","A",$res);

$res = str_replace("Æ","AE",$res);

$res = str_replace("Ç","C",$res);

$res = str_replace("È","E",$res);

$res = str_replace("É","E",$res);

$res = str_replace("Ê","E",$res);

$res = str_replace("Ë","E",$res);

$res = str_replace("€","EUR",$res);

$res = str_replace("Ð","ED",$res);

$res = str_replace("Ì","I",$res);

$res = str_replace("Í","I",$res);

$res = str_replace("Î","I",$res);

$res = str_replace("Ï","I",$res);

$res = str_replace("Ñ","N",$res);

$res = str_replace("Ò","O",$res);

$res = str_replace("Ó","O",$res);

$res = str_replace("Ô","O",$res);

$res = str_replace("Õ","O",$res);

$res = str_replace("Ö","O",$res);

$res = str_replace("Ø","O",$res);

$res = str_replace("§","S",$res);

$res = str_replace("Ù","U",$res);

$res = str_replace("Ú","U",$res);

$res = str_replace("Û","U",$res);

$res = str_replace("Ü","U",$res);

$res = str_replace("Ý","Y",$res);

$res = str_replace("Ÿ","Y",$res);

return $res;

}

function get_all_string_between($string, $start, $end)

{

$result = array();

$string = " ".$string;

$offset = 0;

while(true)

{

$ini = strpos($string,$start,$offset);

if ($ini == 0)

break;

$ini += strlen($start);

$len = strpos($string,$end,$ini) - $ini;

$result[] = substr($string,$ini,$len);

$offset = $ini+$len;

}

return $result;

}

for ($x=1; $x<=7660; $x++)

{

$homepage = file_get_contents('http://bancuri.haios.ro/listeaza_poza.php?lang=ro&id_joke='.$x.'&s=bancuri');

$title = get_all_string_between($homepage, '<title>', '</title>');

list($titlu) = $title;

if (stripos($titlu, "Bancuri") !== false) {

$result = get_all_string_between($homepage, '<h3><p>', '</p>');

list($banc) = $result;

$titlu = keephtml($titlu);

$banc = keephtml($banc);

$titlu = substr($titlu, 0, 70);

$rr = '/(.*)Bancuri/';

preg_match($rr,$titlu,$resu);

$titlu = $resu[1];

$rr1 = '/category=(.*?)\" title=\"(.*?)\">/s';

preg_match($rr1,$homepage,$resu1);

$cat = $resu1[2];

$tag = array($cat, 'Bancuri', 'Bancuri 2013', 'Bancuri 2014', 'Bancuri Bune', 'Bancuri Noi', 'Bancuri Online', 'Top Bancuri');

echo wpPostXMLRPC("Bancuri: ". $titlu, "</br>".keephtml($banc), "http://site-ultauwordpress/xmlrpc.php", "admin","parola", $cat, $tag);

sleep(4);

} else {

echo 'nui banc';

}

}

?>

Doar creaza categoriile astea :

Bancuri Criza Economica Financiara

Bancuri cu Alinuta

Bancuri cu Animale

Bancuri cu Arabi

Bancuri cu Ardeleni

Bancuri cu Avocati

Bancuri cu Barbati si Femei

Bancuri cu Batrani Persoane in varsta

Bancuri cu Betivi

Bancuri cu Blonde

Bancuri cu Bula

Bancuri cu Calculatoare PC Internet

Bancuri cu Canibali

Bancuri cu Copii

Bancuri cu Doctori Medici

Bancuri cu Elevi Scoala

Bancuri cu Evrei

Bancuri cu Gheorghe

Bancuri cu Homosexuali

Bancuri cu Ingineri

Bancuri cu Ion si Maria

Bancuri cu Militari Armata

Bancuri cu Moldoveni

Bancuri cu Mos Craciun

Bancuri cu Nationalitati

Bancuri cu Nebuni

Bancuri cu Negri

Bancuri cu Olteni

Bancuri cu Pescari

Bancuri cu Politicieni Politica

Bancuri cu Politisti Politie

Bancuri cu Prostii Deocheate

Bancuri cu Scotieni

Bancuri cu Soacre

Bancuri cu Soferi Masini Motociclete

Bancuri cu Sportivi Sport

Bancuri cu Tarani de la Tara

Bancuri cu Tigani Romi

Bancuri cu Unguri

Bancuri cu Vanatori

Bancuri cu Vedete si Celebritati

Bancuri de la Radio Erevan

Bancuri de la Serviciu

Bancuri despre Zodii

Bancuri din Baruri Restaurante

Bancuri Diverse

Bancuri Emo

Bancuri Feministe

Bancuri in Engleza

Bancuri Misogine

Bancuri Religioase, Biserica

Bancuri Sadice

Bancuri Scarboase

Bancuri Seci

Si ai 7k bancuri importate :)

P.S. - creez si scripturi de import la comanda cu poze si cu variabile yoast (bulina gabena + verde :)) )

Edited by Dubfx

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...