Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for my $e ($dom->find('structured-macro[name="include"]')->each) {
- my $include = $e->find('page[ri:content-title$=.]')->[0];
- DEBUG("include contents: < $include >");
- my ($title, $space_key);
- $include =~ /content-title="(?<title>[_a-zA-Z0-9\,\:\- ]+)"/;
- $title = $+{title};
- $include =~ /ri:space-key="(?<space_key>[a-zA-Z]+)"?/;
- $space_key = $+{space_key};
- $space_key //= 'sp';
- DEBUG("include extracted fields: < space: $space_key title: $title >");
- my $cmd = qq[get-page-source --called '$title' --from 'AppNexus:$space_key'];
- my $included_content = `$cmd`;
- $included_content =~ s/^Source\n//;
- $e->replace($included_content);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement