Win32::Internet fetch url question

Discussion in 'Perl Misc' started by EL34, Nov 10, 2006.

  1. EL34

    EL34 Guest

    I have an app that goes out to my company web site and checks a file to

    see if an order has been placed on my shopping cart.

    Everything works fine unless the server is down, is being re-booted,
    etc.


    My perl app hangs up and I cannot exit it unless I kill the Perl
    process in windows.


    I am using fetch to open the file.
    $INET->FetchURL("$FileOnServer");


    Is there a way to
    see if a files exist on a server or if,
    if the internet connection is down or,
    any sort of reason why Perl cannot fetch the file within say 10
    seconds?


    I looked over the win32::internet docs but I don't quite understand how

    to go about doing this.
    a short example would be much appreciated.
    thanks
     
    EL34, Nov 10, 2006
    #1
    1. Advertising

  2. EL34

    J. Gleixner Guest

    EL34 wrote:
    [...]
    > I am using fetch to open the file.
    > $INET->FetchURL("$FileOnServer");


    Next time, show the code that creates $INET.


    > Is there a way to
    > see if a files exist on a server or if,
    > if the internet connection is down or,
    > any sort of reason why Perl cannot fetch the file within say 10
    > seconds?
    >
    >
    > I looked over the win32::internet docs but I don't quite understand how
    >
    > to go about doing this.
    > a short example would be much appreciated.


    Maybe you should look through the documentation for Win32::Internet,
    instead. :)

    I've never used it, however I took a few seconds and searched the
    documentation for 'timeout', and found a 'ConnectTimeout' method. That
    should provide you with a solution.
     
    J. Gleixner, Nov 10, 2006
    #2
    1. Advertising

  3. EL34

    EL34 Guest

    Thanks, but that one line does it all, there is no other code exept
    Use::win32::internet.

    I was kind of looking for someone who was familiar with the module and
    an example, as I stated above.

    Please don't get Po'd but your answer was of no help.


    J. Gleixner wrote:
    > EL34 wrote:
    > [...]
    > > I am using fetch to open the file.
    > > $INET->FetchURL("$FileOnServer");

    >
    > Next time, show the code that creates $INET.
    >
    >
    > > Is there a way to
    > > see if a files exist on a server or if,
    > > if the internet connection is down or,
    > > any sort of reason why Perl cannot fetch the file within say 10
    > > seconds?
    > >
    > >
    > > I looked over the win32::internet docs but I don't quite understand how
    > >
    > > to go about doing this.
    > > a short example would be much appreciated.

    >
    > Maybe you should look through the documentation for Win32::Internet,
    > instead. :)
    >
    > I've never used it, however I took a few seconds and searched the
    > documentation for 'timeout', and found a 'ConnectTimeout' method. That
    > should provide you with a solution.
     
    EL34, Nov 10, 2006
    #3
  4. EL34

    EL34 Guest

    Use::win32::internet.
    $INET = new Win32::Internet();
    $INET->FetchURL("$FileOnServer");

    Actually, here's all that's required to fetch an URL.
    Anyone have a simple working example of using the http session seesion
    code and a way to test if the page can be fetched?
    I'm not sure what I am looking at in the doc's as I stated above.



    EL34 wrote:
    > Thanks, but that one line does it all, there is no other code exept
    > Use::win32::internet.
    >
    > I was kind of looking for someone who was familiar with the module and
    > an example, as I stated above.
    >
    > Please don't get Po'd but your answer was of no help.
    >
    >
    > J. Gleixner wrote:
    > > EL34 wrote:
    > > [...]
    > > > I am using fetch to open the file.
    > > >

    > >
    > > Next time, show the code that creates $INET.
    > >
    > >
    > > > Is there a way to
    > > > see if a files exist on a server or if,
    > > > if the internet connection is down or,
    > > > any sort of reason why Perl cannot fetch the file within say 10
    > > > seconds?
    > > >
    > > >
    > > > I looked over the win32::internet docs but I don't quite understand how
    > > >
    > > > to go about doing this.
    > > > a short example would be much appreciated.

    > >
    > > Maybe you should look through the documentation for Win32::Internet,
    > > instead. :)
    > >
    > > I've never used it, however I took a few seconds and searched the
    > > documentation for 'timeout', and found a 'ConnectTimeout' method. That
    > > should provide you with a solution.
     
    EL34, Nov 10, 2006
    #4
  5. EL34

    J. Gleixner Guest

    EL34 wrote:

    Please stop top-posting....

    >> J. Gleixner wrote:
    >>> EL34 wrote:
    >>> [...]
    >>>> I am using fetch to open the file.
    >>>>
    >>> Next time, show the code that creates $INET.
    >>>
    >>>
    >>>> Is there a way to
    >>>> see if a files exist on a server or if,
    >>>> if the internet connection is down or,
    >>>> any sort of reason why Perl cannot fetch the file within say 10
    >>>> seconds?
    >>>>
    >>>>
    >>>> I looked over the win32::internet docs but I don't quite understand how
    >>>>
    >>>> to go about doing this.
    >>>> a short example would be much appreciated.
    >>> Maybe you should look through the documentation for Win32::Internet,
    >>> instead. :)
    >>>
    >>> I've never used it, however I took a few seconds and searched the
    >>> documentation for 'timeout', and found a 'ConnectTimeout' method. That
    >>> should provide you with a solution.

    >


    > EL34 wrote:
    >> Thanks, but that one line does it all, there is no other code exept
    >> Use::win32::internet.


    Well, there's your problem.

    >>
    >> I was kind of looking for someone who was familiar with the module and
    >> an example, as I stated above.


    It seems to be clearly spelled out in the documentation, I don't
    need to be familiar with the particular module, if it's well
    documented.

    >> Please don't get Po'd but your answer was of no help.


    Why would I be "Po'd" that I point you right to the method you
    need to resolve your stated issue and you say I was no help?

    > Use::win32::internet.

    use Win32::Internet;

    See, this stuff is important. If that's wrong then the one
    line from you're script doesn't help anyone figure out
    the problem.

    > $INET = new Win32::Internet();
    > $INET->FetchURL("$FileOnServer");
    >
    > Actually, here's all that's required to fetch an URL.
    > Anyone have a simple working example of using the http session seesion
    > code and a way to test if the page can be fetched?
    > I'm not sure what I am looking at in the doc's as I stated above.


    So you looked at the documentation and found ConnectionTimeout and that
    didn't help disconnect the connection after a certain amount of time
    waiting? I don't see that in your code.

    You could also look at the test code that comes with that module,
    which I found conveniently located on CPAN.

    http://search.cpan.org/src/JDB/libwin32-0.26/Internet/test.pl

    The "GENERIC URL FETCHER" part...

    It's amazing the helpful things you find in the documentation.. :)

    Now, if you come back for more, after that, and top-post your 3-line
    script saying "It didn't work", then I'll get "Po'd".

    Thank You
     
    J. Gleixner, Nov 10, 2006
    #5
  6. EL34

    J. Gleixner Guest

    J. Gleixner wrote:

    > See, this stuff is important. If that's wrong then the one
    > line from you're script doesn't help anyone figure out

    ^^^^^^ your

    pet-peeve.. to correct my own grammar. :)
     
    J. Gleixner, Nov 10, 2006
    #6
  7. EL34

    EL34 Guest

    You are a little too anal.

    Please do not reply to messages if you are not familiar with the module
    or have no intent on supplying the requested info. Bot sure why you are
    you even involved in this post?

    The best way I learn is from a working example.
    This is not an unreasonable request to ask for a working example.
    The HTTP sesion docs on this module do not have a working example and I
    have searched the web looking for one.

    Just because you have a better understanding of Perl than me does not
    make you king shit on turd island. I am an expert on several other
    fieldss other than Perl, I am just learning Perl.
    Lets pretend you want to know something that I know on one of my fields
    of expertise

    I would not treat people the way that you do in my particular fields of
    expertise.

    RTFM is not what I was asking for in my original post.


    J. Gleixner wrote:
    > J. Gleixner wrote:
    >
    > > See, this stuff is important. If that's wrong then the one
    > > line from you're script doesn't help anyone figure out

    > ^^^^^^ your
    >
    > pet-peeve.. to correct my own grammar. :)
     
    EL34, Nov 10, 2006
    #7
  8. EL34

    J. Gleixner Guest

    EL34 wrote:
    > You are a little too anal.

    And you're a three time top-poster. Not that I'm actually counting, or
    anything.

    >
    > Please do not reply to messages if you are not familiar with the module
    > or have no intent on supplying the requested info. Bot sure why you are
    > you even involved in this post?


    What Bot??.. you? When you start paying me, I'll spit out the code,
    until then start reading and trying things on your own time.

    > The best way I learn is from a working example.


    I provided a link to a complete, working example. Did you bother
    clicking on it before spouting off? Didn't think so..

    > This is not an unreasonable request to ask for a working example.
    > The HTTP sesion docs on this module do not have a working example and I
    > have searched the web looking for one.


    No idea what an HTTP sesion is, maybe that's the problem area. Care to
    elaborate?

    >
    > Just because you have a better understanding of Perl than me does not
    > make you king shit on turd island.


    It seems that you have that island all to your self.

    > I am an expert on several other
    > fieldss other than Perl, I am just learning Perl.


    Where, exactly, did it seem like that was the case? It's documented and
    I provided the exact method along with a link directly to a
    very good example, one that's used to test the class. I guess it's
    true, you're not an expert on following helpful advice. Oh well.

    > Lets pretend you want to know something that I know on one of my fields
    > of expertise


    Nah, I grew out of pretending when I was about 6 years old, but you go
    ahead and pretend all you want. xyzzy.. <*poof*>.. it's magic..

    > I would not treat people the way that you do in my particular fields of
    > expertise.


    No, thank you so much for not trying to help anyone. You're
    obviously too busy pretending you know something to be bothered.
    I'll sleep much better at night.

    > RTFM is not what I was asking for in my original post.


    Too bad. Thanks for playing. Game over. Please insert another token..

    bu-bye.. Plonk
     
    J. Gleixner, Nov 10, 2006
    #8
  9. EL34 <> wrote:

    > You are a little too anal.



    And you are a little too dense.


    > Please do not reply to messages



    I think you can probably count on plenty of people not replying
    to your future messages, probably because they will not see them
    in the first place...


    > if you are not familiar with the module
    > or have no intent on supplying the requested info.



    There is no obligation for followups to fulfill any request.

    We discuss Perl here, whether it provides what you want or
    not is immaterial.


    > I am an expert on several other
    > fieldss other than Perl



    I am impressed.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Nov 11, 2006
    #9
  10. EL34

    EL34 Guest

    Just relax and forget about it, I found a lovely forum where people
    actually are willing to help a beginner instead of just spewing out,
    RTFM.

    You can go back to your throne now and rejoice in how wonderful your
    are that you understand Perl better than me.

    For future refernce, some people learn better by seeing a working
    example. Me for one.

    Text book formulas without an examples are way more difficult and
    impossible in some cases.

    All I was asking for was a working example, nothing more.

    see ya


    Tad McClellan wrote:
    > EL34 <> wrote:
    >
    > > You are a little too anal.

    >
    >
    > And you are a little too dense.
    >
    >
    > > Please do not reply to messages

    >
    >
    > I think you can probably count on plenty of people not replying
    > to your future messages, probably because they will not see them
    > in the first place...
    >
    >
    > > if you are not familiar with the module
    > > or have no intent on supplying the requested info.

    >
    >
    > There is no obligation for followups to fulfill any request.
    >
    > We discuss Perl here, whether it provides what you want or
    > not is immaterial.
    >
    >
    > > I am an expert on several other
    > > fieldss other than Perl

    >
    >
    > I am impressed.
    >
    >
    > --
    > Tad McClellan SGML consulting
    > Perl programming
    > Fort Worth, Texas
     
    EL34, Nov 12, 2006
    #10
  11. EL34

    Joe Smith Guest

    EL34 wrote:

    > All I was asking for was a working example, nothing more.


    The reply dated 11/10/2006 12:59 PM did have a link
    to a working example, so there was no need for obscenities.

    > RTFM is not what I was asking for in my original post.


    However, if TFM has the exact answer to the question, then
    referring to it is appropriate.
     
    Joe Smith, Nov 13, 2006
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Francesco Moi

    Is there any library to get/fetch a remote URL?

    Francesco Moi, Oct 5, 2004, in forum: C Programming
    Replies:
    13
    Views:
    462
    Mark McIntyre
    Oct 6, 2004
  2. Replies:
    2
    Views:
    205
    Jan Svitok
    Nov 16, 2006
  3. Randell D.

    Can I use js to fetch title of remote url?

    Randell D., Jul 14, 2003, in forum: Javascript
    Replies:
    6
    Views:
    111
    Randell D.
    Jul 14, 2003
  4. saiho yuen
    Replies:
    1
    Views:
    112
    F. Da Costa
    Jan 18, 2004
  5. new

    fetch a manay URL's

    new, Feb 9, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    108
    John Bokma
    Feb 9, 2005
Loading...

Share This Page