forked from AltoForkings/roblox-stream-sniper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Roblox.cs
29 lines (25 loc) · 1.14 KB
/
Roblox.cs
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
using System.Collections.Generic;
using kk33.RbxStreamSniper.Json;
using Newtonsoft.Json;
namespace kk33.RbxStreamSniper
{
public static class Roblox
{
public static string GetOwnId(string cookie)
{
return HttpHelpers.Get($"https://www.roblox.com/game/GetCurrentUser.ashx", cookie);
}
public static PlaceInstances GetPlaceInstances(string placeId, int page, string cookie)
{
return JsonConvert.DeserializeObject<PlaceInstances>(HttpHelpers.Get($"https://www.roblox.com/games/getgameinstancesjson?placeId={placeId.Trim()}&startindex={page * 10}", cookie));
}
public static string GetAvatarHeadshotUrl(string userid, int size = 48)
{
return HttpHelpers.GetRedirectLocation($"https://www.roblox.com/headshot-thumbnail/image?userId={userid.Trim()}&width={size}&height={size}&format=png");
}
public static Place FindFirstPlace(string searchTerm)
{
return JsonConvert.DeserializeObject<List<Place>>(HttpHelpers.Get($"https://www.roblox.com/games/list-json?MaxRows=1&Keyword={searchTerm.Trim()}"))[0];
}
}
}