Skip to content

Commit

Permalink
Update snailpy.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nmsderp authored Mar 24, 2024
1 parent e70d24a commit 25f6d1b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions snailpy/snailpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ def get_follower_count(username):
def id_to_name(args):
url = f'{api_url}/api/pmWrapper/getProject?id={args["WHO"]}'

try:
response = requests.get(url)

if response.status_code == 200:
json_data = response.json()
return json_data.get('name', '')
else:
return ""
except Exception as e:
print(f"An error occurred: {e}")
return ""
def id_to_icon(args):
url = f'{api_url}/api/pmWrapper/iconUrl?id={args["WHO"]}'

try:
response = requests.get(url)

Expand Down

0 comments on commit 25f6d1b

Please sign in to comment.