Unit WebUnit
Description
Web Unit
Overview
Functions and Procedures
function GetOrgDataAndLogoURL(const Nickname: string; out OrgName: string; out LogoURL: UnicodeString): Boolean; |
function GetOrLoadOrgLogoToStream(const OrgName: string; const LogoURL: UnicodeString; TargetStream: TStream): Boolean; |
function GetAvatarDataAndLogoURL(const Nickname: string; out LogoURL: UnicodeString): Boolean; |
function GetOrLoadAvatarLogoToStream(const Nickname: string; const LogoURL: UnicodeString; TargetStream: TStream): Boolean; |
function RegExOrgLogoURL(OrgName: String): String; |
Constants
HTTPSPrefix = UnicodeString('https://'); |
StarToolsAgent = 'StarTools Agent/' + UnicodeString(StarToolsVersionMM); |
RobertsSpaceIndustriesHost = UnicodeString('robertsspaceindustries.com'); |
RobertsSpaceIndustriesCDNHost = UnicodeString('cdn.robertsspaceindustries.com'); |
RobertsSpaceIndustriesStatusHost = UnicodeString('status.robertsspaceindustries.com'); |
ENCitizenPrefix = UnicodeString('/en/citizens/'); |
ENOrgsPrefix = UnicodeString('/en/orgs/'); |
RegExAvatarLogoURL = '(?:"\/account\/profile"|id\s*=\s*"public-profile".*?UEE Citizen Record).*?<img\s+src\s*=\s*"([ˆ>\s"]+)'; |
RegExOrgLogoURLPrefix = '<a\s+href\s*=\s*"\/orgs\/'; |
RegExOrgLogoURLSuffix = '"\s*>\s*<img\s+src\s*=\s*"([ˆ>\s"]+)"'; |
RegExOrgSID = '<span[ˆ>]*>\s*Spectrum\s+Identification\s+\(SID\)\s*<\/span>\s*<strong[ˆ>]*>\s*([ˆ<\s]+)'; |
Description
Functions and Procedures
function GetOrgDataAndLogoURL(const Nickname: string; out OrgName: string; out LogoURL: UnicodeString): Boolean; |
|
Scrapes the public dossier of a user to retrieve Organization details. Parameters
Returns
|
function GetOrLoadOrgLogoToStream(const OrgName: string; const LogoURL: UnicodeString; TargetStream: TStream): Boolean; |
|
Retrieves an organization logo, prioritising the local cache over the network. If the file exists in the cache, it is loaded into the stream. Otherwise, it is downloaded and saved locally. Parameters
Returns
|
function GetAvatarDataAndLogoURL(const Nickname: string; out LogoURL: UnicodeString): Boolean; |
|
Scrapes the public dossier of a user to retrieve the Avatar logo URL. Parameters
Returns
|
function GetOrLoadAvatarLogoToStream(const Nickname: string; const LogoURL: UnicodeString; TargetStream: TStream): Boolean; |
|
Retrieves a citizen's avatar logo, prioritising the local cache over the network. If the file exists in the cache, it is loaded into the stream. Otherwise, it is downloaded and saved locally. Parameters
Returns
|
function RegExOrgLogoURL(OrgName: String): String; |
|
Constructs a complete regular expression to find an organization's logo URL based on its name. Parameters
ReturnsA string containing the formatted Regular Expression. |
Constants
HTTPSPrefix = UnicodeString('https://'); |
|
Standard HTTPS protocol prefix. |
StarToolsAgent = 'StarTools Agent/' + UnicodeString(StarToolsVersionMM); |
|
User-Agent string used for WinHttp requests. |
RobertsSpaceIndustriesHost = UnicodeString('robertsspaceindustries.com'); |
|
Main RSI website domain. |
RobertsSpaceIndustriesCDNHost = UnicodeString('cdn.robertsspaceindustries.com'); |
|
RSI Content Delivery Network domain. |
RobertsSpaceIndustriesStatusHost = UnicodeString('status.robertsspaceindustries.com'); |
|
RSI Service Status domain. |
ENCitizenPrefix = UnicodeString('/en/citizens/'); |
|
URL path prefix for public citizen profiles. |
ENOrgsPrefix = UnicodeString('/en/orgs/'); |
|
URL path prefix for public organization profiles. |
RegExAvatarLogoURL = '(?:"\/account\/profile"|id\s*=\s*"public-profile".*?UEE Citizen Record).*?<img\s+src\s*=\s*"([ˆ>\s"]+)'; |
|
Regular expression to extract the Avatar image URL from a citizen's dossier page. |
RegExOrgLogoURLPrefix = '<a\s+href\s*=\s*"\/orgs\/'; |
|
Prefix for the regular expression used to find the organization logo link. |
RegExOrgLogoURLSuffix = '"\s*>\s*<img\s+src\s*=\s*"([ˆ>\s"]+)"'; |
|
Suffix for the regular expression used to find the organization logo link. |
RegExOrgSID = '<span[ˆ>]*>\s*Spectrum\s+Identification\s+\(SID\)\s*<\/span>\s*<strong[ˆ>]*>\s*([ˆ<\s]+)'; |
|
Regular expression to extract the Spectrum Identification (SID) from an organization block. |