refactored source code, work on pixiv integration

This commit is contained in:
albert
2011-09-26 16:47:22 -04:00
parent 11b623c66b
commit 284141aace
19 changed files with 201 additions and 45 deletions

View File

@@ -3,13 +3,21 @@ module Sources
class Pixiv < Base
attr_reader :artist_name, :profile_url, :image_url, :tags
def initialize(url)
super
get
def self.url_match?(url)
url =~ /^https?:\/\/(?:\w+\.)?pixiv\.net/
end
def is_pixiv?
url =~ /pixiv\.net/
def initialize(url)
super
end
def site_name
"Pixiv"
end
def unique_id
image_url =~ /\/img\/([^\/]+)/
$1
end
def get