Craigslist 自动发帖 API?

发布于 2024-09-16 19:34:09 字数 255 浏览 7 评论 0原文

我正在查看 craigslist 批量发布部分,它需要将 RSS 提要发送到服务器以自动发布添加,该网站位于

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

我已经上下查找了 php 类的示例,但找不到。有人知道存在什么类吗?谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

绿萝 2024-09-23 19:34:10

我刚刚检查了 CL 的使用条款,它明确提到任何自动发布都是非法的。因此,如果您希望扩大这是一个通用的商业想法,请注意:

明确禁止使用任何自动化方式将内容发布到 craigslist。用户必须通过发布过程的所有步骤亲自手动发布所有内容。还明确禁止任何用户开发、提供、营销、销售、分发或提供自动方式来执行发布过程的任何步骤(全部或部分)。任何开发、提供、营销、出售、分发或提供自动方式执行发布过程任何步骤(全部或部分)的用户应对 CL 的每次访问实例(由任何用户或其他第三方)使用该自动化方式。

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.

诠释孤独 2024-09-23 19:34:10

我已经为您搜索了这一点,并发现了相同的结果 - 目前,似乎没有任何现有的、免费可用的 PHP 类来处理 Craigslist 批量上传。

我还发现其他人在寻找相同的内容时,已经在自由职业板上发布工作,例如 Freelancer.com 吸引开发人员为他们创建一个。

看起来你必须自己编写这段代码,或者花钱请人帮你写。对不起。

附录:

参考Craigslist批量发帖接口帮助页面,有页面末尾包含 Perl 脚本示例,以及批量发布所需的 XML/RSS 格式示例。

实现您想要的最简单的方法是让 PHP 脚本创建 RSS/XML 文件,然后触发 Perl 脚本执行上传并将结果记录到第二个文件中(或直接返回脚本) 。

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).

自控 2024-09-23 19:34:10

我找到了一个用于 CL 批量发帖的 PHP 脚本示例。不确定您是否仍在为此寻找 PHP 包装器。

这是我从 open-reality.org 线程中找到的代码:
来源:http://support.open-realty.org /showthread.php?23764-在 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); 

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); 
寄与心 2024-09-23 19:34:10

请记住,API 目前已对新帐户关闭。我不确定他们什么时候计划再次开放(如果有的话)。

然而,有一个网站正是这样做的,并且他们声称这是合法的。 www.repost123.com 所以我不确定 Craigslist 说任何类型的自动发帖都是非法的是什么意思。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文