Skip to content

Commit

Permalink
Use pretty_uri in results if available (smicallef#1582)
Browse files Browse the repository at this point in the history
Per WhatsMyName docs:

"pretty_uri" : "if the check_uri is for an API, this OPTIONAL element can show a human-readable page",

so return this instead of the raw API results if is available.
  • Loading branch information
jocejocejoe authored Oct 18, 2021
1 parent 20c4509 commit 5bd2d70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/sfp_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ def checkSite(self, name, site):
return

url = site['check_uri'].format(account=name)
retname = f"{site['name']} (Category: {site['category']})\n<SFURL>{url}</SFURL>"
if 'pretty_uri' in site:
ret_url = site['pretty_uri'].format(account=name)
else:
ret_url = url
retname = f"{site['name']} (Category: {site['category']})\n<SFURL>{ret_url}</SFURL>"

res = self.sf.fetchUrl(
url,
Expand Down

0 comments on commit 5bd2d70

Please sign in to comment.