krisravn has asked for the wisdom of the Perl Monks concerning the following question:

Hello
My problem is that I like to create a http request from some html code I have generated via HTML::Template. And when I have send the request I like to receive the response. So far the tutorials I have seen have all been used a url for the http request. But I think my problem is very easy to solve, but Im a totally newbi when it comes to web and CGI programming. So if you can give me an example of how to solve the problem I will be very pleased.
The code is generally just a html body that contains a javascript. See the example below. example:
<html> <head> <body> <script src="http://track.adform.net/adfserve/?bn=148362;click=h +ttp://adserver.adtech.de/adlink|323|91793|1|277|AdId=2046258;BnId=1;i +time=940075463;nodecode=yes;link=;ord=940075463;adfxid=1x;2011;set1=e +n-US|en-US|1440X900|10;set2=1450|700|24|8|10|0|3|7|0|0&CREFURL=http%3 +A%2F%2Fekstrabladet%2Edk%2F" language="JavaScript"> </script> </body> </html>
Regards
krisravn

Replies are listed 'Best First'.
Re: Creating a HTTP request from html code
by Corion (Patriarch) on Dec 22, 2008 at 17:16 UTC

    You will just need to extract the URL from the Javascript and then use LWP::Simple to make the request. This sounds a bit like click fraud to me, but I guess you have a legit application of this.

      Thanks. Now it works :)