The Script connect to Your mailbox (mailboxes), get and processed the Craigslist emails.
There are 3 kinds of emails:
1. Submission Confirmation
Subject: Your Craigslist Posting <title of ad submission>
From: noreply@craigslist.org
In this case, script parse out the following details and store in database:
Posting ID#
Date/Time Stamp
URL direct to ad
Primary City (part of the url ie. Chicago.Craigslist.org, primary city would be Chicago)
Sub-City if any (in the url after the domain there will be a category code and if any sub-city location for the larger cities.
For example chicago.craigslist.org/fur/8484848488448.html would not have a subcity, but would have a category of FUR
For example newyork.craigslist.org/man/fur/88585858585.html would have a subcity of MAN and a category of FUR
Status (upon adding this ad to the database the status would be NEW
Title of ad
Email address sent TO: Alot of these ads are forwarded through into a catch all account.
The final account it's mailed to should be logged.
2. Manual Confirmation Email
Subject: POST/EDIT/DELETE
From: noreply@craigslist.org
Same as above, however, the link in the email needs to be browsed, and on the following webpage there will be a button {publish}.
If the ad is not published yet, it should be published by the project.
Which means following the link in the email to the website, and submitting the publish button.
In addition, parse out the same fields as the confirmation email and store in database:
Posting ID#
Date/Time Stamp
URL direct to ad
Primary City
Sub-City
Status (upon adding this ad to the database the status
Title of ad
Email address sent TO:
3. FLAGGED AD Email
Subject: Flagged and removed
Located the posting Ad Number, and change status in database to FLAGGED
Those are the three types of emails that will be processed from the pop3 accounts.
Other Cron job processes:
A separate process started to be established to go through each ad in the database, and go to the url city/category page,
and submit the search form for the posting ID. If the results includes the specific ad, the status should be confirmed to be LIVE.
If its not there, and the status is new and the original posting time is UNDER 30 minutes, leave the status at NEW.
If the posting time is over 30 minutes ago, change status to PostGhost.
If the status was live, and now the ad doesn't exist, the status should be Ghosted.
Only run the update process on ads with a LIVE or NEW status.
Newer ads should be checked more frequently than older ads.
For example, ads that were posted less than 30 minutes ago should be checked every 5 minutes.
Ads under 3 hours every 15 minutes, ads under 3 hours every 30 minutes.
Ads under 24 hours every hour.
Over 24 hours, update daily.
Ads displayed in the monitor screen should be color coded.
Default to Live=green, Flagged=Red, New=Yellow, PostGhost=Orange/yellow, Ghosted=Orange.
This is perfect tool for manage Your mass graigslist ads.
|