Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit df7ef2e

Browse files
update
1 parent 6adedc5 commit df7ef2e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Authors
2222

2323
jshackles and Stumpokapow
2424

25+
Optimized and rewritten by kajchang.
26+
2527
steam-idle was writen in C# using Steamworks.NET and CSteamworks by Riley Labrecque
2628

2729
License

‎start.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,24 @@ def __init__(self, **settings):
4747

4848
self.logger.info("Finding games that have card drops remaining")
4949

50-
self.getBadges()
50+
self.games=self.getGames()
5151

52-
def getBadges(self):
53-
badgeSoup = BeautifulSoup(
52+
def getGames(self):
53+
gameSoup = BeautifulSoup(
5454
self.session.get("http://steamcommunity.com/profiles/{}/badges".format(self.id_)).text,
5555
"html.parser")
5656

5757
games = [
5858
Game(
59-
re.match(r"([0-9]+|(No)) card drops? remaining", game.find("span", {"progress_info_bold"}).text).group(1) if re.match(r"([0-9]+|(No)) card drops? remaining", game.find("span", {"class": "progress_info_bold"}).text).group(1) != "No" else 0,
59+
int(re.match(r"([0-9]+|(No)) card drops? remaining", game.find("span", {"class": "progress_info_bold"}).text).group(1)) if re.match(r"([0-9]+|(No)) card drops? remaining", game.find("span", {"class": "progress_info_bold"}).text).group(1) != "No" else 0,
6060
int(re.match(r"https:\/\/steamcommunity.com\/id\/.+\/gamecards\/([0-9]{6})\/", game.find("a", {"class": "badge_row_overlay"})["href"]).group(1)),
6161
game.find("div", {"class": "badge_title"}).text.replace("View details", "").strip()
62-
) for game in filter(lambda p: re.match(r"https:\/\/steamcommunity.com\/id\/.+\/gamecards\/([0-9]{6})\/", p.find("a", {"class": "badge_row_overlay"})["href"]) and p.find("span", {"class": "progress_info_bold"}), badgeSoup.find_all("div", {"class": "badge_row"})[:-1])
62+
) for game in filter(lambda p: re.match(r"https:\/\/steamcommunity.com\/id\/.+\/gamecards\/([0-9]{6})\/", p.find("a", {"class": "badge_row_overlay"})["href"]) and p.find("span", {"class": "progress_info_bold"}), gameSoup.find_all("div", {"class": "badge_row"})[:-1])
6363
]
6464

65-
self.logger.info(Fore.GREEN + "Found {} Games.".format(len(games)) + Fore.RESET)
65+
self.logger.info(Fore.GREEN + "Found {} games and {} trading cards to idle".format(
66+
len(games),
67+
sum(game.cardsLeft for game in games)) + Fore.RESET)
6668

6769
return games
6870

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /