Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-22-2008, 08:55 PM   #1
Mr Pheer
Retired
 
Industry Role:
Join Date: Dec 2002
Posts: 20,956
need a PHP script coded

should be simple

take a list of URLs I provide, check each one of them for a 404 response. If it gets that response, tell me which URL did it.

There are hundreds to check

paypal is ready to go
Mr Pheer is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 08:58 PM   #2
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
show me your penis please
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:20 PM   #3
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
I already did it for you, please send $100 via paypal
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:24 PM   #4
Mr Pheer
Retired
 
Industry Role:
Join Date: Dec 2002
Posts: 20,956
Quote:
Originally Posted by harvey View Post
I already did it for you, please send $100 via paypal
Its not checking for 404's on my sites, its on another site.

thats also not PHP

Last edited by Mr Pheer; 05-22-2008 at 09:26 PM..
Mr Pheer is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:32 PM   #5
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
Quote:
Originally Posted by Mr Pheer View Post
Its not checking for 404's on my sites, its on another site.

thats also not PHP
Xenu checks broken links in your site or off your site, no matter what. Not sure if I get what you mean. but you're right, is not PHP (although it's 10 times better than any php script out there and it's free). Anyway, if it's not what you need, there's nothing to discuss, however, a "thanx" or "thanx, but not what I was looking for" would have been enough
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:35 PM   #6
Steve Awesome
Confirmed User
 
Steve Awesome's Avatar
 
Industry Role:
Join Date: Jan 2007
Location: Mid-West!
Posts: 1,575
Didn't Xenu throw the Thetans into a volcano? That bastard!
Steve Awesome is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:38 PM   #7
Sly
Let's do some business!
 
Sly's Avatar
 
Industry Role:
Join Date: Sep 2004
Location: Austin, TX
Posts: 31,323
Quote:
Originally Posted by harvey View Post
Xenu checks broken links in your site or off your site, no matter what. Not sure if I get what you mean. but you're right, is not PHP (although it's 10 times better than any php script out there and it's free). Anyway, if it's not what you need, there's nothing to discuss, however, a "thanx" or "thanx, but not what I was looking for" would have been enough

He wants the program to feed in a list of addresses. Go to each address and see if the site/file exists. Create and output list of addresses that return a 404.
__________________
Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted

Windows VPS now available
Great for TSS, Nifty Stats, remote work, virtual assistants, etc.
Click here for more details.
Sly is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:50 PM   #8
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
PHP Code:
<?php
if($_POST['submit'] == true)
{
    
$exp_url explode("\n"$_POST['url']);
    foreach(
$exp_url as $url)
    {
        
$response http_get($url, array("timeout" => 1), $info);
        if(
$info['response_code'] == "404")
        {
            echo 
"<b>404</b>&nbsp;" $url "<br />\n";
        }
    }
}else{
?>
<form method="post">
  <div align="center"><strong>Urls:</strong><br>
      <textarea name="url" id="url" cols="45" rows="5"></textarea>
    <br>  
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
}
?>
don't have paypal, but if you got epass, i'll take a some, [email protected]
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 09:53 PM   #9
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
oh, i forgot you need the php_http extension installed on your server.
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:12 PM   #10
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
This is kind of simple. Do you just want it to report 404s? How do you want to 'feed' it?
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:15 PM   #11
ztik
Confirmed User
 
ztik's Avatar
 
Industry Role:
Join Date: Aug 2001
Location: Nomad
Posts: 5,196
script in my sig does that!
__________________
.
ztik is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:17 PM   #12
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Jaysin View Post
oh, i forgot you need the php_http extension installed on your server.
cURL is almost always safe to assume these days.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:17 PM   #13
Zoose
Confirmed User
 
Join Date: Aug 2006
Posts: 268
Here's a version that uses curl:

Quote:
<?php

$list_of_urls = file( "urls.txt" );

while( list( $key, $value ) = each( $list_of_urls ) ){

$curl_handle = curl_init();

curl_setopt( $curl_handle, CURLOPT_URL, $list_of_urls[$key] );
curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );

$response = curl_exec( $curl_handle );
$response_code = curl_getinfo( $curl_handle, CURLINFO_HTTP_CODE );

if( $response_code == '404' ){

echo $list_of_urls[$key]." appears to be 404<br>";

}

}

?>
Make a urls.txt file and put one url per line.
Zoose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:29 PM   #14
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085


This one's stupid, but it uses the common class.curl.php, and does a select based upon the error, so you can add different features/functions for 403s, 500s, etc.. Mostly, I'm just lazy and didn't figure it deserved OOP, even if I'm using an OOP class. Enjoy.

Code:
<html>
<head>
<Title>404 Test Thingy or whatever</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<br>
<form method="post">
  <div align="center"><strong>Test URLs:</strong><br>
      <textarea name="urls" id="urls" cols="45" rows="5"><?=isset($_REQUEST['urls'])?$_REQUEST['urls']:"";?></textarea>
    <br>
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
// This is hardly an example of good PHP.  Ugh.
@require_once("class.curl.php");
// trim() to get rid of errant enter keys.
$myurls = (isset($_REQUEST['urls'])?explode("\n", trim($_REQUEST['urls'])): array());
foreach ($myurls as $url) {
  // use our cURL class.
  $curlInit = new curl($url);
  // Make sure we don't follow redirects.
  $curlInit->setopt(CURLOPT_FOLLOWLOCATION, FALSE) ;
  // Do it.
  $curlInit->exec();
  // If we returned a connection error, say so.
  if ($myError = $curlInit->hasError()) {
    echo "ERR: $url ($myError)<br>\n";
  } else {
    // Reinit our array
    $status = array();
    // Seems to have worked, parse it.
    if (is_array($curlInit->m_status))
      $status = $curlInit->m_status;
    // Simple error checking.
    if (!empty($status)) {
      switch($status["http_code"]) {
        case "404":
           echo "<font color='red'>404</font>: <a href='$url' target='_new'>[link]</a> $url<br>\n";
           break;
        default:
           // Do nothing if not 404, I guess.
           break;
      }
    }
  }
  // We're done, close the socket.
  $curlInit->close();
} ?>
</body>
</html>
__________________

Last edited by GrouchyAdmin; 05-22-2008 at 10:31 PM.. Reason: rooka rike dis
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:35 PM   #15
Zoose
Confirmed User
 
Join Date: Aug 2006
Posts: 268
rofl

Quote:
404 Test Thingy or whatever
Nicely done though for hacking it together in 5 mins. :p
Zoose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:38 PM   #16
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Zoose View Post
Nicely done though for hacking it together in 5 mins. :p
I dunno if I'd give it ratings that high. There's gonna be someone who needs urldecode, someone with a bizarre gpg setting, and.. oh god fuck PHP.

At least I can rely on trusty ol' cURL to almost always be there. fopen urls and http_get don't usually worked no more on crummy virtualhosts, but cURL? Most of the time. I almost turned headers on and NOBODY to use a HEAD to parse with less overhead, but the class is oddly lacking in the ability to handle that.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 10:55 PM   #17
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
I dunno if I'd give it ratings that high. There's gonna be someone who needs urldecode, someone with a bizarre gpg setting, and.. oh god fuck PHP.

At least I can rely on trusty ol' cURL to almost always be there. fopen urls and http_get don't usually worked no more on crummy virtualhosts, but cURL? Most of the time. I almost turned headers on and NOBODY to use a HEAD to parse with less overhead, but the class is oddly lacking in the ability to handle that.
I give you 2/5, mainly because I see you're lacking eval() calls.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:00 PM   #18
pr0
rockin tha trailerpark
 
pr0's Avatar
 
Industry Role:
Join Date: May 2001
Location: ~Coastal~
Posts: 23,088
how about the same script that looks for txt on the index, instead of a response code

like the text "this site does not exist"

how would ya do that in curl/php? That might be even more fool proof for him. Sometimes servers return bad codes even if the site isn't bad. This would foolproof it.
pr0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:05 PM   #19
Mr Pheer
Retired
 
Industry Role:
Join Date: Dec 2002
Posts: 20,956
Quote:
Originally Posted by pr0 View Post
how about the same script that looks for txt on the index, instead of a response code

like the text "this site does not exist"

how would ya do that in curl/php? That might be even more fool proof for him. Sometimes servers return bad codes even if the site isn't bad. This would foolproof it.
that was kind of exactly what I was looking for

Hillsborough on ICQ made exactly what I needed, not sure what his name is on GFY
Mr Pheer is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:05 PM   #20
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by pr0 View Post
how about the same script that looks for txt on the index, instead of a response code

like the text "this site does not exist"

how would ya do that in curl/php? That might be even more fool proof for him. Sometimes servers return bad codes even if the site isn't bad. This would foolproof it.
True, but that's not as common as you think. Many times people just use a customized 404.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:07 PM   #21
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
I give you 2/5, mainly because I see you're lacking eval() calls.
bich i cut u

