Fix #3669: Normalize mobile.twitter.com sources.
* Normalize sources to https://twitter.com/#{artist_name}/status/#{status_id} after upload. * Make fetch source data use screen name instead of display name for the artist name.
This commit is contained in:
@@ -7,11 +7,15 @@ module Sources::Strategies
|
|||||||
end
|
end
|
||||||
|
|
||||||
def referer_url
|
def referer_url
|
||||||
if self.class.url_match?(@referer_url)
|
normalized_url
|
||||||
@referer_url
|
end
|
||||||
else
|
|
||||||
@url
|
def normalized_url
|
||||||
end
|
"https://twitter.com/#{artist_name}/status/#{status_id}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def artist_name
|
||||||
|
api_response.attrs[:user][:screen_name]
|
||||||
end
|
end
|
||||||
|
|
||||||
def site_name
|
def site_name
|
||||||
@@ -24,7 +28,6 @@ module Sources::Strategies
|
|||||||
|
|
||||||
def get
|
def get
|
||||||
attrs = api_response.attrs
|
attrs = api_response.attrs
|
||||||
@artist_name = attrs[:user][:name]
|
|
||||||
@profile_url = "https://twitter.com/" + attrs[:user][:screen_name]
|
@profile_url = "https://twitter.com/" + attrs[:user][:screen_name]
|
||||||
@image_urls = TwitterService.new.image_urls(api_response)
|
@image_urls = TwitterService.new.image_urls(api_response)
|
||||||
@image_url = @image_urls.first
|
@image_url = @image_urls.first
|
||||||
@@ -62,7 +65,7 @@ module Sources::Strategies
|
|||||||
end
|
end
|
||||||
|
|
||||||
def status_id
|
def status_id
|
||||||
self.class.status_id_from_url(referer_url)
|
self.class.status_id_from_url(@url) || self.class.status_id_from_url(@referer_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
# https://twitter.com/i/web/status/943446161586733056
|
# https://twitter.com/i/web/status/943446161586733056
|
||||||
|
|||||||
Reference in New Issue
Block a user