Skip to content

Commit

Permalink
Fix: Usernames not being generated (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceilingwaffle authored Dec 30, 2020
1 parent af5b3bd commit 12b0430
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions CollectionManagerExtensionsDll/Modules/API/osu/OsuSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class OsuSite
private static readonly string parsingPage = "Getting page {0} of {1}";
private static readonly string parsingComplete = "Finished Processing of {0} pages";

private static readonly string _baseUrl = "https://old.ppy.sh/p";
private static readonly string UserPpRankingUrl = _baseUrl + "/pp/?m=0&s=3&o=1&f=0&page={0}";
private static readonly string _baseUrl = "https://osu.ppy.sh/rankings/osu/performance";
private static readonly string UserPpRankingUrl = _baseUrl + "?m=0&s=3&o=1&f=0&page={0}";
private static readonly int UsersPerPage = 50;
public delegate void LogUsernameGeneration(string logMessage, int completionPrecentage);

Expand Down Expand Up @@ -60,14 +60,14 @@ private List<string> GetUsernamesFromPage(string pageContents, int startUserInde
var usernames = new List<string>();
if (pageContents.Length > 0)
{
var match = Regex.Matches(pageContents, ".*?href=\'\\/u\\/(\\d+)\'>(.*)<\\/a>");
var match = Regex.Matches(pageContents, ".*?href=\".*?\\/users\\/(\\d+)\\/osu\"\n.*\n.*\n.*\n.*>\n(.*)\n.*<\\/a>");
if (match.Count > 0)
{
for (int i = startUserIndex; i <= endUserIndex; i++)
{
var entry = match[i];
//var userId = entry.Groups[1].Value;
var username = entry.Groups[2].Value;
var username = entry.Groups[2].Value.Trim();
usernames.Add(username);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace CollectionManagerExtensionsDll.Modules.API.osu.Tests
{
[Ignore("old performance page is not avaliable anymore, url is now https://osu.ppy.sh/rankings/osu/performance")]
[TestClass()]
public class OsuSiteTests
{
Expand Down

0 comments on commit 12b0430

Please sign in to comment.