module Sources::Strategies class Twitter < Base PAGE = %r!\Ahttps?://(?:mobile\.)?twitter\.com!i PROFILE = %r!\Ahttps?://(?:mobile\.)?twitter.com/(?[a-z0-9_]+)!i # https://pbs.twimg.com/media/EBGbJe_U8AA4Ekb.jpg # https://pbs.twimg.com/media/EBGbJe_U8AA4Ekb?format=jpg&name=900x900 BASE_IMAGE_URL = %r!\Ahttps?://pbs\.twimg\.com/media!i FILENAME1 = %r!(?[a-zA-Z0-9_-]+)\.(?\w+)!i FILENAME2 = %r!(?[a-zA-Z0-9_-]+)\?.*format=(?\w+)!i IMAGE_URL = %r!#{BASE_IMAGE_URL}/#{Regexp.union(FILENAME1, FILENAME2)}!i # Twitter provides a list but it's inaccurate; some names ('intent') aren't # included and other names in the list aren't actually reserved. # https://developer.twitter.com/en/docs/developer-utilities/configuration/api-reference/get-help-configuration RESERVED_USERNAMES = %w[home i intent search] # List of hashtag suffixes attached to tag other names # Ex: 西住みほ生誕祭2019 should be checked as 西住みほ # The regexes will not match if there is nothing preceding # the pattern to avoid creating empty strings. COMMON_TAG_REGEXES = [ /(?