Code:
<html>
<head>
<Title>404 Test Thingy from hell</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<br>
<form method="post">
  <div align="center"><strong>Test URLs:</strong><br>
      <textarea name="urls" id="urls" cols="45" rows="5"><?=isset($_REQUEST['urls'])?$_REQUEST['urls']:"";?></textarea>
    <br>
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
// BE SAFE: WRAP YOUR CRAP!
if (!function_exists('findCurlCli')) {
  function findCurlCli() {
    $curlClis=array(
                  '/usr/bin/curl', '/usr/local/bin/curl',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  '/usr/bin/curlcli', '/usr/local/bin/curlcli',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  // FOR SOME REASON THIS DOESNT WORK!!!!!
                  // '/usr/bin/wget', '/usr/local/bin/wget'
                  );

    foreach ($curlClis as $curlcli) {
      if (@is_file("$curlcli") && is_executable("$curlcli")) {
          return("$curlcli");
          break;
      } else {
         return FALSE;
      }
    }
  }
}
// lol
if ($foundCurl = findCurlCli()) {
  $myurls = (isset($_REQUEST['urls'])?explode("\n", trim($_REQUEST['urls'])): array());
  foreach ($myurls as $url) {
    // escapeshellcmd is for pussies and communists.
    $data = system("$foundCurl -I $url | grep -v '404'");
      if ($data = "1") {
        echo "<font color='red'>404</font>: <a href='$url' target='_new'>[link]</a> $url<br>\n";
      }
    }
  }
}
?>
</body>
</html>
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:08 PM   #22
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
True, but that's not as common as you think. Many times people just use a customized 404.
One of these days, WordPress, shitty management tools, and RoR will support standard error codes.


That's in 2038, of course.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:37 PM   #23
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
One of these days, WordPress, shitty management tools, and RoR will support standard error codes. That's in 2038, of course.
and some day JESUS WILL SAVE YOU. ZING!
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:38 PM   #24
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
bich i cut u

Code:
<html>
<head>
<Title>404 Test Thingy from hell</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<br>
<form method="post">
  <div align="center"><strong>Test URLs:</strong><br>
      <textarea name="urls" id="urls" cols="45" rows="5"><?=isset($_REQUEST['urls'])?$_REQUEST['urls']:"";?></textarea>
    <br>
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
// BE SAFE: WRAP YOUR CRAP!
if (!function_exists('findCurlCli')) {
  function findCurlCli() {
    $curlClis=array(
                  '/usr/bin/curl', '/usr/local/bin/curl',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  '/usr/bin/curlcli', '/usr/local/bin/curlcli',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  // FOR SOME REASON THIS DOESNT WORK!!!!!
                  // '/usr/bin/wget', '/usr/local/bin/wget'
                  );

    foreach ($curlClis as $curlcli) {
      if (@is_file("$curlcli") && is_executable("$curlcli")) {
          return("$curlcli");
          break;
      } else {
         return FALSE;
      }
    }
  }
}
// lol
if ($foundCurl = findCurlCli()) {
  $myurls = (isset($_REQUEST['urls'])?explode("\n", trim($_REQUEST['urls'])): array());
  foreach ($myurls as $url) {
    // escapeshellcmd is for pussies and communists.
    $data = system("$foundCurl -I $url | grep -v '404'");
      if ($data = "1") {
        echo "<font color='red'>404</font>: <a href='$url' target='_new'>[link]</a> $url<br>\n";
      }
    }
  }
}
?>
</body>
</html>
I now give you 4/5 -- only because you have now mixed view with logic.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:40 PM   #25
pr0
rockin tha trailerpark
 
pr0's Avatar
 
Industry Role:
Join Date: May 2001
Location: ~Coastal~
Posts: 23,088
Quote:
Originally Posted by GrouchyAdmin View Post
bich i cut u

Code:
<html>
<head>
<Title>404 Test Thingy from hell</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<br>
<form method="post">
  <div align="center"><strong>Test URLs:</strong><br>
      <textarea name="urls" id="urls" cols="45" rows="5"><?=isset($_REQUEST['urls'])?$_REQUEST['urls']:"";?></textarea>
    <br>
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
// BE SAFE: WRAP YOUR CRAP!
if (!function_exists('findCurlCli')) {
  function findCurlCli() {
    $curlClis=array(
                  '/usr/bin/curl', '/usr/local/bin/curl',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  '/usr/bin/curlcli', '/usr/local/bin/curlcli',
                  '/usr/bin/curl-cli', '/usr/local/bin/curl-cli',
                  // FOR SOME REASON THIS DOESNT WORK!!!!!
                  // '/usr/bin/wget', '/usr/local/bin/wget'
                  );

    foreach ($curlClis as $curlcli) {
      if (@is_file("$curlcli") && is_executable("$curlcli")) {
          return("$curlcli");
          break;
      } else {
         return FALSE;
      }
    }
  }
}
// lol
if ($foundCurl = findCurlCli()) {
  $myurls = (isset($_REQUEST['urls'])?explode("\n", trim($_REQUEST['urls'])): array());
  foreach ($myurls as $url) {
    // escapeshellcmd is for pussies and communists.
    $data = system("$foundCurl -I $url | grep -v '404'");
      if ($data = "1") {
        echo "<font color='red'>404</font>: <a href='$url' target='_new'>[link]</a> $url<br>\n";
      }
    }
  }
}
?>
</body>
</html>
wait is this thing checking it the way i suggested for a certain text area?
pr0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2008, 11:57 PM   #26
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by pr0 View Post
wait is this thing checking it the way i suggested for a certain text area?
Sure doesn't, but it can.. Just change the grep statement and remove the -I. That version was made as a (bigger) joke, though.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 12:13 AM   #27
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Code:
<html>
<head>
<Title>404 Test Thingy or whatever</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<br>
<form method="post">
  <div align="center"><strong>Test URLs:</strong><br>
      <textarea name="urls" id="urls" cols="45" rows="5"><?=isset($_REQUEST['urls'])?$_REQUEST['urls']:"";?></textarea>
    <br>
    <input type="submit" name="submit" id="submit" value="Check Response">
  </div>
