Skip to content

Commit

Permalink
Added saving output to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
xriskon committed Jul 26, 2021
1 parent 51e93b3 commit 70f9e65
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
7 changes: 7 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog

## [0.2](https://github.com/#)
**Enhancements**
- added saving ouput to folder

**Other Fixes**
- grammar and syntax corrections

## [0.1](https://github.com/#)
**Initial Realese**
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def _quit():

if _cmd:
_cmd()
elif cmd == "FILE=Y":
api.set_write_file(True)
elif cmd == "FILE=N":
api.set_write_file(False)
elif cmd == "":
print("")
else:
Expand Down
17 changes: 8 additions & 9 deletions src/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def print_banner(self):
print(f'{self.steamID64} - {self.steamID} [PUBLIC ACCOUNT]')

def change_target(self):
_user = input("New target: ")
_user = input("New target custom URL/steamid64: ")
data = self.__search_user(_user)
if data.get("found"):
self.set_target(data)
else:
print("User was not found")
print("User couldn't not be found")

def set_write_file(self, flag):
if flag:
Expand All @@ -91,15 +91,15 @@ def get_info(self):
response = requests.get(f"https://steamcommunity.com/profiles/{self.steamID64}/?xml=1")
data = xmltodict.parse(response.content)["profile"]
if not ("customURL" in data):
data["customURL"] = "None"
data["customURL"] = "N/A"
if not ("realname" in data):
data["realname"] = "None"
data["realname"] = "N/A"
if not ("location" in data):
data["location"] = "None"
data["location"] = "N/A"
if not ("memberSince" in data):
data["memberSince"] = "None"
data["memberSince"] = "N/A"
result = f"SteamID64: {data['steamID64']}\nCustomURL: {data['customURL']}\nUsername: {data['steamID']}\nReal Name: {data['realname']}\n" \
f"Location: {data['location']}\nVac Ban: {data['vacBanned']}\nTrade Ban: {data['tradeBanState']}\nOnline State: {data['onlineState']}\n" \
f"Location: {data['location']}\nVAC Ban: {data['vacBanned']}\nTrade Ban: {data['tradeBanState']}\nOnline State: {data['onlineState']}\n" \
f"Privacy State: {data['privacyState']}\nMemberSince: {data['memberSince']}"

print(result)
Expand All @@ -123,8 +123,7 @@ def get_friends_list(self):
else:
_user["response"]["players"][0]["personastate"] = "Offline"

table.add_row([friend["steamid"], _user["response"]["players"][0]["personaname"],
_user["response"]["players"][0]["personastate"], friend["friend_since"]])
table.add_row([friend["steamid"], _user["response"]["players"][0]["personaname"], _user["response"]["players"][0]["personastate"], friend["friend_since"]])

print(table)
self.write_to_file(str(table), "friends_list.txt")
Expand Down

0 comments on commit 70f9e65

Please sign in to comment.