Support referrer matching for seiga and da

This commit is contained in:
Toks
2014-05-08 20:25:11 -04:00
parent 6de67da280
commit 0a75402cc7
2 changed files with 16 additions and 0 deletions

View File

@@ -5,6 +5,14 @@ module Sources
url =~ /^https?:\/\/(?:.+?\.)?deviantart\.(?:com|net)/
end
def referer_url(template)
if template.params[:ref] =~ /deviantart\.com\/art\//
template.params[:ref]
else
template.params[:url]
end
end
def site_name
"Deviant Art"
end

View File

@@ -5,6 +5,14 @@ module Sources
url =~ /^https?:\/\/(?:\w+\.)?nico(?:seiga|video)\.jp/
end
def referer_url(template)
if template.params[:ref] =~ /seiga\.nicovideo\.jp\/seiga\/im\d+/
template.params[:ref]
else
template.params[:url]
end
end
def site_name
"Nico Seiga"
end