</form>
<?php
// This is hardly an example of good PHP.  Ugh.
@require_once("class.curl.php");
// trim() to get rid of errant enter keys.
$myurls = (isset($_REQUEST['urls'])?explode("\n", trim($_REQUEST['urls'])): array());
foreach ($myurls as $url) {
  // lame
  $search="";
  $breakshit = @explode("|", $url);
  if (!empty($breakshit["1"])) {
    $url = $breakshit["0"];
    $search = $breakshit["1"];
  }
  // use our cURL class.
  $curlInit = new curl($url);
  // Make sure we don't follow redirects.
  $curlInit->setopt(CURLOPT_FOLLOWLOCATION, FALSE) ;
  $curlInit->setopt(CURLOPT_RETURNTRANSFER, TRUE) ;
  // Do it.
  $return = $curlInit->exec();
  // If we returned a connection error, say so.
  if ($myError = $curlInit->hasError()) {
    echo "ERR: $url ($myError)<br>\n";
  } else {
    // Reinit our array
    if (!eregi($search, $return)) {
           echo "<font color='red'>Did not find &quot;".$search."&quot;</font>: <a href='$url' target='_new'>[link]</a> $url<br>\n";
    }
  }
  // We're done, close the socket.
  $curlInit->close();
}
?>
</body>
</html>
This one lets you search for a specific word in the full text of the html. It uses eregi rather than preg, because I hate perl's regex.

Format:
http://site.com/|searchterm

If searchterm is empty, it doesn't fall back to 404. I don't feel like actually turning this pile of shit code into something worthwhile. I'm not bored anymore.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 12:40 AM   #28
Mr Pheer
Retired
 
Industry Role:
Join Date: Dec 2002
Posts: 20,956
next time I think I'll just make a thread called, spam me with your PHP code...

Mr Pheer is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 12:46 AM   #29
pr0
rockin tha trailerpark
 
pr0's Avatar
 
Industry Role:
Join Date: May 2001
Location: ~Coastal~
Posts: 23,088
Quote:
Originally Posted by Mr Pheer View Post
next time I think I'll just make a thread called, spam me with your PHP code...

na that only works at 4am when programmers are still up & trying anything they can to get sleepy...like right now
pr0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 12:51 AM   #30
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
i dont feel like reading through all this, but are we having another one of those contests to see who can do this more inefficiently again?
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 12:59 AM   #31
Iron Fist
Too lazy to set a custom title
 
Join Date: Dec 2006
Posts: 23,400
Quote:
Originally Posted by k0nr4d View Post
i dont feel like reading through all this, but are we having another one of those contests to see who can do this more inefficiently again?
__________________
i like waffles
Iron Fist is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 01:26 AM   #32
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by k0nr4d View Post
i dont feel like reading through all this, but are we having another one of those contests to see who can do this more inefficiently again?
That bitch Kris didn't play along so I gave up.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 07:39 AM   #33
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
That bitch Kris didn't play along so I gave up.
sorry, I fell asleep haha
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 07:52 AM   #34
gornyhuy
Chafed.
 
gornyhuy's Avatar
 
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
Quote:
Originally Posted by Mr Pheer View Post
next time I think I'll just make a thread called, spam me with your PHP code...

This is super rare for a tech or biz thread to be not only answered but hit with multiple versions of working code and even upgrades by request. Crazy shit.
__________________

icq:159548293
gornyhuy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 03:11 PM   #35
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
damn shush grouchy i just did it in a 5 mins i was tired, it worked on my dev server
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 03:39 PM   #36
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
sorry, I fell asleep haha
It's no fun playing in the kiddy pool. Bitch.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 04:02 PM   #37
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
It's no fun playing in the kiddy pool. Bitch.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-23-2008, 05:40 PM   #38
pornpf69
Too lazy to set a custom title
 
pornpf69's Avatar
 
Join Date: Jun 2004
Location: Brasil
Posts: 15,778
some interesting scripts around here...
pornpf69 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.