Find the answer to your Linux question:
Results 1 to 3 of 3
Dear people, i have a script test.php which outputs a img tag to the internet browser whos src is an external URL with multiple parameters. The URL uses the parameters ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    2

    Call a URL from command line or cronjob with lynx and wget


    Dear people,

    i have a script test.php which outputs a img tag to the internet browser whos src is an external URL with multiple parameters.
    The URL uses the parameters to import statistics after a click on my site.

    A cronjob should now either call the external URL which is contained in the img src attribute, or the script test.php. I cannot get either to work.
    I tried wget and lynx to call the URL pointing to test.php and also the direct URL from the img source. Calling the url/test.php ends in timeout. (Maybe because the domain is forwarded to the same server as i type the commands in) Calling the URL of img src directly via lynx or wget does not import the statistiks that i need.

    What else can i try to call the URL? (The same way i would call it from my browser)

    I would be glad for any help

  2. #2
    Just Joined! RobKendrick's Avatar
    Join Date
    Oct 2008
    Location
    Georgia, USA
    Posts
    15
    I'm not entirely sure I understand your question, so let me see if I can get it right:

    You need to have a cronjob pull the external URL from the <img> element in your code, or run the script test.php if no URL exists, right? Are you trying to just copy the URL to the clipboard, or wget the actual html file and then open it via a browser?

    What does your code look like so far?

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    2
    Thank you for your reply.
    Quote Originally Posted by RobKendrick View Post
    You need to have a cronjob pull the external URL from the <img> element in your code, or run the script test.php if no URL exists, right?
    Yes and no.
    Its best to forget trying to wget the test.php on my server. It was more an alternate choice. But it seems i cannot get wget to download URLs thats point to that same server as i am wgetting from.

    I will try in other words:
    Normally if i go to a certain page on my site, a file will be included where an image is outputted. The src of that <img> is as follows URL / cgi-bin / script.php / ? / param1 = 123 / & / param2 = 1234 / & / param3 = 3 / & / param4 = 4 / & / param5 = 5 (not allowed to post URLS sorry)
    When i go to test.php for example (where the image is outputted) then the statistics import as they should.

    When i try to call the URL of the img source with wget in the command line i dont get those statistics.

    If any help, this is to integrate a webmaster programm. Maybe you can imagine better what i am trying to do.

    I am now looking into the wget command with options --referer, --cookies, --keep-session-cookies, --save-cookies, --load-cookies

  4. $spacer_open
    $spacer_close

Posting Permissions

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