![]() |
|
[ALPHA] API for CodeCommunity [WIP] - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: [ALPHA] API for CodeCommunity [WIP] (/Thread-ALPHA-API-for-CodeCommunity-WIP) |
RE: [ALPHA] API for CodeCommunity [WIP] - Shebang - 08-04-2013 (08-04-2013, 11:36 AM)Platinum Wrote: Guys just stop fucking thrashing MY thread or I'm going to call an admin :/ Join my stream, I can help you out with some things. RE: [ALPHA] API for CodeCommunity [WIP] - Platinum - 08-04-2013 (08-04-2013, 12:02 PM)shebang Wrote:(08-04-2013, 11:36 AM)Platinum Wrote: Guys just stop fucking thrashing MY thread or I'm going to call an admin :/ Eerhm ok? I prefer something like Skype though. RE: [ALPHA] API for CodeCommunity [WIP] - Shebang - 08-04-2013 Here's the functions I modified, all the variables stay the same so you should be able to Copy + Paste as needed. Spoiler: New API Code[code=vbnet]Public Function ConfigureUID(uid As Integer) URLProfile = "http://www.codecommunity.net/member.php?action=profile&uid=" URLOnline = "http://www.codecommunity.net/reputation.php?uid=" URLSupMem = "http://codecommunity.net/checku.php?user=" URLProfile = URLProfile & uid.ToString URLRep = URLRep & uid.ToString Try WebC = Web.DownloadString(URLProfile) Catch ex As WebException WebC = "Something went wrong in the configuration." End Try Try DimC = New IO.StreamReader(Net.WebRequest.Create(URLProfile).GetResponse.GetResponseStream).ReadToEnd Catch ex As WebException DimC = "Something went wrong in the configuration." End Try URLSupMem = URLSupMem & GetUsername(uid) Try SupMem = New IO.StreamReader(Net.WebRequest.Create(URLSupMem).GetResponse.GetResponseStream).ReadToEnd Catch ex As Exception SupMem = "Something went wrong in the configuration." 'GoTos may look nice, but they're bad. Sorry :p End Try Return Nothing 'Exiting a function isn't necessary, this is done automatically. End Function Public Function GetUsername(uid As Integer) As String Try Return Split(WebC, "<title>Code Community - Profile of ")(1).Split("<")(0) Catch ex As Exception Return "Error retrieving username." End Try End Function Public Function GetJoinDate(uid As Integer) As String Try Return Split(WebC, "<strong>Registration Date:</strong> ")(1).Split("<")(0) Catch ex As Exception Return "Error retrieving join date." End Try End Function Public Function GetDateOfBirth(uid As Integer) As String Try Return Split(WebC, "<strong>Date of Birth:</strong> ")(1).Split("<")(0) Catch ex As Exception Return "Error retrieving date of birth." End Try End Function Public Function GetLocalTime(uid As Integer) As String Try Return Split(WebC, "<strong>Local Time:</strong> ")(1).Split("<")(0) Catch ex As Exception Return "Error retrieving local time." End Try End Function Public Function GetStatus(uid As Integer) As String Try Return Split(WebC, "<strong>Status:</strong> ")(1).Split("<")(0) Catch ex As Exception Return "Error retrieving user status." End Try End Function Public Function GetLastVisit(uid As Integer) As String Try Return Split(Split(WebC, "<td class=""trow2""><strong>Last Visit:</strong></td>" & vbNewLine)(1).Split("/")(0), ">")(1) Catch ex As Exception Return "Error retrieving last visit." End Try End Function . Public Function GetPosts(uid As Integer, Optional ByRef bolean As Boolean = False) As String Try Return Split(Split(WebC, "<td class=""trow1""><strong>Total Posts:</strong></td>" & vbNewLine)(1).Split(")")(0), ">")(1) & ")" Catch ex As Exception Return "Error retrieving total posts." End Try End Function Public Function GetOnlineTime(uid As Integer) As String Try Return Split(Split(WebC, "<td class=""trow2""><strong>Time Spent Online:</strong></td>" & vbNewLine)(1).Split("/")(0), ">")(1) Catch ex As Exception Return "Error retrieving total online time." End Try End Function Public Function GetReferredMembers(uid As Integer) As String Try Return Split(WebC, "<td class=""trow1""><strong>Members Referred:</strong></td>" & vbNewLine & "<td class=""trow1"">")(1).Split(" ")(0) Catch ex As Exception Return "Error retrieving total referred members." End Try End Function[/code] RE: [ALPHA] API for CodeCommunity [WIP] - Platinum - 08-04-2013 Looking good, not sure if I'm going to use all that but ty for all these examples! ^^ RE: [ALPHA] API for CodeCommunity [WIP] - Blackbone - 08-04-2013 (08-03-2013, 10:02 PM)Eternity Wrote:(08-03-2013, 09:45 PM)Blackbone Wrote:(08-03-2013, 06:51 PM)Eternity Wrote:I didn't say ur stupid I said ur rude by talking to me by that way... there is some nice way to talk with ppl and not tell them retards... this is why you are a low quality user(08-03-2013, 06:46 PM)Blackbone Wrote:(08-03-2013, 06:19 PM)Platinum Wrote: And you say this? Look how you're screaming at us now...I don't like low quality users... I changed my mind, im free to leave and free to enter RE: [ALPHA] API for CodeCommunity [WIP] - Platinum - 11-17-2013 Bringing this back up, should I renew this for Sinisterly ? RE: [ALPHA] API for CodeCommunity [WIP] - Blue - 11-17-2013 (11-17-2013, 08:57 PM)Platinum Wrote: Bringing this back up, should I renew this for Sinisterly ? Well Obviously. ;P RE: [ALPHA] API for CodeCommunity [WIP] - Leumonic - 11-21-2013 I've created a universal MyBB API. Just upload the PHP files to your forum root and you're good to go. It uses JSON and PDO to access information; no insecurities. |