posts: fix exception when post has source like 'https://www.twitter.com/username'.
`twitter.com` sources worked but `www.twitter.com` didn't. Also match the URL by class instead of by site name to ensure we match the expected class.
This commit is contained in:
@@ -29,7 +29,8 @@ class Source::URL::Twitter < Source::URL
|
||||
attr_reader :status_id, :twitter_username, :user_id
|
||||
|
||||
def self.match?(url)
|
||||
url.host.in?(%w[twitter.com mobile.twitter.com pic.twitter.com pbs.twimg.com video.twimg.com t.co])
|
||||
return false if Source::URL::TwitPic.match?(url) # TwitPic uses https://o.twimg.com/ URLs
|
||||
url.domain.in?(%w[twitter.com twimg.com t.co])
|
||||
end
|
||||
|
||||
def parse
|
||||
|
||||
Reference in New Issue
Block a user