SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wrote a class to detect dead links in a string and need some testers ...

    Hey there!

    I just wrote a neat little class that can do the following:

    - Scan a string for URLs to 'ping' (lulz)
    - Add your own patterns for URL matching
    - Recursively ping URLs with 3xx redirect responses
    - Returns an an associative array with URL => Reponse Code pairs
    - Returns codes for ALL known HTTP responses
    - Uses both cURL and fsockets for opening connections

    This can come in handy for CMSs with older content that may or may not have dead URLs. Great way to do some clean up!

    All the other link checking scripts I've found are a bit dated and / or messy, so I wrote my own.

    I just need some people to go ahead and hammer away at it to make sure everything works as it should. If you have any suggestions, don't hesitate to throw them my way.

    Yes, I also accept constructive criticism.
    Attached Files Attached Files
    Last edited by Wilhelm Murdoch; Sep 14, 2008 at 18:43. Reason: Changed the upload from zip to txt. Sorry!
    TheDrunkenEpic - my ramblings

  2. #2
    Google Zombie ssandecki's Avatar
    Join Date
    Aug 2007
    Location
    Chicago, IL
    Posts
    665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll give it a try tommorow morning and report back anything negative I see.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!

    I noticed your current location is Chicago. I lived there up until 2 months ago when I moved to Australia for work. I miss the Chi.
    TheDrunkenEpic - my ramblings

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see some takers, but no responses. Am I correct in assuming this thing works well? lol
    TheDrunkenEpic - my ramblings

  5. #5
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    The zip file seems to be corrupt for me it won't let me extract it.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hrm, it's working great for me. I'll just rename it to a txt file. Should make everyone happy. Hold on.
    Last edited by Wilhelm Murdoch; Sep 14, 2008 at 18:43. Reason: Ok, fixed it.
    TheDrunkenEpic - my ramblings

  7. #7
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Hmm you can probably remove the status codes and just use ranges. (Also the text after the number is not always the same and doesn't have to be according to HTTP.)

    I'll still looking over it....
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •