> On Nov 05, 2021, at 22:43, Pu Koh <[email protected]> wrote:
> Thanks all. I shall look into the suggestions.
> Here's what I'm trying to do.
> I'm creating HTML 5 banners, and need to inject code for the click tags.
> The code looks like this:

Hey There,

Here's a super basic proof-of-concept.

--
Best Regards,
Chris


#!/usr/bin/env perl -sw

my $headData = q(
<meta name="ad.size" content="width=728,height=90">
<script type="text/javascript">
var clickTag = "XXXXXXXXX"; </script>
);

$headData = substr($headData, 2, -1);

my $canvasWrapper01 = q(<a href="javascript:window.open(window.clickTag)">);
my $canvasWrapper02 = q(</a>);

while (<>) {
    s!<head>!$&\n$headData!i;
    s!(<canvas.+?</canvas>)!$canvasWrapper01$1$canvasWrapper02!i;
    print;
}


-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/6BD8E9AF-4307-4705-B74B-E5F85F4EC88A%40gmail.com.

Reply via email to