1
|
|
|
#!/usr/bin/python |
2
|
|
|
# -*- coding: utf-8 -*- |
3
|
|
|
# |
4
|
|
|
# This is an example usage |
5
|
|
|
|
6
|
|
|
import logging |
7
|
|
|
from pprint import pprint |
8
|
|
|
|
9
|
|
|
import kuon.bitskins.api.interfaces as bitskins_interfaces |
10
|
|
|
import kuon.opskins.api.interfaces as opskins_interfaces |
11
|
|
|
import kuon.opskins.common as opskins_common |
12
|
|
|
from kuon.common import * |
13
|
|
|
from kuon.watcher import Watcher |
14
|
|
|
|
15
|
|
|
|
16
|
|
|
class UsageWatcher: |
17
|
|
|
"""Example usage for the watcher class of Kuon""" |
18
|
|
|
|
19
|
|
|
@staticmethod |
20
|
|
|
def watcher(): |
21
|
|
|
"""Example watcher usage |
22
|
|
|
|
23
|
|
|
:return: |
24
|
|
|
""" |
25
|
|
|
Watcher(log_level=logging.INFO) |
26
|
|
|
|
27
|
|
|
|
28
|
|
|
class UsageBitSkins: |
29
|
|
|
"""Example usages for the implementation of the BitSkins API""" |
30
|
|
|
|
31
|
|
|
@staticmethod |
32
|
|
|
def sales_interface(): |
33
|
|
|
"""Example sales interface usage |
34
|
|
|
|
35
|
|
|
:return: |
36
|
|
|
""" |
37
|
|
|
sales_interface = bitskins_interfaces.ISales() |
38
|
|
|
|
39
|
|
|
pprint(sales_interface.get_sales_info(market_hash_name="M4A4 | Howl (Factory New)")) |
40
|
|
|
|
41
|
|
|
@staticmethod |
42
|
|
|
def pricing_interface(): |
43
|
|
|
"""Example pricing interface usage |
44
|
|
|
|
45
|
|
|
:return: |
46
|
|
|
""" |
47
|
|
|
pricing_interface = bitskins_interfaces.IPricing() |
48
|
|
|
pprint(pricing_interface.get_all_item_prices()) |
49
|
|
|
pprint(pricing_interface.get_price_data_for_items_on_sale()) |
50
|
|
|
|
51
|
|
|
@staticmethod |
52
|
|
|
def inventory_interface(): |
53
|
|
|
"""Example pricing interface usage |
54
|
|
|
|
55
|
|
|
:return: |
56
|
|
|
""" |
57
|
|
|
inventory_interface = bitskins_interfaces.IInventory() |
58
|
|
|
pprint(inventory_interface.get_inventory_on_sale()) |
59
|
|
|
|
60
|
|
|
|
61
|
|
|
class UsageOPSkins: |
62
|
|
|
"""Example usages for the implementation of the OPSkins API""" |
63
|
|
|
|
64
|
|
|
@staticmethod |
65
|
|
|
def inventory_interface(): |
66
|
|
|
"""Example inventory interface usage |
67
|
|
|
|
68
|
|
|
:return: |
69
|
|
|
""" |
70
|
|
|
inventory_interface = opskins_interfaces.IInventory() |
71
|
|
|
pprint(inventory_interface.withdraw(['123', '456'])) |
72
|
|
|
|
73
|
|
|
@staticmethod |
74
|
|
|
def cashout_interface(): |
75
|
|
|
"""Example cashout interface usage |
76
|
|
|
|
77
|
|
|
:return: |
78
|
|
|
""" |
79
|
|
|
cashout_interface = opskins_interfaces.ICashout() |
80
|
|
|
pprint(cashout_interface.get_address(opskins_common.Processor.PAYPAL)) |
81
|
|
|
|
82
|
|
|
@staticmethod |
83
|
|
|
def pricing_interface(): |
84
|
|
|
"""Example pricing interface usage |
85
|
|
|
|
86
|
|
|
:return: |
87
|
|
|
""" |
88
|
|
|
pricing_interface = opskins_interfaces.IPricing() |
89
|
|
|
pprint(pricing_interface.get_all_lowest_list_prices()) |
90
|
|
|
|
91
|
|
|
@staticmethod |
92
|
|
|
def status_interface(): |
93
|
|
|
"""Example status interface usage |
94
|
|
|
|
95
|
|
|
:return: |
96
|
|
|
""" |
97
|
|
|
status_interface = opskins_interfaces.IStatus() |
98
|
|
|
pprint(status_interface.get_bot_list().response.bots) |
99
|
|
|
|
100
|
|
|
@staticmethod |
101
|
|
|
def user_interface(): |
102
|
|
|
"""Example user interface usage |
103
|
|
|
|
104
|
|
|
:return: |
105
|
|
|
""" |
106
|
|
|
user_interface = opskins_interfaces.IUser() |
107
|
|
|
pprint(user_interface.get_balance()) |
108
|
|
|
|
109
|
|
|
@staticmethod |
110
|
|
|
def sales_interface(): |
111
|
|
|
"""Example sales interface usage |
112
|
|
|
|
113
|
|
|
:return: |
114
|
|
|
""" |
115
|
|
|
sales_interface = opskins_interfaces.ISales() |
116
|
|
|
|
117
|
|
|
pprint(sales_interface.get_sales(status_type=opskins_common.ItemStatus.SOLD_AND_DELIVERED, |
118
|
|
|
app_id=CommonSteamGames.APP_ID_CSGO)) |
119
|
|
|
pprint(sales_interface.get_last_sales(app_id=CommonSteamGames.APP_ID_CSGO, context_id=ContextIds.VALVE_GAMES, |
120
|
|
|
market_name='AK-47 | Aquamarine Revenge (Field-Tested)')) |
121
|
|
|
pprint(sales_interface.get_last_sales_no_delay(market_name='M4A4 | Howl (Factory New)')) |
122
|
|
|
pprint(sales_interface.search(search_item="howl min", app_id=CommonSteamGames.APP_ID_CSGO)) |
123
|
|
|
|
124
|
|
|
# uses selenium chrome driver so initial call takes a few seconds to initialise the driver |
125
|
|
|
# on second use and later it will take way less time |
126
|
|
|
pprint(sales_interface.search_no_delay(search_item="howl min", app_id=CommonSteamGames.APP_ID_CSGO)) |
127
|
|
|
|
128
|
|
|
|
129
|
|
|
if __name__ == '__main__': |
130
|
|
|
UsageWatcher.watcher() |
131
|
|
|
|