-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteamapi.py
60 lines (54 loc) · 2.9 KB
/
steamapi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import requests
import re
import getpass
import sys
import time
import ctypes
from tkinter import *
def weapon():
WEAPON = input("Weapon name: ")
SKIN = input("Skin: ")
EXTERIOR = input("Exterior type (FN/MW/FT/WW/BS): ").lower()
STAT = input('StatTrak (Y/N): ').lower()
WEAPONS = WEAPON
WEAPON = re.sub(r"\s+", '%20', WEAPON)
if STAT == "y" :
root.title("StatTrak " + WEAPONS +" "+ SKIN + " | " + EXTERIOR)
lbl = Label(root, font = ('source code pro', 20, 'bold'), background = 'black', foreground = 'pink')
lbl.config(text = 'Prices start at ' + requests.get("https://steamcommunity.com/market/priceoverview/?appid=730&market_hash_name=" + WEAPON + "%20%7C%20" + SKIN + "%20" + "%28" + EXTERIOR + "%29" + "¤cy=24").json()['lowest_price']+ "\n" + 'Currently '+ requests.get("https://steamcommunity.com/market/priceoverview/?appid=730&market_hash_name=" + WEAPON + "%20%7C%20" + SKIN + "%20" + "%28" + EXTERIOR + "%29" + "¤cy=24").json()['volume'] + ' units are available in the market')
lbl.pack(anchor = 'center')
root.mainloop()
def agent():
AGENT = input("Agent: ")
GROUP = input("Group: ")
root = Tk()
root.title(AGENT + " | " + EXTERIOR)
lbl = Label(root, font = ('source code pro', 20, 'bold'), background = 'black', foreground = 'pink')
lbl.config(text = 'Prices start at '+ requests.get("https://steamcommunity.com/market/priceoverview/?currency=24&appid=730&market_hash_name=" + AGENT + "%20%7C%20" + GROUP).json()['lowest_price']+ "\n" + 'Currently '+ requests.get("https://steamcommunity.com/market/priceoverview/?currency=24&appid=730&market_hash_name=" + AGENT + "%20%7C%20" + GROUP).json()['volume'] + ' units are available in the market')
lbl.pack(anchor = 'center')
root.mainloop()
def case():
CASE = input("Case: ")
root = Tk()
root.title(CASE + " Case")
lbl = Label(root, font = ('source code pro', 20, 'bold'), background = 'black', foreground = 'pink')
lbl.config(text = 'Prices start at '+ requests.get("https://steamcommunity.com/market/priceoverview/?currency=24&appid=730&market_hash_name=" + CASE).json()['lowest_price'] + "\n" + 'Currently '+ requests.get("https://steamcommunity.com/market/priceoverview/?currency=24&appid=730&market_hash_name=" + CASE).json()['volume'] + ' units are available in the market')
lbl.pack(anchor = 'center')
root.mainloop()
def init_input():
TYPE = input("Choose type from (Weapon/Agent/Case): ").lower()
if TYPE == "weapon":
weapon()
elif TYPE == "agent":
agent()
elif TYPE == "case":
case()
else:
root = Tk()
root.title('INCORRECT RESPONSE !')
lbl = Label(root, font = ('source code pro', 20, 'bold'), background = 'black', foreground = 'pink')
lbl.config(text = 'Please enter a valid response.')
lbl.pack(anchor = 'center')
root.mainloop()
init_input()
init_input()