Posté automatiquement une annonce sur leboncoin via curl

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : Posté automatiquement une annonce sur leboncoin via curl

activer mail le bon coin

par Gilliocq » 21 janv. 2012, 16:53

Bonjour,

Je suis en train de chercher un faire un script pour poster automatiquement une annonce sur le site du bon coin . fr
J'ai commencé un script mais ca ne marche pas. Je pense qu'il le manque pas grand chose. Pourriez vous m'aider?
D'avance merci,
<?php

$fp = fopen("cookies.txt",'wb');
fclose($fp);

$useragent = "Mozilla/5.0";

$url = "http://www2.leboncoin.fr/ai/preview/1";
$ch = curl_init($url);
//curl_setopt($ch , CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch , CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
$referer = $url;
$postfields = array();
$postfields["check_type_diff"] = "0";
$postfields["region"] = "18";
$postfields["dpt_code"] = "49";
$postfields["zipcode"] = "49230";
$postfields["category"] = "2";
$postfields["company_ad"] = "1";
$postfields["type"] = "s";
$postfields["name"] = "aaa";
$postfields["email"] = "[email protected]";
$postfields["phone"] = "0240121652";
$postfields["phone_hidden"] = "1";
$postfields["subject"] = "Vends Renault Laguna Bleu Break";
$postfields["body"] = "Je vends ma Renault Laguna Break couleur noir. Elle a 76000km. ";
$postfields["price"] = "12000";
//$postfields["image"] = "C:\!\funpics\60440.jpg";
//postfields["image"] = "@60440.jpg";
$postfields["image"] = "";
$postfields["siren"] = "732829320";
$postfields["fuel"] = "2";
$postfields["regdate"] = "2007";
$postfields["mileage"] = "76000";
$postfields["gearbox"] = "2";

$postfields["validate"] = "Valider";

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$result = curl_exec($ch);
curl_close($ch);



$url = "http://www2.leboncoin.fr/ai/confirm/3";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
$referer = $url;
$postfields = array();
$postfields["passwd"] = "wqazsx";
$postfields["passwd_ver"] = "wqazsx";
$postfields["create"] = "Valider";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$result = curl_exec($ch);
curl_close($ch);
echo $result;

?>

Re: Posté automatiquement une annonce sur leboncoin via curl

par asiaze » 05 déc. 2011, 01:33

Bonjour et je suppose qu'il faut payer bien sûr :)

Re: Posté automatiquement une annonce sur leboncoin via curl

par Web33 » 02 déc. 2011, 00:00

J'ai développé une solution à base de VB pour ce faire.
Pour les intéressés => MP :)

Re: Posté automatiquement une annonce sur leboncoin via curl

par eniot666 » 08 sept. 2011, 17:01

Bonjour,

Je cherche a faire la meme chose que toi... :D Es-ce que par hazard tu partagerai ton code final ?

Merci par avance.

Eniot

Re: Posté automatiquement une annonce sur leboncoin via curl

par Invité » 28 juil. 2010, 11:47

Bonjour,

pourquoi as tu mis check_type_diff à 0 ?
Dans le formulaire la valeur est 1 en hidden

Re: Posté automatiquement une annonce sur leboncoin via curl

par touriste57 » 28 juil. 2010, 11:14

Bonjour,
Je vois que vous n'avez pas plus d'idée que moi.
Tant pis. Je continue de chercher et si je trouve la solution je la posterais.

Si vous avez une idée merci de votre aide

Did

Posté automatiquement une annonce sur leboncoin via curl

par touriste57 » 27 juil. 2010, 15:59

Bonjour,

Je suis en train de chercher un faire un script pour poster automatiquement une annonce sur le site du bon coin . fr
J'ai commencé un script mais ca ne marche pas. Je pense qu'il le manque pas grand chose. Pourriez vous m'aider?
D'avance merci,
<?php

$fp = fopen("cookies.txt",'wb');
fclose($fp);

$useragent = "Mozilla/5.0";

$url = "http://www2.leboncoin.fr/ai/preview/1";
$ch = curl_init($url);
//curl_setopt($ch , CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch , CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
$referer = $url;
$postfields = array();
$postfields["check_type_diff"] = "0";
$postfields["region"] = "18";
$postfields["dpt_code"] = "49";
$postfields["zipcode"] = "49230";
$postfields["category"] = "2";
$postfields["company_ad"] = "1";
$postfields["type"] = "s";
$postfields["name"] = "aaa";
$postfields["email"] = "[email protected]";
$postfields["phone"] = "0240121652";
$postfields["phone_hidden"] = "1";
$postfields["subject"] = "Vends Renault Laguna Bleu Break";
$postfields["body"] = "Je vends ma Renault Laguna Break couleur noir. Elle a 76000km. ";
$postfields["price"] = "12000";
//$postfields["image"] = "C:\!\funpics\60440.jpg";
//postfields["image"] = "@60440.jpg";
$postfields["image"] = "";
$postfields["siren"] = "732829320";
$postfields["fuel"] = "2";
$postfields["regdate"] = "2007";
$postfields["mileage"] = "76000";
$postfields["gearbox"] = "2";

$postfields["validate"] = "Valider";

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$result = curl_exec($ch);
curl_close($ch);



$url = "http://www2.leboncoin.fr/ai/confirm/3";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
$referer = $url;
$postfields = array();
$postfields["passwd"] = "wqazsx";
$postfields["passwd_ver"] = "wqazsx";
$postfields["create"] = "Valider";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$result = curl_exec($ch);
curl_close($ch);
echo $result;

?>