The Kids Guide to Money Cent$

Keltie Thomas, Author, Steve Maceachern, Author, Stephen MacEachern, Illustrator Kids Can Press $14.95 (56p) ISBN 978-1-55337-389-6
EVAL ERROR: Final $ should be \$ or $name at (eval 8734) line 65, within string
syntax error at (eval 8734) line 65, near "= "The Kids Guide to Money Cent$""
Global symbol "$title" requires explicit package name at (eval 8734) line 67.
Global symbol "$title" requires explicit package name at (eval 8734) line 67.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	use Business::ISBN qw(:all);
line 4:     use LWP::Simple;
line 5: 	use XML::Simple;
line 6: 	use HTML::Entities;
line 7: 
line 8: 
line 9: 	my($isbn_struct,$isbn10_string,$isbn13_string,$isbn10,$isbn13,$ASIN,$linetext);
line 10: 	my($has_ad, $box_style, $buy_amazon, $buy_apple, $buy_indiebound, $buy_powells, $buy_google, $buy_bandn, $drawer_style);
line 11: 
line 12: 	++$main::ENV{'buy_counter'};
line 13: 
line 14: 	my ($isbn) = "978-1-55337-389-6";
line 15: 	if("1"){
line 16: 		$has_ad = 1;
line 17: 	}
line 18: 
line 19: 	$linetext = "";
line 20: 	my $no_image = "";
line 21: 	if($linetext){
line 22: 		$box_style .= "display:none;position:absolute;z-index:99999;width:100px;";
line 23: 		$drawer_style .= "display:block;";		
line 24: 	}
line 25: 	else{
line 26: 		$drawer_style .= "display:none;";		
line 27: 	}
line 28: 	
line 29: 	if($isbn =~ s/^ASIN(.+)/$1/){
line 30: 		$ASIN = 1;
line 31: 		$buy_amazon = "http://www.amazon.com/gp/product/$isbn/ref=as_li_tl?ie=UTF8&tag=publiweekl05-20";
line 32: 	}
line 33: 	else{
line 34: 		$isbn_struct = Business::ISBN->new($isbn);
line 35: 		if($isbn_struct && $isbn_struct->is_valid){
line 36: 			$isbn10 = $isbn_struct->as_isbn10;
line 37: 			$isbn13 = $isbn_struct->as_isbn13;
line 38: 			$isbn10_string = $isbn10->as_string([]);
line 39: 			$isbn13_string = $isbn13->as_string([]);
line 40: 			$buy_amazon = "http://www.amazon.com/gp/product/$isbn10_string/ref=as_li_tl?ie=UTF8&tag=publiweekl05-20";
line 41: 			$buy_apple = "http://itunes.apple.com/us/book/isbn$isbn13_string?at=10lvId";
line 42: 			$buy_indiebound = "http://www.indiebound.org/book/$isbn13_string?aff=PublishersWeekly";
line 43: 			$buy_powells = "http://www.powells.com/partner/41251/biblio/$isbn13_string?p_isbn";
line 44: 			$buy_google = "https://play.google.com/store/search?q=$isbn13_string&c=books&PAfiiliateID=11lwg2";
line 45: 			
line 46: 			$buy_bandn = "http://www.anrdoezrs.net/click-7485766-11819508?url=http://www.barnesandnoble.com/w/?ean=$isbn13_string";
line 47: 			
line 48: #			my $bnxml = get("https://pds.barnesandnoble.com/fetch-data-service/productAffiliate?ids=$isbn13_string");
line 49: #			
line 50: #			if($bnxml){
line 51: #				my $xmlDoc = XML::Simple->new();
line 52: #				my $xmlHash = $xmlDoc->XMLin($bnxml);
line 53: #				
line 54: #				if( $xmlHash->{'ProductAffiliateResult'} 
line 55: #					&& $xmlHash->{'ProductAffiliateResult'}->{'Product'}
line 56: #					&& $xmlHash->{'ProductAffiliateResult'}->{'Product'}->{'Url'}){
line 57: #						$buy_bandn = "http://www.dpbolvw.net/click-4260421-11819508?url=" . $xmlHash->{'ProductAffiliateResult'}->{'Product'}->{'Url'};
line 58: #				}
line 59: #			}
line 60: #
line 61: #			$buy_bandn = "http://click.linksynergy.com/deeplink?mid=36889&id=uWBQGnFbkjk&murl=http%3A%2F%2Fcart2.barnesandnoble.com%2FShop%2Fxt_manage_cart.asp%3Fean%3D$isbn13_string%26productcode%3DBK";
line 62: 
line 63: 		}
line 64: 	}
line 65: 	my $title = "The Kids Guide to Money Cent$";
line 66: 	
line 67: 	$title = encode_entities($title, '<>&"');
line 68: 	
line 69: 	if($linetext){
line 70: 		print "<span id=\"box_inline$main::ENV{'buy_counter'}\" class=\"buy-link\" onmouseover=\"\$(\'#buy-container$main::ENV{'buy_counter'}\').fadeIn(100);\" onmouseleave=\"dismissUnlessEnter('#buy-container$main::ENV{\"buy_counter\"}','#box_inline$main::ENV{\"buy_counter\"}')\";>$linetext</span>\n";
line 71: 		print "<div id=\"buy-container$main::ENV{'buy_counter'}\" onmouseleave=\"\$(\'#buy-container$main::ENV{'buy_counter'}\').fadeOut(100);\" style=\"$box_style\">\n";
line 72: 	}
line 73: 	else{
line 74: 		print "<div id=\"buy-container$main::ENV{'buy_counter'}\" style=\"$box_style\">\n";
line 75: 	}
line 76: 	if(!$no_image) { 
line 77: 		print "
EVAL ERROR: Global symbol "$title" requires explicit package name at (eval 8736) line 11.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	my(@incoming,$isbn);
line 4: 
line 5: 	$main::ENV{'image_url'} = '';
line 6: 
line 7: 	@incoming = split(/,/,"$isbn");
line 8: 	$isbn = $incoming[0];
line 9: 	
line 10: 	$isbn =~ s/-//g;
line 11: 	$main::ENV{'image_alt_title'} = "$title";
line 12: 		 = "https://booklife.com/image-factory/http/localhost/amazongetcover/$isbn.jpg/w204.jpg";
line 13:  };
line 14: &doEval();
line 15: 1;
"; line 78: print "<div id=\"buy-box\">\n"; line 79: } line 80: else { line 81: print "<div id=\"buy-box\" style=\"width:100%;margin-top:10px;margin-bottom:20px;\">\n"; line 82: } line 83: print "<div id=\"buy-inner-box\" class=\"buy-box\">\n"; line 84: if($linetext){ line 85: print "<div class=\"buy-box-header\">Buy this book</div>\n"; line 86: } line 87: else{ line 88: print "<div class=\"buy-box-header\" onClick=\"\$(\'.buy-box-body$main::ENV{'buy_counter'}\').toggle(100);\">Buy this book</div>\n"; line 89: } line 90: print "<div class=\"buy-box-body$main::ENV{'buy_counter'}\" style=\"$drawer_style\">\n"; line 91: print "<div class=\"buy-box-item\">\n"; line 92: print "<a href=\"$buy_amazon\" target=\"_offsite\">Amazon</a>\n"; line 93: print "</div>\n"; line 94: if(!$ASIN){ line 95: if($buy_bandn){ line 96: print "<div class=\"buy-box-item\">\n"; line 97: print "<a href=\"$buy_bandn\" target=\"_offsite\">Barnes & Noble</a>\n"; line 98: print "</div>\n"; line 99: } line 100: #print "<div class=\"buy-box-item\">\n"; line 101: #print "<a href=\"$buy_google\" target=\"_offsite\">Google</a>\n"; line 102: #print "</div>\n"; line 103: print "<div class=\"buy-box-item\">\n"; line 104: print "<a href=\"$buy_apple\" target=\"_offsite\">iBooks</a>\n"; line 105: print "</div>\n"; line 106: print "<div class=\"buy-box-item\">\n"; line 107: print "<a href=\"$buy_indiebound\" target=\"_offsite\">IndieBound</a>\n"; line 108: print "</div>\n"; line 109: print "<div class=\"buy-box-item\">\n"; line 110: print "<a href=\"$buy_powells\" target=\"_offsite\">Powell's</a>\n"; line 111: print "</div>\n"; line 112: } line 113: print "</div>\n"; line 114: print "</div>\n"; line 115: print "</div>\n"; line 116: # if($has_ad && !$no_image){ line 117: # print "<div>\n"; line 118: # print "<div><a rel=\"nofollow\" href=\"https://secure.publishersweekly.com/pw/link-tracker?action=click&id=8\"> </a><img src=\"https://secure.publishersweekly.com/pw/link-tracker?action=impression&id=8\" width=\"1\" height=\"1\"></div>\n"; line 119: # print "<div class=\"quicklinks-ad\">ADVERTISEMENT</div>"; line 120: # print "<iframe src=\"//ads.ad-center.com/smart_ad/display?ref=5042105&q=KEYWORD&smart_ad_id=16481\" width=\"204\" height=\"70\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe>\n"; line 121: # print "</div>\n"; line 122: # } line 123: print "</div>\n"; line 124: line 125: }; line 126: &doEval(); line 127: 1;
Kids get a lesson in managing their money in the paper-over-board The Kids' Guide to Money Cent$ by Keltie Thomas, illus. by Steve MacEachern. Readers follow three students with different spending and saving habits. As they prepare a report for school, the trio (and readers) learns about managing cash flow, getting a job, banking and credit cards, as well as scams. Quizzes (e.g., ""What's Your Money Personality?""), sidebars, tips (called ""2 Worth""), and historical trivia help to demonstrate the points.
Reviewed on: 03/01/2004
Release date: 03/01/2004
Paperback - 56 pages - 978-1-55337-391-9
Paperback - 56 pages - 978-1-55337-390-2
Prebound-Sewn - 56 pages - 978-0-606-25013-9
Show other formats
FORMATS
EVAL ERROR: Final $ should be \$ or $name at (eval 8740) line 65, within string
syntax error at (eval 8740) line 65, near "= "The Kids Guide to Money Cent$""
Global symbol "$title" requires explicit package name at (eval 8740) line 67.
Global symbol "$title" requires explicit package name at (eval 8740) line 67.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	use Business::ISBN qw(:all);
line 4:     use LWP::Simple;
line 5: 	use XML::Simple;
line 6: 	use HTML::Entities;
line 7: 
line 8: 
line 9: 	my($isbn_struct,$isbn10_string,$isbn13_string,$isbn10,$isbn13,$ASIN,$linetext);
line 10: 	my($has_ad, $box_style, $buy_amazon, $buy_apple, $buy_indiebound, $buy_powells, $buy_google, $buy_bandn, $drawer_style);
line 11: 
line 12: 	++$main::ENV{'buy_counter'};
line 13: 
line 14: 	my ($isbn) = "978-1-55337-389-6";
line 15: 	if("1"){
line 16: 		$has_ad = 1;
line 17: 	}
line 18: 
line 19: 	$linetext = "";
line 20: 	my $no_image = "";
line 21: 	if($linetext){
line 22: 		$box_style .= "display:none;position:absolute;z-index:99999;width:100px;";
line 23: 		$drawer_style .= "display:block;";		
line 24: 	}
line 25: 	else{
line 26: 		$drawer_style .= "display:none;";		
line 27: 	}
line 28: 	
line 29: 	if($isbn =~ s/^ASIN(.+)/$1/){
line 30: 		$ASIN = 1;
line 31: 		$buy_amazon = "http://www.amazon.com/gp/product/$isbn/ref=as_li_tl?ie=UTF8&tag=publiweekl05-20";
line 32: 	}
line 33: 	else{
line 34: 		$isbn_struct = Business::ISBN->new($isbn);
line 35: 		if($isbn_struct && $isbn_struct->is_valid){
line 36: 			$isbn10 = $isbn_struct->as_isbn10;
line 37: 			$isbn13 = $isbn_struct->as_isbn13;
line 38: 			$isbn10_string = $isbn10->as_string([]);
line 39: 			$isbn13_string = $isbn13->as_string([]);
line 40: 			$buy_amazon = "http://www.amazon.com/gp/product/$isbn10_string/ref=as_li_tl?ie=UTF8&tag=publiweekl05-20";
line 41: 			$buy_apple = "http://itunes.apple.com/us/book/isbn$isbn13_string?at=10lvId";
line 42: 			$buy_indiebound = "http://www.indiebound.org/book/$isbn13_string?aff=PublishersWeekly";
line 43: 			$buy_powells = "http://www.powells.com/partner/41251/biblio/$isbn13_string?p_isbn";
line 44: 			$buy_google = "https://play.google.com/store/search?q=$isbn13_string&c=books&PAfiiliateID=11lwg2";
line 45: 			
line 46: 			$buy_bandn = "http://www.anrdoezrs.net/click-7485766-11819508?url=http://www.barnesandnoble.com/w/?ean=$isbn13_string";
line 47: 			
line 48: #			my $bnxml = get("https://pds.barnesandnoble.com/fetch-data-service/productAffiliate?ids=$isbn13_string");
line 49: #			
line 50: #			if($bnxml){
line 51: #				my $xmlDoc = XML::Simple->new();
line 52: #				my $xmlHash = $xmlDoc->XMLin($bnxml);
line 53: #				
line 54: #				if( $xmlHash->{'ProductAffiliateResult'} 
line 55: #					&& $xmlHash->{'ProductAffiliateResult'}->{'Product'}
line 56: #					&& $xmlHash->{'ProductAffiliateResult'}->{'Product'}->{'Url'}){
line 57: #						$buy_bandn = "http://www.dpbolvw.net/click-4260421-11819508?url=" . $xmlHash->{'ProductAffiliateResult'}->{'Product'}->{'Url'};
line 58: #				}
line 59: #			}
line 60: #
line 61: #			$buy_bandn = "http://click.linksynergy.com/deeplink?mid=36889&id=uWBQGnFbkjk&murl=http%3A%2F%2Fcart2.barnesandnoble.com%2FShop%2Fxt_manage_cart.asp%3Fean%3D$isbn13_string%26productcode%3DBK";
line 62: 
line 63: 		}
line 64: 	}
line 65: 	my $title = "The Kids Guide to Money Cent$";
line 66: 	
line 67: 	$title = encode_entities($title, '<>&"');
line 68: 	
line 69: 	if($linetext){
line 70: 		print "<span id=\"box_inline$main::ENV{'buy_counter'}\" class=\"buy-link\" onmouseover=\"\$(\'#buy-container$main::ENV{'buy_counter'}\').fadeIn(100);\" onmouseleave=\"dismissUnlessEnter('#buy-container$main::ENV{\"buy_counter\"}','#box_inline$main::ENV{\"buy_counter\"}')\";>$linetext</span>\n";
line 71: 		print "<div id=\"buy-container$main::ENV{'buy_counter'}\" onmouseleave=\"\$(\'#buy-container$main::ENV{'buy_counter'}\').fadeOut(100);\" style=\"$box_style\">\n";
line 72: 	}
line 73: 	else{
line 74: 		print "<div id=\"buy-container$main::ENV{'buy_counter'}\" style=\"$box_style\">\n";
line 75: 	}
line 76: 	if(!$no_image) { 
line 77: 		print "
EVAL ERROR: Global symbol "$title" requires explicit package name at (eval 8742) line 11.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	my(@incoming,$isbn);
line 4: 
line 5: 	$main::ENV{'image_url'} = '';
line 6: 
line 7: 	@incoming = split(/,/,"$isbn");
line 8: 	$isbn = $incoming[0];
line 9: 	
line 10: 	$isbn =~ s/-//g;
line 11: 	$main::ENV{'image_alt_title'} = "$title";
line 12: 		 = "https://booklife.com/image-factory/http/localhost/amazongetcover/$isbn.jpg/w204.jpg";
line 13:  };
line 14: &doEval();
line 15: 1;
"; line 78: print "<div id=\"buy-box\">\n"; line 79: } line 80: else { line 81: print "<div id=\"buy-box\" style=\"width:100%;margin-top:10px;margin-bottom:20px;\">\n"; line 82: } line 83: print "<div id=\"buy-inner-box\" class=\"buy-box\">\n"; line 84: if($linetext){ line 85: print "<div class=\"buy-box-header\">Buy this book</div>\n"; line 86: } line 87: else{ line 88: print "<div class=\"buy-box-header\" onClick=\"\$(\'.buy-box-body$main::ENV{'buy_counter'}\').toggle(100);\">Buy this book</div>\n"; line 89: } line 90: print "<div class=\"buy-box-body$main::ENV{'buy_counter'}\" style=\"$drawer_style\">\n"; line 91: print "<div class=\"buy-box-item\">\n"; line 92: print "<a href=\"$buy_amazon\" target=\"_offsite\">Amazon</a>\n"; line 93: print "</div>\n"; line 94: if(!$ASIN){ line 95: if($buy_bandn){ line 96: print "<div class=\"buy-box-item\">\n"; line 97: print "<a href=\"$buy_bandn\" target=\"_offsite\">Barnes & Noble</a>\n"; line 98: print "</div>\n"; line 99: } line 100: #print "<div class=\"buy-box-item\">\n"; line 101: #print "<a href=\"$buy_google\" target=\"_offsite\">Google</a>\n"; line 102: #print "</div>\n"; line 103: print "<div class=\"buy-box-item\">\n"; line 104: print "<a href=\"$buy_apple\" target=\"_offsite\">iBooks</a>\n"; line 105: print "</div>\n"; line 106: print "<div class=\"buy-box-item\">\n"; line 107: print "<a href=\"$buy_indiebound\" target=\"_offsite\">IndieBound</a>\n"; line 108: print "</div>\n"; line 109: print "<div class=\"buy-box-item\">\n"; line 110: print "<a href=\"$buy_powells\" target=\"_offsite\">Powell's</a>\n"; line 111: print "</div>\n"; line 112: } line 113: print "</div>\n"; line 114: print "</div>\n"; line 115: print "</div>\n"; line 116: # if($has_ad && !$no_image){ line 117: # print "<div>\n"; line 118: # print "<div><a rel=\"nofollow\" href=\"https://secure.publishersweekly.com/pw/link-tracker?action=click&id=8\"> </a><img src=\"https://secure.publishersweekly.com/pw/link-tracker?action=impression&id=8\" width=\"1\" height=\"1\"></div>\n"; line 119: # print "<div class=\"quicklinks-ad\">ADVERTISEMENT</div>"; line 120: # print "<iframe src=\"//ads.ad-center.com/smart_ad/display?ref=5042105&q=KEYWORD&smart_ad_id=16481\" width=\"204\" height=\"70\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe>\n"; line 121: # print "</div>\n"; line 122: # } line 123: print "</div>\n"; line 124: line 125: }; line 126: &doEval(); line 127: 1;
The Best Books, Emailed Every Week
Tip Sheet!
MORE BOOKS YOU'D LIKE
X
EVAL ERROR: syntax error at (eval 8751) line 207, near ""Read more about "$ENV"
Global symbol "$author" requires explicit package name at (eval 8751) line 207.
Global symbol "$html_title" requires explicit package name at (eval 8751) line 211.
Global symbol "$html_title" requires explicit package name at (eval 8751) line 211.
Global symbol "$default_title" requires explicit package name at (eval 8751) line 211.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 212.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 212.
Global symbol "$default_description" requires explicit package name at (eval 8751) line 212.
Global symbol "$meta_keywords" requires explicit package name at (eval 8751) line 213.
Global symbol "$meta_keywords" requires explicit package name at (eval 8751) line 213.
Global symbol "$default_keywords" requires explicit package name at (eval 8751) line 213.
Global symbol "$html_title" requires explicit package name at (eval 8751) line 215.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 216.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 217.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 218.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 219.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 220.
Global symbol "$twitter_description" requires explicit package name at (eval 8751) line 221.
Global symbol "$twitter_description" requires explicit package name at (eval 8751) line 222.
Global symbol "$twitter_description" requires explicit package name at (eval 8751) line 223.
Global symbol "$twitter_description" requires explicit package name at (eval 8751) line 224.
Global symbol "$meta_keywords" requires explicit package name at (eval 8751) line 225.
Global symbol "$html_title" requires explicit package name at (eval 8751) line 227.
Global symbol "$meta_keywords" requires explicit package name at (eval 8751) line 228.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 229.
Global symbol "$last_modified" requires explicit package name at (eval 8751) line 230.
Global symbol "$last_modified" requires explicit package name at (eval 8751) line 231.
Global symbol "$html_title" requires explicit package name at (eval 8751) line 234.
Global symbol "$default_image" requires explicit package name at (eval 8751) line 235.
Global symbol "$meta_description" requires explicit package name at (eval 8751) line 236.
Global symbol "$twitter_creator" requires explicit package name at (eval 8751) line 241.
Global symbol "$twitter_creator" requires explicit package name at (eval 8751) line 242.
Global symbol "$twitter_title" requires explicit package name at (eval 8751) line 244.
Global symbol "$twitter_description" requires explicit package name at (eval 8751) line 245.
Global symbol "$default_image" requires explicit package name at (eval 8751) line 246.
syntax error at (eval 8751) line 260, near "}
 }"
