Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class Types:
INVALID = 'invalid'
INDIRECT = 'indirect'
DIRECT = 'direct'
SEARCH = 'search'
SOCIAL = 'social'
EMAIL = 'email'
USER_AGENT_SUBSTRINGS = [
(['Twitter'], {'tld': 'com', 'domain': 'twitter', 'url': 'twitter://twitter.com', 'registered_domain': 'twitter.com'}),
(['Pinterest'], {'tld': 'com', 'domain': 'pinterest', 'url': 'pinterest://pinterest.com', 'registered_domain': 'pinterest.com'}),
(['FBAV', 'Facebook'], {'tld': 'com', 'domain': 'facebook', 'url': 'facebook://facebook.com', 'registered_domain': 'facebook.com'}),
]
BLANK_REFERRER = {
'type': Types.INVALID,
'url': '',
'subdomain': '',
'domain': '',
'label': '',
'tld': '',
'path': '',
'query': ''
}
rules = Ruleset().rules
@staticmethod
def parse_query_string(url, parameters):
if not parameters:
return ''
INVALID = 'invalid'
INDIRECT = 'indirect'
DIRECT = 'direct'
SEARCH = 'search'
SOCIAL = 'social'
EMAIL = 'email'
USER_AGENT_SUBSTRINGS = [
(['Twitter'], {'tld': 'com', 'domain': 'twitter', 'url': 'twitter://twitter.com', 'registered_domain': 'twitter.com'}),
(['Pinterest'], {'tld': 'com', 'domain': 'pinterest', 'url': 'pinterest://pinterest.com', 'registered_domain': 'pinterest.com'}),
(['FBAV', 'Facebook', 'FBAN', 'FB_IAB'], {'tld': 'com', 'domain': 'facebook', 'url': 'facebook://facebook.com', 'registered_domain': 'facebook.com'}),
(['Instagram'], {'tld': 'com', 'domain': 'instagram', 'url': 'instagram://instagram.com', 'registered_domain': 'instagram.com'}),
]
BLANK_REFERRER = {
'type': Types.INVALID,
'url': '',
'subdomain': '',
'domain': '',
'label': '',
'tld': '',
'path': '',
'query': ''
}
rules = Ruleset().rules
@staticmethod
def parse_query_string(url, parameters):
if not parameters:
return ''