![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
small script help to veify websites...
anyone can hook me up with a simple php script where you can load a list of websites... then the script loads a website and checks view source for whatever text I specify, and if it finds text that I specified it will save that URL as a valid url into a valid.txt file, if it does not find what I specify in view source it will ignore it and put it into bad.txt ...
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Location: Porn Valley, CA
Posts: 10,590
|
Code:
<?php error_reporting(0); $url=$_GET['url']; $string='THE TEXT YOU WANT TO CHECK FOR'; $handle = fopen("$url", "rb"); $contents = stream_get_contents($handle); $count=substr_count("$contents", "$string"); if($count > 0){ echo "PASS"; }else{ echo "FAIL"; } ?>
__________________
![]() ![]() ![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Guest
Posts: n/a
|
Off Voodoo's code:
PHP Code:
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
$pass = array(pass.txt); $fail = array(fail.txt); when I run it, it's doing something, but i don't see good/bad urls going to txt files |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Guest
Posts: n/a
|
Well if you don't mind either waiting for someone to complete it for you, or until I finish writing my class that does exactly what you want, I'll give you the url to either view it (if I decide to give it free), or to buy it.
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
At least substr_count() isn't strstr(), which most people don't count '0' as being valid. But lots of luck with finding an exact pattern match. Might as well be doing 'view source' by hand.
If you're trying to confirm a link trade, just use a pre-existing script. There's tons to choose from.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
can somebody finish the script, i'll epass $10 to whoever can get it right... script should be able to handle 2-5000 urls
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Too lazy to set a custom title
Join Date: Dec 2006
Posts: 23,400
|
LOL $10 bucks.... that's awesome offers.
__________________
i like waffles |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
I'll chime in...
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
![]() leave your epass id as well ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
What problem are you having? It is loading one URL at a time and a timeout seems unnecessary?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
You can use the sleep() function.
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
Yes, it creates the full text file before writing it. You could write each time but at 5000+ times that could cause some issues. Unless absolutely necessary, I wouldn't do it that way. Here is the code anyways..
![]() PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
Sorry that code has a problem in Windows, this should do the trick.
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
I've gotta admit, I've never seen a filemode of 'at' before.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Confirmed User
Join Date: Mar 2008
Posts: 8,960
|
I suggest you hire a developer.
__________________
| _TeenageDecadence - Young Board Naked Teens. |
| ____ NonNudeGirls - Female Puberty Photos. ____ | | _ HerSelfPics - The ORIGINAL exGF SelfPic site. __ | \.______ xPosing - Wife Photosharing site. _______./ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
Code:
Windows offers a text-mode translation flag ('t') which will transparently translate \n to \r\n when working with the file. In contrast, you can also use 'b' to force binary mode, which will not translate your data. To use these flags, specify either 'b' or 't' as the last character of the mode parameter. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
Quote:
From a design standpoint - other than it since being asked for, I'm curious why you killed the pass/fail arrays - that was the only part of the code that I thought was salvageable.
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
Quote:
![]() ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 | |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 |
Confirmed User
Join Date: Jul 2003
Posts: 2,109
|
i don't get it, why did it stop working, everything goes to invalid txt now.... hrm
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Guest
Posts: n/a
|
PHP Code:
|
![]() ![]() ![]() ![]() ![]() |