(eval 8751) has too many errors.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	my(@sel,%data,$html_title,$meta_description,$meta_keywords,$default_title,$default_description,$default_keywords,$last_modified);
line 4: 	my($twitter_creator,$twitter_title,$twitter_description);
line 5: 	
line 6: 	$default_title = 'Book Reviews, Bestselling Books & Publishing Business News | Publishers Weekly';
line 7: 	$default_keywords = 'book news, book reviews, bestselling books, book bestsellers, book publishing, best selling books, list of books, book business, publishing business';
line 8: 	$default_description = 'Publishers Weekly is the international news website of book publishing and bookselling including business news, reviews, bestseller lists, commentaries and more.';
line 9: 	
line 10: 	my $default_image = "http://www.publishersweekly.com/images/data/IMG/img/000/000/1-3.PNG";
line 11: 	
line 12: 	# try the topic (or subtopic)
line 13: 	if($LayoutManager::url_resolved_values{'TOPIC_TREE.nickname'}) {
line 14: 		&Database::GetParentRow($LayoutManager::url_resolved_values{'TOPIC_TREE.nickname'},\%data);
line 15: 		if($data{'html_title'}) { $html_title = $data{'html_title'}; };
line 16: 		if($data{'meta_description'}) { $meta_description = $data{'meta_description'}; };
line 17: 		if($data{'meta_keywords'}) { $meta_keywords = $data{'meta_keywords'}; };
line 18: 
line 19: 		# we are in a subtopic get the topic and fill in missing fields
line 20: 		if($LayoutManager::url_values{'TOPIC'}) { 
line 21: 			&Database::Select('TOPIC_TREE','nickname',$LayoutManager::url_values{'TOPIC'},\@sel);
line 22: 			if(@sel == 1) {
line 23: 				&Database::GetRow($sel[0],'TOPIC_TREE',\%data);
line 24: 				if($data{'html_title'} && !$html_title) { $html_title = $data{'html_title'}; }
line 25: 				if($data{'meta_description'} && !$meta_description) { $meta_description = $data{'meta_description'}; }
line 26: 				if($data{'meta_keywords'} && !$meta_keywords) { $meta_keywords = $data{'meta_keywords'}; }
line 27: 			}
line 28: 		}
line 29: 	}
line 30: 
line 31: 	# fill in missing info from page
line 32: 	if($LayoutManager::url_resolved_values{'PAGE.description'}) {
line 33: 		&Database::GetParentRow($LayoutManager::url_resolved_values{'PAGE.description'},\%data);
line 34: 		if(!$html_title) { $html_title = $data{'html_title'}; };
line 35: 		if(!$meta_description) { $meta_description = $data{'meta_description'}; };
line 36: 		if(!$meta_keywords) { $meta_keywords = $data{'meta_keywords'}; };
line 37: 	}
line 38: 	
line 39: 	# article takes precidence over topic and subtopic
line 40: 	if($LayoutManager::url_resolved_values{'ARTICLE.nickname'}) {
line 41: 		&Database::GetParentRow($LayoutManager::url_resolved_values{'ARTICLE.nickname'},\%data);
line 42: 		$html_title = $data{'headline'};
line 43: 		if($data{'title_web'}) { $html_title = $data{'title_web'}; $twitter_title = $data{'title_web'}; };
line 44: 		if($data{'html_title'}) { $html_title = $data{'html_title'}; };
line 45: 		if($data{'abstract_web'}) { $meta_description = $data{'abstract_web'}; $twitter_description = $data{'abstract_web'}; };
line 46: 		if($data{'meta_description'}) { $meta_description = $data{'meta_description'}; };
line 47: 		if($data{'meta_keywords'}) { $meta_keywords = $data{'meta_keywords'}; };
line 48: 		$last_modified = &GetLastModified($data{'pub_date'});
line 49: 		
line 50: 		my($canonical,%topic_data,%sub_topic_data,%issue_data);
line 51: 		if($data{'the_topic'}) {
line 52: 			&Database::GetRow($data{'the_topic'},'TOPIC_TREE',\%sub_topic_data);
line 53: 			&Database::GetParentRow($sub_topic_data{'parent'},\%topic_data);
line 54: 			$canonical = "http://www.publishersweekly.com/pw/by-topic/$topic_data{'nickname'}/$sub_topic_data{'nickname'}/article/$data{'nickname'}.html";
line 55: 		}
line 56: 		else {
line 57: 			if($data{'issue'}) {
line 58: 				&Database::GetRow($data{'issue'},'ISSUE',\%issue_data);
line 59: 				$canonical = "http://www.publishersweekly.com/pw/print/$issue_data{'date'}/$data{'nickname'}.html";
line 60: 			}
line 61: 		}
line 62: 		if($data{'the_photo'}) {
line 63: 			my(%image_data);
line 64: 			&Database::GetRow($data{'the_photo'},'ARTICLE_PHOTO',\%image_data);
line 65: 			if($image_data{'photo__file'}) {
line 66: 				$default_image = "http://www.publishersweekly.com/images/data/$image_data{'photo__file'}";
line 67: 			}
line 68: 		}
line 69: 		if($canonical) {
line 70: 			&Templates::SetMeta("<link rel=\"canonical\" href=\"$canonical\" />");
line 71: 		}
line 72: 	}
line 73: 
line 74: 	# reviews by ISBN
line 75: 	if($LayoutManager::url_values{'ISBN'}) {
line 76: 		my($isbn,@sel,$work,%issue_data);
line 77: 		$isbn = $LayoutManager::url_values{'ISBN'};
line 78: 		
line 79: 		$isbn =~ s/\-//g;
line 80: 		$default_image = "https://booklife.com/image-factory/http/localhost/amazongetcover/$isbn.jpg/w204.jpg";
line 81: 
line 82: 		&Database::Select('WORK_INSTANCE','isbn_std',$isbn,\@sel);
line 83: 
line 84: 		if(@sel) {
line 85: 			$work = $sel[0];
line 86: 			@sel = ();
line 87: 			&Database::Select('REVIEW','book',$work,\@sel);
line 88: 			
line 89: 			# my $root = "images/cached/INGRAM";
line 90: 			# my $row_path = $isbn;
line 91: 			# $row_path =~ s/^(...)(...)(...)(.*)/$1\/$2\/$3/;
line 92: 
line 93: 			# if(-e "/disk02/PW/htdocs/$root/$row_path/$isbn\.jpg"){
line 94: 			#	 $default_image = "http://www.publishersweekly.com/$root/$row_path/$isbn\.jpg";
line 95: 			# }
line 96: 			
line 97: 			if(@sel) {
line 98: 				&Database::FetchRow($sel[0],'REVIEW',\%data);
line 99: 				my($tmp) = $data{'info_line'};
line 100: 				$tmp =~ s/<[^>]+>//g;
line 101: 				$html_title = "$data{'category'} Book Review: $data{'title'} by $tmp";
line 102: 				$meta_description = substr($data{'body'},0,200);
line 103: 				if($data{'pub_date'}) {
line 104: 					$last_modified = &GetLastModified($data{'pub_date'});
line 105: 				}
line 106: 				else {
line 107: 					&Database::GetRow($data{'issue-UNRESOLVED'},'ISSUE',\%issue_data);
line 108: 					$last_modified = &GetLastModified($issue_data{'date'});
line 109: 				}
line 110: 
line 111: 				$twitter_creator = '@publisherswkly';
line 112: 				$twitter_title = $data{'title'};
line 113: 				$twitter_description = $meta_description;
line 114: 			}
line 115: 		}
line 116: 	}
line 117: 	
line 118: 	# reviews
line 119: 	if($LayoutManager::url_resolved_rows{'REVIEW.nickname'}) {
line 120: 		my(%issue_data);
line 121: 		&Database::FetchRow($LayoutManager::url_resolved_rows{'REVIEW.nickname'},'REVIEW',\%data);
line 122: 		my($tmp) = $data{'info_line'};
line 123: 		$tmp =~ s/<[^>]+>//g;
line 124: 		$html_title = "$data{'category'} Review: $data{'title'} by $tmp";
line 125: 		$meta_description = substr($data{'body'},0,200);
line 126: 		
line 127: 		$twitter_creator = '@publisherswkly';
line 128: 		$twitter_title = $data{'title'};
line 129: 		$twitter_description = $meta_description;
line 130: 		
line 131: 		if($data{'pub_date'}) {
line 132: 			$last_modified = &GetLastModified($data{'pub_date'});
line 133: 		}
line 134: 		else {
line 135: 			&Database::GetRow($data{'issue-UNRESOLVED'},'ISSUE',\%issue_data);
line 136: 			$last_modified = &GetLastModified($issue_data{'date'});
line 137: 		}
line 138: 
line 139: 		if($data{'book-UNRESOLVED'}){
line 140: 			my (%instance_data);
line 141: 			&Database::GetRow($data{'book-UNRESOLVED'},'WORK_INSTANCE',\%instance_data);
line 142: 			
line 143: 			my $tmpisbn = $instance_data{'isbn_std'};
line 144: 			$tmpisbn =~ s/\-//g;
line 145: 			$default_image = "https://booklife.com/image-factory/http/localhost/amazongetcover/$tmpisbn.jpg/w204.jpg";
line 146: 
line 147: 			# my $root = "images/cached/INGRAM";
line 148: 			# my $row_path = $instance_data{'isbn_std'};
line 149: 			# $row_path =~ s/^(...)(...)(...)(.*)/$1\/$2\/$3/;
line 150: 	
line 151: 			# if(-e "/disk02/PW/htdocs/$root/$row_path/$instance_data{'isbn_std'}\.jpg"){
line 152: 			# 	$default_image = "http://www.publishersweekly.com/$root/$row_path/$instance_data{'isbn_std'}\.jpg";
line 153: 			# }
line 154: 		}
line 155: 	}
line 156: 
line 157: 	if($Templates::in{'channel'} && $Templates::in{'podcast'}) {
line 158: 		my(%podcast_data);
line 159: 		&Database::GetRow($Templates::in{'podcast'},'PODCAST',\%podcast_data);
line 160: 		$html_title = $podcast_data{'title'};
line 161: 		if($podcast_data{'description'}) { $meta_description = $podcast_data{'description'}; }
line 162: 		if($podcast_data{'image__file'}) {
line 163: 			$default_image = "http://www.publishersweekly.com/images/data/$podcast_data{'image__file'}";
line 164: 		}
line 165: 		$last_modified = &GetLastModified($podcast_data{'date_posted'});
line 166: 	}
line 167: 	
line 168: 	if($Templates::path =~ /\/bookit\//) {
line 169: 		if($Templates::in{'record'}) {
line 170: 			my(%data);
line 171: 			&Database::GetRow($Templates::in{'record'},'MARKETING_CALL',\%data);
line 172: 			$html_title = "$data{'headline'} | Publishers Weekly";
line 173: 		}
line 174: 		else {
line 175: 			$html_title = "BookIt | Publishers Weekly";	
line 176: 		}
line 177: 	}
line 178: 	if($Templates::path =~ /\/newsbrief\//) {
line 179: 		if($Templates::in{'record'}) {
line 180: 			my(%data);
line 181: 			&Database::GetRow($Templates::in{'record'},'NEWS_BRIEFS',\%data);
line 182: 			$html_title = "$data{'headline'}";
line 183: 			$twitter_title = "$data{'headline'}";
line 184: 			$meta_description = "$data{'abstract'}";
line 185: 			$twitter_description = "$data{'abstract'}";
line 186: 			if($data{'image__file'}) {
line 187: 				$default_image = "http://www.publishersweekly.com/images/data/$data{'image__file'}";
line 188: 			}
line 189: 		}
line 190: 		else {
line 191: 			$html_title = "BookIt | Publishers Weekly";	
line 192: 		}
line 193: 	}
line 194: 
line 195: 	if($Templates::path =~ /\/charlie\//) {
line 196: 			$html_title = "Publishers Weekly's Tribute to Freedom of Expression";
line 197: 			$twitter_title = "Publishers Weekly's Tribute to Freedom of Expression";
line 198: 			$meta_description = "Find out how to participate in a special section of the January 19 issue of Publishers Weekly and raise money for international nonprofits dedicated to freedom of expression.";
line 199: 			$twitter_description = "Find out how to participate in a special section of the January 19 issue of Publishers Weekly and raise money for international nonprofits dedicated to freedom of expression.";
line 200: 	}
line 201: 	
line 202: 	if($Templates::path =~ /\/authorpage\//) {
line 203: 		my $author = $LayoutManager::url_values{'AUTHORNAME'};
line 204: 		$author =~ s/-/ /g;
line 205: 		$author =~ s/([\w']+)/\u\L$1/g;
line 206: 		$html_title = "Books by $author and Complete Book Reviews";
line 207: 		$meta_description = "Read more about "" and other books by $author";
line 208: 	}
line 209: 
line 210: 	# use defailts is nothing else found
line 211: 	if(!$html_title) { $html_title = $default_title; };
line 212: 	if(!$meta_description) { $meta_description = $default_description; };
line 213: 	if(!$meta_keywords) { $meta_keywords = $default_keywords; };
line 214: 	
line 215: 	$html_title =~ s/\"//g;
line 216: 	$meta_description =~ s/\"//g;
line 217: 	$meta_description =~ s/<\/[^>]*>//g;
line 218: 	$meta_description =~ s/<[^>]*>//g;
line 219: 	$meta_description =~ s/<\/[^>]*//g;
line 220: 	$meta_description =~ s/<[^>]*//g;
line 221: 	$twitter_description =~ s/<\/[^>]*>//g;		
line 222: 	$twitter_description =~ s/<[^>]*>//g;
line 223: 	$twitter_description =~ s/<\/[^>]*//g;		
line 224: 	$twitter_description =~ s/<[^>]*//g;		
line 225: 	$meta_keywords =~ s/\"//g;
line 226: 	
line 227: 	&Templates::SetTitle($html_title);
line 228: 	&Templates::SetMeta("<meta name=\"keywords\" content=\"$meta_keywords\">");
line 229: 	&Templates::SetMeta("<meta name=\"description\" content=\"$meta_description\">");
line 230: 	if($last_modified) {
line 231: 		&Templates::SetMeta("<meta http-equiv=\"last-modified\" content=\"$last_modified\">");	
line 232: 	}
line 233: 	&Templates::SetMeta("<meta property=\"og:type\" content=\"article\"/>"); 
line 234: 	&Templates::SetMeta("<meta property=\"og:title\" content=\"$html_title\"/>"); 
line 235: 	&Templates::SetMeta("<meta property=\"og:image\" content=\"$default_image\"/>"); 
line 236: 	&Templates::SetMeta("<meta property=\"og:description\" content=\"$meta_description\"/>");
line 237: 	&Templates::SetMeta("<meta property=\"og:site_name\" content=\"PublishersWeekly.com\"/>"); 
line 238: 
line 239: 	&Templates::SetMeta("<meta name=\"twitter:card\" content=\"summary\"/>");		
line 240: 	&Templates::SetMeta("<meta name=\"twitter:site\" content=\"\@publisherswkly\"/>");		
line 241: 	if($twitter_creator){
line 242: 		&Templates::SetMeta("<meta name=\"twitter:creator\" content=\"$twitter_creator\"/>");			
line 243: 	}
line 244: 	&Templates::SetMeta("<meta name=\"twitter:title\" content=\"$twitter_title\"/>");
line 245: 	&Templates::SetMeta("<meta name=\"twitter:description\" content=\"$twitter_description\"/>");			
line 246: 	&Templates::SetMeta("<meta name=\"twitter:image\" content=\"$default_image\"/>"); 
line 247: 
line 248: 	
line 249: 	sub GetLastModified {
line 250: 		my($timestamp) = @_;
line 251: 		
line 252: 		my($mod);
line 253: 		
line 254: 		if(length($timestamp > 8)) {
line 255: 			$mod = substr($timestamp,0,4) . '-' . substr($timestamp,4,2) . '-' . substr($timestamp,6,2);
line 256: 		}
line 257: 		
line 258: 		return $mod;
line 259: 	}
line 260:  };
line 261: &doEval();
line 262: 1;