-
Notifications
You must be signed in to change notification settings - Fork 4
Work with new beta API #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
J-Man775
wants to merge
6
commits into
Status-Plus:main
Choose a base branch
from
J-Man775:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
13fd148
Work with new beta API
J-Man775 8411826
Update examples
J-Man775 3cebebf
Update MainSystem.server.lua
J-Man775 cd5608a
Update MainSystem.server.lua
J-Man775 a3c1372
Update MainSystem.server.lua
J-Man775 d41f1a4
Update MainSystem.server.lua
J-Man775 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,167 +1,32 @@ | ||
| local DowntimeService = {} | ||
|
|
||
| local HttpService = game:GetService("HttpService") | ||
| local sumurl = "https://raw.githubusercontent.com/Status-Plus/StatusPlus/master/history/summary.json" | ||
| local StatSummary = "https://api.statusplus.xyz/status" | ||
|
|
||
| function ReturnTableThroughSlug(slug, data) | ||
| function DowntimeService.statusFromAlias(alias) | ||
| local jsonData = HttpService:GetAsync(StatSummary) | ||
| local data = HttpService:JSONDecode(jsonData) | ||
| if data then | ||
| for i, value in ipairs(data) do | ||
| if value["slug"] == slug then | ||
| return value | ||
| for _, apiTable in ipairs(data) do | ||
| for _, apiAlias in ipairs(apiTable.aliases) do | ||
| if apiAlias == alias then | ||
| return apiTable.status | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| function DowntimeService.GetSiteStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("roblox-site", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetDevForumStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("roblox-devforum", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetDevHubStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("roblox-devhub", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetAvatarAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("avatar-api-endpoint", Data) | ||
|
|
||
| return Table.status | ||
| end | ||
|
|
||
| function DowntimeService.GetBadgesAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("badges-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetCDNAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("cdn-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetCatalogAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("catalog-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetDatastoreAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("datastore-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
|
|
||
| function DowntimeService.GetDevelopAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("develop-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetFriendsAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("friends-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetGameJoinAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("game-join-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetGroupsAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("groups-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetInventoryAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("inventory-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetTextFilterAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("text-filter-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| end | ||
|
|
||
| function DowntimeService.GetThumbnailsAPIStatus() | ||
|
|
||
| local GetStatus = HttpService:GetAsync(sumurl) | ||
|
|
||
| local Data = HttpService:JSONDecode(GetStatus) | ||
| local Table = ReturnTableThroughSlug("thumbnails-api-endpoint", Data) | ||
|
|
||
| return Table.status -- Will return "up", "degraded" or "down" | ||
| function DowntimeService.statusFromName(name) | ||
| local jsonData = HttpService:GetAsync(StatSummary) | ||
| local data = HttpService:JSONDecode(jsonData) | ||
| if data then | ||
| for _, apiTable in ipairs(data) do | ||
| if apiTable.name == name then | ||
| return apiTable.status | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| return DowntimeService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.