|
Caligula
|
 |
« on: May 13, 2007, 07:10:22 PM » |
|
Not to long ago... Bompa commented something along the lines of " if you can post to google you can post anywhere" ..... So.... I have made that my first goal in learning the art of link spamming.... hehe..... nevertheless... its not going so good.. I guess the real question is, is google harder to post to than some bullshit guestbook..or am I going in the wrong direction with my code.... $key = urlencode(keyword);
$ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.google.com"); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "safe=off&q=$key&start=0&num=10&sa=N"); $result=curl_exec ($ch); curl_close ($ch);
echo $result;
I have tried the POSTFIELDS statement 100 different ways and all I get is a "Not Implemented" message... which according to google means they cannot recognize the request. What am I doing wrong?
|
|
|
|
|
Logged
|
|
|
|
|
cdc
|
 |
« Reply #1 on: May 13, 2007, 11:40:02 PM » |
|
Hmm...it looks ok at face value.
Have you tried removing the POST_FIELDS line and just loading google.com? This will let you know if curl is working properly on your server.
|
|
|
|
|
Logged
|
Will code for food.
|
|
|
|
nop_90
|
 |
« Reply #2 on: May 14, 2007, 12:54:02 AM » |
|
stupid question, but isn't G a get ? not a post ?
|
|
|
|
|
Logged
|
|
|
|
|
Bompa
|
 |
« Reply #3 on: May 14, 2007, 03:24:36 AM » |
|
stupid question, but isn't G a get ? not a post ?
Come to think of it, maybe it is. Not sure what I was thinking when I said post to Google. Here is from Google's search page: <form action="/search" name=f> There is no 'method', so isn't the default POST? Maybe their backend will accept either? Shit, I dunno. That'lll teach yah to listen to me Cal. Bompa
|
|
|
|
|
Logged
|
"Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted." -- Albert Einstein
|
|
|
|
Bompa
|
 |
« Reply #4 on: May 14, 2007, 03:28:16 AM » |
|
Cal, You would need to post to the url in their form, (Google's or whoever). Google's is /search so try www.google.com/search in your code
|
|
|
|
|
Logged
|
"Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted." -- Albert Einstein
|
|
|
|
cdc
|
 |
« Reply #5 on: May 14, 2007, 04:06:59 AM » |
|
Good catch, Bomps.
Caligula, if you're going to start submitting forms I highly recommend downloading the HTTP Headers toolbar for firefox. It will tell you the URL you need to post to and all the fields it expects.
|
|
|
|
|
Logged
|
Will code for food.
|
|
|
|
Caligula
|
 |
« Reply #6 on: May 14, 2007, 06:24:04 PM » |
|
Something tells me you all just jumped into guest books, forums and all... without ever trying the google thing....lol ok... well.... apparently.. cURL sends a GET request by default... enabling POSTFIELDS tells it to post... but if left out.... you get..GET... get it? This works.. $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.google.com/search?safe=off&q=keyword&start=0&num=10&sa=N"); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch); echo $result;
- That LiveHTTPHeaders thing for fire fox kicks ass by the way... 
|
|
|
|
|
Logged
|
|
|
|
|
m0nkeymafia
|
 |
« Reply #7 on: May 15, 2007, 01:15:33 AM » |
|
I always use FireBug too It can tell you request and response headers for current and previous connections.
It also gives you load times for each connection so you can tell if a particular ajax call takes too long. Bleedin rocks!
|
|
|
|
|
Logged
|
I am Tyler Durden
|
|
|
|
Bompa
|
 |
« Reply #8 on: May 15, 2007, 04:07:13 AM » |
|
Something tells me you all just jumped into guest books, forums and all... without ever trying the google thing....lol ok... well.... apparently.. cURL sends a GET request by default... enabling POSTFIELDS tells it to post... but if left out.... you get..GET... get it? This works.. $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.google.com/search?safe=off&q=keyword&start=0&num=10&sa=N"); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch); echo $result;
- That LiveHTTPHeaders thing for fire fox kicks ass by the way...  Woohooo! Glad you got it working. Now you can post anywhere  sorta.  Where you have echo $result in your code, does that actually display Google's source html? You will need that ability. Some sites have a session ID or other parameter on their page that must be included in the POST fields, they do this to prevent those spammy ppl from just posting without visiting the page first.  later, Bompa
|
|
|
|
|
Logged
|
"Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted." -- Albert Einstein
|
|
|
|
Caligula
|
 |
« Reply #9 on: May 15, 2007, 02:46:21 PM » |
|
Something tells me you all just jumped into guest books, forums and all... without ever trying the google thing....lol ok... well.... apparently.. cURL sends a GET request by default... enabling POSTFIELDS tells it to post... but if left out.... you get..GET... get it? This works.. $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.google.com/search?safe=off&q=keyword&start=0&num=10&sa=N"); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch); echo $result;
- That LiveHTTPHeaders thing for fire fox kicks ass by the way...  Woohooo! Glad you got it working. Now you can post anywhere  sorta.  Where you have echo $result in your code, does that actually display Google's source html? You will need that ability. Some sites have a session ID or other parameter on their page that must be included in the POST fields, they do this to prevent those spammy ppl from just posting without visiting the page first.  later, Bompa Thanks Bompa  The echo in the code returns the result page for whatever search term you put in - just as if you were doing a reg G search....only its through the script so its my domain not G's and none of the images show..hehe..... is that what you mean? I know its pretty much a useless script at this point... but at least I am a little closer to understanding how to post with cURL.... especially since info about this is kinda vague... Now I have to find and install some shit GB script so I can figure out exactly how to post to it.... since I really don't want to practice on someone elses site... lol
|
|
|
|
|
Logged
|
|
|
|
|
nop_90
|
 |
« Reply #10 on: May 16, 2007, 01:43:24 AM » |
|
Now I have to find and install some shit GB script so I can figure out exactly how to post to it.... since I really don't want to practice on someone elses site... lol
People like you make me sick 
|
|
|
|
|
Logged
|
|
|
|
|
perkiset
|
 |
« Reply #11 on: May 16, 2007, 10:14:29 AM » |
|
No that's just your flu Nop. You'll get over it. Take two cookies, idle your processor and call us in 86,400,000ms.
/p
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
Bompa
|
 |
« Reply #12 on: May 16, 2007, 07:08:39 PM » |
|
Now I have to find and install some shit GB script so I can figure out exactly how to post to it.... since I really don't want to practice on someone elses site... lol
People like you make me sick  
|
|
|
|
|
Logged
|
"Everything that can be counted does not necessarily count; everything that counts cannot necessarily be counted." -- Albert Einstein
|
|
|
|
Caligula
|
 |
« Reply #13 on: May 16, 2007, 07:10:20 PM » |
|
Now I have to find and install some shit GB script so I can figure out exactly how to post to it.... since I really don't want to practice on someone elses site... lol
People like you make me sick  I....I....I don't know what I've done to offend you... but I can say that whatever it was, I am truly deeply sorry... please forgive Me....
|
|
|
|
|
Logged
|
|
|
|
|
perkiset
|
 |
« Reply #14 on: May 16, 2007, 09:42:38 PM » |
|
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|