Craigslist Automated Posting API? [closed]
Asked Answered
I

4

26

i was looking through craigslist bulk posting section and it requires an rss feed to be sent to a server to automatically post an add the site is found at

http://www.craigslist.org/about/bulk_posting_interface

i have looked up and down for a sample of a php class but cannot find out. anyone know of any class that exists? thanks

Interlaken answered 3/9, 2010 at 7:37 Comment(0)
A
12

I just checked the CL's terms of use and it explicitly mentions any automated posting to be illegal. So, if it is a generic commercial idea you wish to scale up, note that:

It is expressly prohibited to post content to craigslist using any automated means. Users must post all content personally and manually through all steps of the posting process. It is also expressly prohibited for any user to develop, offer, market, sell, distribute or provide an automated means to perform any step of the posting process (in whole or in part). Any user who develops, offers, markets, sells, distributes or provides an automated means to perform any step of the posting process (in whole or in part) shall be responsible and liable to CL for each instance of access to craigslist (by any user or other third party) using that automated means.

Amaliaamalie answered 15/7, 2012 at 16:2 Comment(2)
How can craigslist provide a detailed bulk posting interface, complete with a guide and examples, and then deem automated means to be "illegal"? It would be impossible to use this interface without automated means. They directly contradict themselves.Leverage
@Leverage unless it's a giant honeypot...Gibraltar
M
8

I have searched around for this for you, and have found the same results - At this time, there does not appear to be any existing, freely-available PHP classes to handle Craigslist Bulk Uploads.

I have also found that others, searching for the same, have resorted to posting jobs on freelancing boards like Freelancer.com to engage developers to create one for them.

Looks like you will have to write this code yourself, or pay someone to do it for you. Sorry.

APPENDUM:

Referring to the Craigslist Bulk Posting Interface help page, there is an example Perl script included at the end of the page, along with examples of the XML/RSS formats required for bulk-posting.

The simplest way to achieve what you want would be to have a PHP script create the RSS/XML File(s) and then trigger the Perl Script to perform the Upload and record the results into a second file (or straight back to the script).

Mur answered 3/9, 2010 at 11:32 Comment(0)
J
8

I found an example of a PHP script for CL bulk postings. Not sure if you're still looking for a PHP wrapper for this or not.

Here's the code I found from this open-reality.org thread: Source: http://support.open-realty.org/showthread.php?23764-Bulk-posting-in-Craigslist

<?php
class cURL {

    var $headers;
    var $user_agent;

    function cURL()
    {
        $this->headers[] = 'Connection: Keep-Alive';
        $this->headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
        $this->user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)';
    }



    function post($url,$data) {
        $process = curl_init($url);
        curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers);
        curl_setopt($process, CURLOPT_HEADER, 1);
        curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent);
        curl_setopt($process, CURLOPT_TIMEOUT, 30);
        curl_setopt($process, CURLOPT_POSTFIELDS, $data);
        curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($process, CURLOPT_POST, 1);
        $return = curl_exec($process);
        $info = curl_getinfo($process);
        curl_close($process);
        return $info;
    }

}

$postdata = "
<?xml version=\"1.0\" encoding=\"utf-8\"?>\n

<rdf:RDF xmlns=\"http://purl.org/rss/1.0/\"
         xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
         xmlns:cl=\"http://www.craigslist.org/about/cl-bulk-ns/1.0\">

  <channel>
    <items>
      <rdf:li rdf:resource=\"NYCBrokerHousingSample1\"/>
      <rdf:li rdf:resource=\"NYCBrokerHousingSample2\"/>
    </items>

    <cl:auth username=\"****\"
             password=\"****\"

  </channel>
  <item rdf:about=\"NYCBrokerHousingSample1\">
    <cl:category>apa</cl:category>
    <cl:area>chi</cl:area>
    <cl:subarea>chc</cl:subarea>
    <cl:neighborhood>Lakeview</cl:neighborhood>
    <cl:housingInfo price=\"1450\"
                    bedrooms=\"0\"
                    sqft=\"600\"/>
    <cl:replyEmail privacy=\"C\">[email protected]</cl:replyEmail>
    <cl:brokerInfo companyName=\"Joe Sample and Associates\"
                   feeDisclosure=\"fee disclosure here\" />
    <title>Spacious Sunny Studio in Upper West Side</title>
    <description><![CDATA[
      posting body here
    ]]></description>
  </item>



</rdf:RDF>
"; 

$cc = new cURL();
$url = 'https://post.craigslist.org/bulk-rss/post';
$output = $cc->post($url,$postdata); 

//echo $output;

print_r($output); 
Jandy answered 28/6, 2011 at 4:9 Comment(2)
Not sure how that code block got so funky but hopefully you can still make sense of it.Jandy
it wont work without account_id which i personaly couldn't find it anywhere!Lizarraga
W
0

Keep in mind, the API is closed for new accounts as of now. I'm not sure when they are planning on opening it again, if ever.

However, there is a site that does exactly this, and they claim it is legal. www.repost123.com So I am not sure what Craigslist means when they say that any kind of automated posting is illegal.

Webbing answered 18/8, 2011 at 21:50 Comment(3)
Craigslist does not define what is "legal" and "illegal." They can have a Terms of Use. If you violate that, they can try to penalize you somehow. But in terms of legality, nah.Brumby
how do you know it's closed? how do I know whether it works for new accounts now?Yuletide
I think its open now. You can try to sign up and buy some blocks here craigslist.org/about/help/paid_posting_accounts, you can also try to use their API craigslist.org/about/bulk_posting_interface. But I think you should avoid the API unless its a paid posting, and use a bot to populate their forms with your data.Webbing

© 2022 - 2024 — McMap. All rights reserved.