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