SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cold fusion snippet

    Does anyone have a cold fusion snippet of code that will spider URLS and report on what it finds?

  2. #2
    SitePoint Addict ownersite's Avatar
    Join Date
    Jul 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ee-o,

    Can you be a little more specific about what you need the CF code to do?

    <CFHTTP> will allow you to save the content of a webpage (whatever is placed in the 'URL" attribute) into a variable that you can then manipulate using CF...
    F150online- 102,000 users strong and growing...
    Ownersite.com
    - tools to enhance vehicle ownership

  3. #3
    SitePoint Guru nagrom's Avatar
    Join Date
    Jul 2001
    Location
    Western CT, USA
    Posts
    803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the bottom of this thread has a good example:

    http://www.sitepointforums.com/showt...threadid=28444

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All links on my site point to the same server which redirects you to various other sites depending on which link you clicked, sometimes if the link has become "expired" rather than taking you to the actual link you clicked on, it will direct you to something like this: http://members.cj.com/expired.asp?AI...&PID=variables

    How do I make cold fusion spider my site and tell me which links end up at this "expired page"?

  5. #5
    SitePoint Guru nagrom's Avatar
    Join Date
    Jul 2001
    Location
    Western CT, USA
    Posts
    803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd modify the links to point to a page that runs the cfhttp tag and redirects.

    your links would need to be:
    Code:
    <a href="cfhttp_check_page.cfm?link=www.somesite.com">
    on the cfhttp_check_page you'll need something like:
    Code:
    <cfhttp url="http://#Trim(url.link)#" method="get">
    <cfif Trim(CFHTTP.FileContent) NEQ "">
      <!--- page has content, go to it --->
    <cfelse>
      <!--- page doesnt exist, go to the redierct page --->
    </cfif>
    Last edited by nagrom; Jul 26, 2001 at 12:17.

  6. #6
    SitePoint Addict ownersite's Avatar
    Join Date
    Jul 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ee-o,

    The <CFHTTP> tag returns a few variables, including CFHTTP.StatusCode. Status codes include:

    100 Continue
    101 Switching Protocols
    200 Success
    201 Created
    202 Accepted
    203 Non-Authoritative Information
    204 No Content
    205 Reset Content
    206 Partial Content
    300 Multiple Choices
    301 Moved Permanently
    302 Moved Temporarily
    303 See Other
    304 Not Modified
    305 Use Proxy
    400 Bad Request
    401 Unauthorized
    402 Payment Required 403 Forbidden
    404 Not Found
    405 Method Not Allowed
    406 Not Acceptable
    407 Proxy Authentication Required
    408 Request Time-Out
    409 Conflict
    410 Gone
    411 Length Required
    412 Precondition Failed
    413 Request Entity Too Large
    414 Request-URL Too Large
    415 Unsupported Media Type
    500 Server Error
    501 Not Implemented
    502 Bad Gateway
    503 Out of Resources
    504 Gateway Time-Out
    505 HTTP Version not supported

    You can use the value returned to determine if the page is available...hope that helped answer the question.
    F150online- 102,000 users strong and growing...
    Ownersite.com
    - tools to enhance vehicle ownership


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
  •