Author Topic: PHP script for flagging craigslist  (Read 6085 times)

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
PHP script for flagging craigslist
« on: May 24, 2010, 09:43:23 AM »
One of our competitors is being rediculous in spreading false ads about us. I want to make a scriipt that i can input an ad id or url and it will use proxies to flag this ad from various ip addresses. The script, ideally, would have a wait time in between each flag to avoid being obvious.

How hard would this be? Or does anyone know of one that is out there already?
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: PHP script for flagging craigslist
« Reply #1 on: May 24, 2010, 10:29:21 AM »
Don't think it'd be that hard.  Get a list of proxies and the URL scheme they use.  The CL URL for spam seems to be: http://CITY.craigslist.org/flag/?flagCode=15&postingID=####

Then just run a loop over the list of proxies using fget to make the request to each proxy then sleep some amount of it.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #2 on: May 24, 2010, 10:58:39 AM »
Don't think it'd be that hard.  Get a list of proxies and the URL scheme they use.  The CL URL for spam seems to be: http://CITY.craigslist.org/flag/?flagCode=15&postingID=####

Then just run a loop over the list of proxies using fget to make the request to each proxy then sleep some amount of it.

Thanks for the start man, i hope to play with this today
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #3 on: May 25, 2010, 02:16:46 PM »
I gotta get around to trying this. Theres a lot of them out there, but shockingly nothing useful on any of the torrent websites. As popular as CL is that amazes me.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #4 on: May 25, 2010, 04:11:07 PM »
i have been searching my ass off, but im not sure i am using the right wording. How can i submit the actual url, through the proxy? Heres the list i use normally for proxy ip's...

http://www.samair.ru/proxy/ip-address-01.htm
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #5 on: May 25, 2010, 05:00:51 PM »
edit:

removed code, bunch of it was f'd up
« Last Edit: May 25, 2010, 10:16:50 PM by RoD »
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #6 on: May 25, 2010, 10:29:43 PM »
How can i break up the input url? Basically the url entered is that of the ad to flag. There are many unknown variable like city, section, ad id, etc. I want to take it in like this.....

http://grandrapids.craigslist.org/cps/1759785487.html

save "http://grandrapids.craigslist.org/cps/" and "1759785487"

then add

"flag/?flagCode=" $flagtypevariable "&postingID=" $theidnumber

i know i have to do this with str_replace, but not sure how since the url will always be different coming in

EDIT

thought this would work, but i get no output so i know im wrong.....

Code: [Select]
//convert ad url to flag url based on input
$host = parse_url($target, PHP_URL_HOST);
$path = parse_url($target, PHP_URL_PATH);
$query = parse_url($target, PHP_URL_QUERY);
$fragment = parse_url($target, PHP_URL_FRAGMENT);

print_r ($host);
print_r ($path);
print_r ($query);
print_r ($fragment);
« Last Edit: May 26, 2010, 12:52:50 AM by RoD »
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: PHP script for flagging craigslist
« Reply #7 on: May 26, 2010, 12:10:42 PM »
does the url always end with the id number.html?

if so,
Code: [Select]
<?php
$url 
"grandrapids.craigslist.org/cps/1759785487.html";
$url_parts_array explode("/",$url);
$last_part array_pop($url_parts_array);

echo 
$last_part// returns "1759785487.html"
?>

"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #8 on: May 26, 2010, 12:44:44 PM »
Yes it always ends that way. The problem is that i have to explode it out this way:

http://
grandrapids.craigslist.org/
cps/
1759785487

That way i can save each part of the url to a variable, and modify them to the flagging url

hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: PHP script for flagging craigslist
« Reply #9 on: May 26, 2010, 02:02:15 PM »
in the code snippet I just wrote, before using the array_pop() function, call

print_r($url_parts_array);

and notice that those parts are all nicely stripped out for you :)


array_pop(), just grabs the last value of the array, which is why I suggested it because I thought that was the only value you needed.
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: PHP script for flagging craigslist
« Reply #10 on: May 26, 2010, 02:51:10 PM »
or array_(_._)
                  .
                  .

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: PHP script for flagging craigslist
« Reply #11 on: May 26, 2010, 03:48:27 PM »
or array_(_._)
                  .
                  .

w....t....f....

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: PHP script for flagging craigslist
« Reply #12 on: May 26, 2010, 04:09:58 PM »
i think its supposed to be an ass taking a shit.

Thnx micah :)
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: PHP script for flagging craigslist
« Reply #13 on: May 26, 2010, 06:03:56 PM »
 :devil: