public string IDUser(string ID) { try { WebApiCalls w1 = new WebApiCalls(); string api = w1.DownloadString("http://api.roblox.com/Users/" + ID); return(SubString.subString(api, "\"Username\":", ",")); } catch (Exception ex) { throw new InvalidRobloxAPIException(ex.ToString()); } }
public string[] RecentlyPlayedList() { string[] listOfGames = new string[3]; string cutString = GetValuesTemplate("Recently Played", "Friend Activity");// made the string smaller for efficiency for (int i = 0; i < 3; i++) { listOfGames[i] = SubString.subString(cutString, "title=\"", "\"", i); Regex remEx = new Regex(Regex.Escape("title=\"")); cutString = remEx.Replace(cutString, "", 1); } return(listOfGames); }
public long UserToId(string user) { try { WebApiCalls w1 = new WebApiCalls(); long x; string stringDownload = w1.DownloadString("http://api.roblox.com/users/get-by-username?username="******"\"Id\":", ",\"U"); if (Int64.TryParse(returnString, out x)) { return(x); } else { throw new InvalidRobloxWebApiException("An error occured downloading from the web api, make sure the username is being used"); } } catch (Exception ex) { throw new InvalidRobloxWebApiException(ex.ToString()); } }
public string[] GetFriendsNames() { int x = Regex.Matches(Tokens.accountDetails, "list-item friend").Count; string[] usernames = new string[x]; if (usernames.Length == 0) { string[] noFriends = new string[1]; noFriends[0] = "No Friends Found"; return(noFriends); } string cutString = GetValuesTemplate("hlist friend-list", "Recently Played");// made the string smaller for efficiency for (int i = 0; i < x; i++) { usernames[i] = SubString.subString(cutString, "\"text-overflow friend-name\">", "</span>", i); Regex remEx = new Regex(Regex.Escape("\"text-overflow friend-name\">")); cutString = remEx.Replace(cutString, "", 1); } return(usernames); }