-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrobloxpy.py
170 lines (170 loc) · 6.44 KB
/
robloxpy.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import requests
# These are all GET requests from the Roblox Web API
# API: http://wiki.roblox.com/index.php?title=Web_APIs
# API Wrapper made by Cameron
class User:
def badges(id):
url = "https://www.roblox.com/badges/roblox?userId=" + str(id)
r = requests.get(url)
res = r.json()['RobloxBadges']
return res
def is_online(username):
url = "https://api.roblox.com/users/get-by-username?username=" + username
r = requests.get(url)
res = r.json()['IsOnline']
return res
def id(username):
url = "https://api.roblox.com/users/get-by-username?username=" + username
r = requests.get(url)
res = r.json()['Id']
return res
def does_user_exist(username):
url = "https://www.roblox.com/UserCheck/DoesUsernameExist?username=" + username
r = requests.get(url)
res = r.json()['success']
return res
def friend_count(id):
url = "https://www.roblox.com/friends/json?userId=" + str(id) + "¤tPage=0&pageSize=20&imgWidth=110&imgHeight=110&imgFormat=jpeg&friendsType=BestFriends"
r = requests.get(url)
res = r.json()['TotalFriends']
return res
class Group:
def description(id):
url = "https://api.roblox.com/groups/" + str(id)
r = requests.get(url)
return(r.json())['Description']
def name(id):
url = "https://api.roblox.com/groups/" + str(id)
r = requests.get(url)
return(r.json()['Name'])
def owner(id):
url = "https://api.roblox.com/groups/" + str(id)
r = requests.get(url)
res = r.json()['Owner']['Name']
return res
def owner_id(id):
url = "https://api.roblox.com/groups/" + str(id)
r = requests.get(url)
res = r.json()['Owner']['Id']
return res
class Asset:
def asset_id(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['AssetId']
return res
def creator(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Creator']['Name']
return res
def creator_id(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Creator']['Id']
return res
def is_public(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['IsPublicDomain']
return res
def product_id(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['ProductId']
return res
def name(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Name']
return res
def description(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Description']
return res
def asset_type_id(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['AssetTypeId']
return res
def created_at(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Created']
return res
def last_updated(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Updated']
return res
def price_in_robux(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['PriceInRobux']
return res
def price_in_tickets(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['PriceInTickets']
return res
def sales(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Sales']
return res
def is_new(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['IsNew']
return res
def is_for_sale(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['IsForSale']
return res
def is_limited(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['IsLimited']
return res
def remaining(id):
url = "https://api.roblox.com/Marketplace/ProductInfo?assetId=" + str(id)
r = requests.get(url)
res = r.json()['Remaining']
return res
def thumbnail(id):
url = "https://www.roblox.com/Thumbs/Asset.ashx?width=110&height=110&assetId=" + str(id)
r = requests.get(url, allow_redirects=True)
return r.url
class Image:
'''Get an image of a torso, head,, outfit, or asset'''
def get_torso_thumbnail(id):
url = "https://www.roblox.com/bust-thumbnail/json?userId=" + str(id) + "&height=180&width=180"
r = requests.get(url)
res = r.json()['Url']
return res
def get_head_thumbnail(id):
url = "https://www.roblox.com/headshot-thumbnail/json?userId=" + str(id) + "&height=180&width=180"
r = requests.get(url)
res = r.json()['Url']
return res
def get_outfit_thumbnail(id):
url = "https://www.roblox.com/outfit-thumbnail/json?userId=" + str(id) + "&height=180&width=180"
r = requests.get(url)
res = r.json()['Url']
return res
def get_asset_thumbnail(id):
url = "https://www.roblox.com/Thumbs/Asset.ashx?width=110&height=110&assetId=" + str(id)
r = requests.get(url)
res = r.json()['Url']
return res
def get_big_asset_thumbnail(id):
url = "https://www.roblox.com/Thumbs/Asset.ashx?width=200&height=200&assetId=" + str(id)
r = requests.get(url, allow_redirects=True)
return r.url
class Friends:
def are_user_friendship(id1, id2):
print("not done yet")
def are_users_best_friends(id1, id2):
print("not done yet")