Skip to content

Commit

Permalink
Scrape Purchased Tab Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0n00ps committed Apr 24, 2024
1 parent 5d2a956 commit e2deab3
Showing 1 changed file with 52 additions and 12 deletions.
64 changes: 52 additions & 12 deletions OF DL/Helpers/APIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1835,37 +1835,77 @@ public async Task<Dictionary<string, int>> GetPurchasedTabUsers(string endpoint,
{
if (purchase.fromUser != null)
{
JObject user = await GetUserInfoById($"/users/list?x[]={purchase.fromUser.id}", auth);
if (!string.IsNullOrEmpty(user[purchase.fromUser.id.ToString()]["username"].ToString()))
if (users.Values.Contains(purchase.fromUser.id))
{
if (!purchasedTabUsers.ContainsKey(user[purchase.fromUser.id.ToString()]["username"].ToString()) && users.ContainsKey(user[purchase.fromUser.id.ToString()]["username"].ToString()))
if (!string.IsNullOrEmpty(users.FirstOrDefault(x => x.Value == purchase.fromUser.id).Key))
{
purchasedTabUsers.Add(user[purchase.fromUser.id.ToString()]["username"].ToString(), purchase.fromUser.id);
if (!purchasedTabUsers.ContainsKey(users.FirstOrDefault(x => x.Value == purchase.fromUser.id).Key))
{
purchasedTabUsers.Add(users.FirstOrDefault(x => x.Value == purchase.fromUser.id).Key, purchase.fromUser.id);
}
}
else
{
if (!purchasedTabUsers.ContainsKey($"Deleted User - {purchase.fromUser.id}"))
{
purchasedTabUsers.Add($"Deleted User - {purchase.fromUser.id}", purchase.fromUser.id);
}
}
}
else
{
if (!purchasedTabUsers.ContainsKey($"Deleted User - {purchase.fromUser.id}"))
JObject user = await GetUserInfoById($"/users/list?x[]={purchase.fromUser.id}", auth);
if (!string.IsNullOrEmpty(user[purchase.fromUser.id.ToString()]["username"].ToString()))
{
purchasedTabUsers.Add($"Deleted User - {purchase.fromUser.id}", purchase.fromUser.id);
if (!purchasedTabUsers.ContainsKey(user[purchase.fromUser.id.ToString()]["username"].ToString()))
{
purchasedTabUsers.Add(user[purchase.fromUser.id.ToString()]["username"].ToString(), purchase.fromUser.id);
}
}
else
{
if (!purchasedTabUsers.ContainsKey($"Deleted User - {purchase.fromUser.id}"))
{
purchasedTabUsers.Add($"Deleted User - {purchase.fromUser.id}", purchase.fromUser.id);
}
}
}
}
else if (purchase.author != null)
{
JObject user = await GetUserInfoById($"/users/list?x[]={purchase.author.id}", auth);
if (!string.IsNullOrEmpty(user[purchase.author.id.ToString()]["username"].ToString()))
if (users.Values.Contains(purchase.author.id))
{
if (!string.IsNullOrEmpty(user[purchase.author.id.ToString()]["username"].ToString()))
if (!string.IsNullOrEmpty(users.FirstOrDefault(x => x.Value == purchase.author.id).Key))
{
purchasedTabUsers.Add(user[purchase.author.id.ToString()]["username"].ToString(), purchase.author.id);
if (!purchasedTabUsers.ContainsKey(users.FirstOrDefault(x => x.Value == purchase.author.id).Key) && users.ContainsKey(users.FirstOrDefault(x => x.Value == purchase.author.id).Key))
{
purchasedTabUsers.Add(users.FirstOrDefault(x => x.Value == purchase.author.id).Key, purchase.author.id);
}
}
else
{
if (!purchasedTabUsers.ContainsKey($"Deleted User - {purchase.author.id}"))
{
purchasedTabUsers.Add($"Deleted User - {purchase.author.id}", purchase.author.id);
}
}
}
else
{
if (!purchasedTabUsers.ContainsKey($"Deleted User - {purchase.author.id}"))
JObject user = await GetUserInfoById($"/users/list?x[]={purchase.author.id}", auth);
if (!string.IsNullOrEmpty(user[purchase.author.id.ToString()]["username"].ToString()))
{
purchasedTabUsers.Add($"Deleted User - {purchase.author.id}", purchase.author.id);
if (!purchasedTabUsers.ContainsKey(user[purchase.author.id.ToString()]["username"].ToString()) && users.ContainsKey(user[purchase.author.id.ToString()]["username"].ToString()))
{
purchasedTabUsers.Add(user[purchase.author.id.ToString()]["username"].ToString(), purchase.author.id);
}
}
else
{
if (!purchasedTabUsers.ContainsKey($"Deleted User - {purchase.author.id}"))
{
purchasedTabUsers.Add($"Deleted User - {purchase.author.id}", purchase.author.id);
}
}
}
}
Expand Down

0 comments on commit e2deab3

Please sign in to comment.