Is it possible to post to Craigslist through my own site?

What I'm trying to do is let users post to Craiglist through my own site using PHP curl. This is NOT an automatic posting system, I just want users to be able to post to Craigslist and to my site at the same time. So far I have managed to log in using php, but I'm still not sure how to post the title, description, contact information, etc. I am not familiar with cURL.

I am working with a script found through Google:

<?php

// INIT CURL
$ch = curl_init();

// SET URL FOR THE POST FORM LOGIN
curl_setopt($ch, CURLOPT_URL, 'https://accounts.craigslist.org/');

// ENABLE HTTP POST
$email = "email";
$pass = "pass";
$url = "inputEmailHandle=".urlencode($email)."&inputPassword=".urlencode($pass);

curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $url);

$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
curl_setopt($ch, CURLOPT_USERAGENT, $agent);

ob_start(); 
curl_exec ($ch);
ob_end_clean(); // execute the curl command 

curl_close ($ch);
unset($ch);

//initialize second curl
$ch = curl_init();
//second curl
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_COOKIEFILE, "cookies.txt"); 
curl_setopt($ch, CURLOPT_URL, 'http://sandiego.craigslist.org/sub/');
$content = curl_exec ($ch);


echo $content;
// CLOSE CURL
curl_close ($ch);

?> 
+3
source share
1 answer

I don't know if this is possible (maybe it is), but it is against Craigslist TOS, so be careful.

  • POSITIVE AGENTS

" " , , . Craigslist, Posting Agent . , , , Craigslist.

+5

All Articles