Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6084367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:30:48+00:00 2026-05-23T11:30:48+00:00

Ive built a form on a webpage that allows a user to enter a

  • 0

Ive built a form on a webpage that allows a user to enter a URL and some information about the URL’s CSS is returned. The tool works fine, apart from one issue i have noticed.

When i enter the URL of the site where the script is hosted (tested locally, on a staging server and on a production server), the open-uri command ‘open’ returns a Timeout::Error. Now this isn’t hugely surprising, i’m guessing something is getting locked up somewhere along the line and in the process of running the script and opening the current URL, processes are getting tied up a little.

For reference, here is the method where the Timeout occurs:

 # loads the Nokogiri XML object if it hasn't already been loaded
 def site
   begin
     timeout(10) do
       @site ||= Nokogiri::HTML(open(url))
     end
   rescue Timeout::Error
     return nil
   end
 end

My question is, how do i enable the script to be able to ‘open’ the domain the script is currently running on? Do i need to create another Thread or something to process this particular aspect of my tool, if so how do i ensure the rest of my script isn’t run until i receive something valid from the ‘open’ command?

Thanks for any suggestions or tips on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:30:49+00:00Added an answer on May 23, 2026 at 11:30 am

    I wonder if you’re getting into a recursive loop. Are you seeing repeated entries in your httpd log showing requests for the same site?

    If so you might want to short-circuit requests to that particular domain and pre-stuff the @site instance variable so it falls through.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive built a form that I need to post back on. I have put...
I've built a Backbone-powered library that allows a user to add/remove items, much like
I've built web apps before that utilize phpBB session, and user data. The common
I've built a small application which has User Management, a frontend console to enter
I've built a Django form that submits to a page on another domain (that
So far I've built a simple form for a user using the form_for method
I'm struggling with a form I've built and need some help from you good
I've built an HTML form that sends an email via PHP, but it's giving
I've built a form with Netbeans's visual editor. When I press one of the
I've built a form to upload images, and processed with Prototype/PHP. $('image_upload').observe('submit', function() {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.