Hallo,
ich würde gerne auf eBay Kleinanzeigen automatisiert Anzeigen aufgeben. Da es dafür scheinbar keine API gibt, habe ich es nun mal via cURL versucht.
Normalerweise klappt eine Anmeldung via GET/POST. In diesem Fall allerdings nicht. Ich werde immer sofort raus geworfen. Weis hier jemand bescheid, warum das so ist?
PHP-Code:
$data = json_encode(array(
"targetUrl" => "",
"loginMail" => "ebay@xxx.de",
"password" => "13xxx"
));
$data2 = array(
"targetUrl" => "",
"loginMail" => "ebay@xxx.de",
"password" => "13xxx"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.ebay-kleinanzeigen.de/m-einloggen.html");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6');
curl_setopt($ch, CURLOPT_REFERER, 'https://www.ebay-kleinanzeigen.de/m-einloggen.html');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_PORT , 443);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "/var/www/test/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "/var/www/test/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$tuData = curl_exec($ch);