Results 1 to 4 of 4
  1. #1
    ABW Ambassador CrazyGuy's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,463
    David (or anyone)

    I might be having a brain f@rt today, but can you suggest how I could direct the output from an amazon.pl query into a perl variable to then display it with the rest of a dynamically generated page.

    I don't want to output a javascript tag as I'd like the "real" content to be there.

    I came up with a solution that works but it's v clumsy - involves http'ing to the amazon.pl url rather than doing it "internally".

    Thanks


    --------------
    Are you Crazy?

  2. #2
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    Try putting an SSI include statement in your output. However, you might have to reconfigure your webserver so that it looks for SSI statements in cgi-bin output.

    Otherwise, use perl's LWP to get the results via http. Since your http'ing to your own webserver, there is no internet involved (the entire data path is internal to your server) so the server should process the request relatively quickly.

    In the URL that you use, be sure to include the "ssi" parameter so that amazon.pl returns just the {results} variable value, e.g.:

    http://www.c3scripts.com/cgi-bin/ama...=best&mode=dvd

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  3. #3
    ABW Ambassador CrazyGuy's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,463
    Oh, ok - it is LWP I'm using in my solution.

    It will only work with a URL - doesn't accept paths - so I assumed there was a degree of internet involved (maybe just DNS I guess). If you reckon it's all staying within the server then I guess that's as good a way as any of doing it.

    Actually I have a much busier site using LWP in a similar way and was concerned it was being inefficient. I feel much better if it turns out to be the right way to do it

    Thanks David


    --------------
    Are you Crazy?

  4. #4
    ABW Ambassador cusimano's Avatar
    Join Date
    January 18th, 2005
    Location
    Toronto, Canada
    Posts
    1,369
    That is the correct way to do it with any script. The URL must contain a domain name since that's the way the LWP function works. All the processing is done within your server. The DNS daemon ("named" process) running on your server handles all DNS requests from within your server.

    Yours truly,
    Cusimano.Com Corporation
    per: David Cusimano

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Replies: 4
    Last Post: February 25th, 2014, 11:57 AM
  2. page 2+ dynamic title for datafeed
    By ladidah in forum AvantLink -AV
    Replies: 9
    Last Post: April 21st, 2009, 03:37 PM
  3. Amazon.pl - Need some help with script output
    By richardeward in forum Cusimano.com Scripts
    Replies: 18
    Last Post: January 18th, 2003, 01:22 PM
  4. Dynamic Page Crawling
    By Sam Bay in forum Search Engine Optimization
    Replies: 12
    Last Post: December 20th, 2002, 08:43 AM

Posting Permissions

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