diff options
author | Yorhel <git@yorhel.nl> | 2011-04-10 10:00:34 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2011-04-10 13:29:09 +0200 |
commit | d1937fbfbc4996a524fe1649c081d9a486a34ab7 (patch) | |
tree | 4759db4be107592aba6d8e0ae88e17b6844d7441 | |
parent | 715f47095c359d0a9c25ea8b6c3af635cc0d8658 (diff) |
affiliates: Added support for URL modifying and default version string
And updated the notes files.
-rw-r--r-- | data/notes/sponsored-links | 24 | ||||
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 11 |
2 files changed, 18 insertions, 17 deletions
diff --git a/data/notes/sponsored-links b/data/notes/sponsored-links index c31001d2..222553aa 100644 --- a/data/notes/sponsored-links +++ b/data/notes/sponsored-links @@ -1,7 +1,7 @@ Advertisements -Last modified: 2011-01 -Status: Long-term plans / nothing implemented yet +Last modified: 2011-04-10 +Status: Implemented / Implementation may differ from these notes Idea: (semi-)large "Buy now" / "Download now" button on VN pages, linking @@ -26,24 +26,18 @@ Possible parties interested in advertising: - Play-asia Has an affiliate system that includes direct links stores JAN, UPC, and catalog numbers -- Himeyashop / Erogeshop - Has no affiliate system but has shown interest in link exchanges in the past - Does not store JAN/UPC/catalog numbers - "Temporarily" closed, so probably not a good time to ask for ads? - DLSite English - Seems to have an affiliate system, haven't really looked at it yet + Has an affiliate system that includes direct links Most releases don't even have a JAN code or catalog number - MangaGamer Rather specific "shop", but could count as one. Has no affiliate system, but is planning to add one, as announced in http://mangagamer.wordpress.com/2010/12/31/holidays-passing/ Releases don't have catalog numbers or EAN codes -- Eroge-Europe.com - Seems to have an affiliate system, haven't really looked at it yet - Does not store JAN/UPC/catalog numbers - PaletWeb Has no affiliate system Does have JAN codes for a few titles, but inconsistent + Rather messy website... finding/updating links will be a chore - CDJapan Doesn't have that many VNs from what I've browsed, but still several Has an affiliate system (seems to include direct links) @@ -52,6 +46,13 @@ Possible parties interested in advertising: Does not seem to have many VNs (3 or 4?) Has no affiliate system Does not have JAN or catalog numbers +- Himeyashop / Erogeshop (out of business?) + Has no affiliate system but has shown interest in link exchanges in the past + Does not store JAN/UPC/catalog numbers + "Temporarily" closed, so probably not a good time to ask for ads? +- Eroge-Europe.com (out of business?) + Seems to have an affiliate system, haven't really looked at it yet + Does not store JAN/UPC/catalog numbers So who is going to update all those links? @@ -103,6 +104,3 @@ Three possibilities: special-case advertisers and give them special treatment or fetch additional information. -I would greatly prefer option #1, but since that's not very practical option -#3 (the VGMdb-like solution) is probably the best. - diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index 0c9a6754..0fe71297 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -416,17 +416,20 @@ sub _affiliate_links { my $en = VNDB::L10N->get_handle('en'); Tr; td colspan => 2, id => 'buynow'; # don't call it "affiliate", most adblock filters have that included >_> - h1; a href => $links->[0]{url}, 'Buy now!'; end; + h1; a rel => 'nofollow', href => $self->{affiliates}[$links->[0]{affiliate}]{link_format} ? $self->{affiliates}[$links->[0]{affiliate}]{link_format}->($links->[0]{url}) : $links->[0]{url}, 'Buy now!'; end; ul; for my $link (@$links) { - li; a href => $link->{url}; + my $f = $self->{affiliates}[$link->{affiliate}]; + li; a rel => 'nofollow', href => $f->{link_format} ? $f->{link_format}->($link->{url}) : $link->{url}; use utf8; txt '→ '; - txt $link->{version} || join(', ', map $en->maketext("_lang_$_"), @{$r{$link->{rid}}{languages}}).' version'; + txt $link->{version} + || ($f->{default_version} && $f->{default_version}->($self, $link, $r{$link->{rid}})) + || join(', ', map $en->maketext("_lang_$_"), @{$r{$link->{rid}}{languages}}).' version'; txt ' '; acronym class => 'pricenote', title => sprintf('Last updated: %s.', $en->age($link->{lastfetch})), "for $link->{price}*" if $link->{price}; - txt " at $self->{affiliates}[$link->{affiliate}]{name}."; + txt " at $f->{name}."; end; end; } end; |