Skip to content

Commit 81c89d8

Browse files
authored
Merge pull request #33 from Roblox-Indie-Wikis/development
Release version 1.4.0
2 parents 02975e3 + 835dec7 commit 81c89d8

31 files changed

+355
-100
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "npm"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ jobs:
2020
- mw: 'REL1_43'
2121
php: 8.1
2222
experimental: false
23-
- mw: 'master'
23+
- mw: 'REL1_44'
2424
php: 8.1
25+
experimental: false
26+
- mw: 'master'
27+
php: 8.3
2528
experimental: true
2629

2730
runs-on: ubuntu-latest

.github/workflows/lint-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Installing PHP
1313
uses: shivammathur/setup-php@master
1414
with:
15-
php-version: '8.0'
15+
php-version: '8.1'
1616
- name: Get Composer Cache Directory 2
1717
id: composer-cache
1818
run: |

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Live Examples:
2424
> Miraheze users may use ManageWiki to install this extension. Search for 'RobloxAPI' in *Special:ManageWiki/extensions*
2525
> and install it with a click.
2626
27+
Requirements:
28+
* MediaWiki 1.42 or higher
29+
* PHP 8.1.0 or higher
30+
2731
1. Download the repository using the following
2832
link: [Download ZIP](https://github.com/Roblox-Indie-Wikis/mediawiki-extensions-RobloxAPI/archive/master.zip)
2933
2. Place the files in a directory called `RobloxAPI` in your `extensions/` folder.

SECURITY.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
* MediaWiki: >= 1.42.x (until 1.42 reaches EOL)
66

7-
| Version | Supported | Notes |
8-
|---------|-----------|-------------------|
9-
| 1.3.0 || Latest release |
10-
| 1.2.0 || Upgrade to 1.3.0 |
11-
| 1.1.0 || Use 1.2.0 instead |
12-
| 1.0.0 || Use 1.2.0 instead |
7+
| Version | Supported | Notes |
8+
|---------|-----------|------------------|
9+
| 1.4.0 || Latest release |
10+
| 1.3.0 || Upgrade to 1.4.0 |
11+
| 1.2.0 || |
12+
| 1.1.0 || |
13+
| 1.0.0 || |
1314

1415
## Reporting a Vulnerability
1516

USAGE.md

Lines changed: 81 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
+ [userInfo](#userinfo)
2222
+ [assetDetails](#assetdetails)
2323
+ [groupRolesList](#grouproleslist)
24+
+ [gameNameDescription](#gamenamedescription)
25+
+ [universeInfo](#universeinfo)
26+
+ [userGames](#usergames)
27+
+ [userPlaceVisits](#userplacevisits)
2428
* [Handling JSON data](#handling-json-data)
2529
+ [JSON keys](#json-keys)
2630
+ [Pretty-printing JSON data](#pretty-printing-json-data)
@@ -57,7 +61,7 @@ specified in the `key=value` format.
5761

5862
### gameData
5963

60-
Provides information about a game/place in the [JSON format](#Handling-JSON-data).
64+
Provides information about a game/place in the [JSON format](#handling-json-data).
6165

6266
#### Example
6367

@@ -150,7 +154,7 @@ Get the user ID of a user:
150154

151155
### userAvatarThumbnail
152156

153-
Provides data about a user's avatar thumbnail in the [JSON format](#Handling-JSON-data).
157+
Provides data about a user's avatar thumbnail in the [JSON format](#handling-json-data).
154158

155159
#### Example
156160

@@ -203,7 +207,11 @@ Get the URL of the user avatar thumbnail of builderman (ID 156):
203207

204208
### assetThumbnail
205209

206-
Provides the data about an asset thumbnail in the [JSON format](#Handling-JSON-data).
210+
> [!WARNING]
211+
> Roblox enforces a stricter rate limit on the API used for this than on the other APIs.
212+
> It is in general recommended to use it at most once per page.
213+
214+
Provides the data about an asset thumbnail in the [JSON format](#handling-json-data).
207215

208216
#### Example
209217

@@ -229,6 +237,10 @@ Get the data about the asset thumbnail of the asset with ID 102611803:
229237

230238
### assetThumbnailUrl
231239

240+
> [!WARNING]
241+
> Roblox enforces a stricter rate limit on the API used for this than on the other APIs.
242+
> It is in general recommended to use it at most once per page.
243+
232244
Provides the URL of an asset thumbnail. Allows [embedding](#Embedding-images-from-the-Roblox-CDN) the asset image.
233245
Requires [assetThumbnail](#assetThumbnail) to be enabled.
234246

@@ -256,7 +268,7 @@ Get the URL of the asset thumbnail of the asset with ID 102611803:
256268

257269
### gameIcon
258270

259-
Provides the data about a game icon in the [JSON format](#Handling-JSON-data).
271+
Provides the data about a game icon in the [JSON format](#handling-json-data).
260272

261273
#### Example
262274

@@ -311,7 +323,7 @@ Get the URL of the game icon of the game with ID 132813250731469:
311323

312324
### groupRoles
313325

314-
Provides all group roles a user has in all groups they have joined in the [JSON format](#Handling-JSON-data).
326+
Provides all group roles a user has in all groups they have joined in the [JSON format](#handling-json-data).
315327

316328
[Official API documentation](https://groups.roblox.com//docs/index.html?urls.primaryName=Groups%20Api%20v1#operations-Membership-get_v1_users__userId__groups_roles)
317329

@@ -351,7 +363,7 @@ Get the name of the rank of the user with ID `4182456156` in the group with ID `
351363

352364
### groupData
353365

354-
Provides data about a group in the [JSON format](#Handling-JSON-data).
366+
Provides data about a group in the [JSON format](#handling-json-data).
355367

356368
[Official API documentation](https://groups.roblox.com//docs/index.html?urls.primaryName=Groups%20Api%20v1#operations-Groups-get_v1_groups__groupId_)
357369

@@ -396,7 +408,7 @@ Get the formatted number of members in a group:
396408

397409
### badgeInfo
398410

399-
Provides information about a badge in the [JSON format](#Handling-JSON-data).
411+
Provides information about a badge in the [JSON format](#handling-json-data).
400412

401413
#### Example
402414

@@ -414,7 +426,7 @@ Get all JSON data of a badge:
414426

415427
### userInfo
416428

417-
Provides information about a user in the [JSON format](#Handling-JSON-data).
429+
Provides information about a user in the [JSON format](#handling-json-data).
418430

419431
#### Example
420432

@@ -432,7 +444,7 @@ Get all JSON data of a user:
432444

433445
### assetDetails
434446

435-
Provides information about an asset in the [JSON format](#Handling-JSON-data).
447+
Provides information about an asset in the [JSON format](#handling-json-data).
436448

437449
#### Example
438450

@@ -450,7 +462,7 @@ Get all JSON data of an asset:
450462

451463
### groupRolesList
452464

453-
Provides a list of roles in a group in the [JSON format](#Handling-JSON-data).
465+
Provides a list of roles in a group in the [JSON format](#handling-json-data).
454466

455467
#### Example
456468

@@ -468,7 +480,7 @@ Get the roles of a group:
468480

469481
### gameNameDescription
470482

471-
Provides the name and description of a game in all supported languages in the [JSON format](#Handling-JSON-data).
483+
Provides the name and description of a game in all supported languages in the [JSON format](#handling-json-data).
472484

473485
#### Example
474486

@@ -492,7 +504,7 @@ Get the description of a game in English:
492504

493505
### universeInfo
494506

495-
Provides info about a universe in the [JSON format](#Handling-JSON-data).
507+
Provides info about a universe in the [JSON format](#handling-json-data).
496508

497509
#### Example
498510

@@ -514,6 +526,60 @@ Get the privacy type of a universe:
514526
|--------------|----------------------------------------------|------------|
515527
| `UniverseId` | The [universe ID](#universe-id) of the game. | Numeric ID |
516528

529+
### userGames
530+
531+
Provides a list of games a user has created in the [JSON format](#handling-json-data).
532+
533+
Note that it is not possible to get more than 50 games.
534+
535+
#### Example
536+
537+
Get the list of games a user has created:
538+
539+
```
540+
{{#robloxAPI: userGames | 1995870730 }}
541+
```
542+
543+
#### Required Arguments
544+
545+
| Name | Description | Type |
546+
|----------|--------------------------|------------|
547+
| `UserId` | The user ID of the user. | Numeric ID |
548+
549+
#### Optional Arguments
550+
551+
| Name | Description | Type | Default |
552+
|--------------|----------------------------------------|---------------------------|---------|
553+
| `limit` | The maximum number of games to return. | Numeric ID (10, 25 or 50) | `50` |
554+
| `sort_order` | The order to sort the games. | String (`Asc`, `Desc`) | `Asc` |
555+
556+
### userPlaceVisits
557+
558+
Provides the number of visits of all places a user has created.
559+
560+
Note that due to performance reasons, only the views of the first 50 places of the user are returned.
561+
562+
#### Example
563+
564+
Get the number of visits of all places a user has created:
565+
566+
```
567+
{{#robloxAPI: userPlaceVisits | 1995870730 }}
568+
```
569+
570+
#### Required Arguments
571+
572+
| Name | Description | Type |
573+
|----------|--------------------------|------------|
574+
| `UserId` | The user ID of the user. | Numeric ID |
575+
576+
#### Optional Arguments
577+
578+
| Name | Description | Type | Default |
579+
|--------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------|---------|
580+
| `limit` | The maximum number of games to consider in the calculation. | Numeric ID (10, 25 or 50) | `50` |
581+
| `sort_order` | The order to sort the games. This is used by the api and may change the results if the user has more games than the limit allows. | String (`Asc`, `Desc`) | `Asc` |
582+
517583
## Handling JSON data
518584

519585
### JSON keys
@@ -633,9 +699,10 @@ Default caching expiries:
633699
| Data source | Expiry |
634700
|-----------------------|-------------------|
635701
| `*` (default) | 600 (10 minutes) |
636-
| `userAvatarThumbnail` | 3600 (1 hour) |
637-
| `groupData` | 3600 (1 hour) |
702+
| `assetThumbnail` | 7200 (2 hours) |
638703
| `badgeInfo` | 1800 (30 minutes) |
704+
| `groupData` | 3600 (1 hour) |
705+
| `userAvatarThumbnail` | 3600 (1 hour) |
639706
| `userId` | 86400 (24 hours) |
640707
| `userInfo` | 86400 (24 hours) |
641708

@@ -653,8 +720,6 @@ $wgRobloxAPICachingExpiries = [
653720
];
654721
```
655722

656-
In this example, all other data sources will have a cache expiry time of 60 seconds.
657-
658723
### `$wgRobloxAPIAllowedArguments`
659724

660725
An array of allowed arguments per argument type. If empty, all arguments for the type are allowed. Any argument types

extension.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "RobloxAPI",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"author": [
55
"SomeRandomDeveloper"
66
],
@@ -39,17 +39,20 @@
3939
"assetDetails",
4040
"groupRolesList",
4141
"gameNameDescription",
42-
"universeInfo"
42+
"universeInfo",
43+
"userGames",
44+
"userPlaceVisits"
4345
],
4446
"merge_strategy": "provide_default",
4547
"description": "The data sources that should be enabled and available."
4648
},
4749
"RobloxAPICachingExpiries": {
4850
"value": {
4951
"*": 600,
50-
"userAvatarThumbnail": 3600,
51-
"groupData": 3600,
52+
"assetThumbnail": 7200,
5253
"badgeInfo": 1800,
54+
"groupData": 3600,
55+
"userAvatarThumbnail": 3600,
5356
"userId": 86400,
5457
"userInfo": 86400
5558
},
@@ -85,11 +88,15 @@
8588
},
8689
"HookHandlers": {
8790
"RobloxAPIHooks": {
88-
"class": "MediaWiki\\Extension\\RobloxAPI\\Hooks"
91+
"class": "MediaWiki\\Extension\\RobloxAPI\\Hooks",
92+
"services": [
93+
"ConfigFactory"
94+
]
8995
}
9096
},
9197
"Hooks": {
92-
"ParserFirstCallInit": "RobloxAPIHooks"
98+
"ParserFirstCallInit": "RobloxAPIHooks",
99+
"ParserTestGlobals": "RobloxAPIHooks"
93100
},
94101
"MessagesDirs": {
95102
"RobloxAPI": [

i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@
2424
"robloxapi-error-invalid-thumbnail-format": "Invalid thumbnail format '$1'! Possible values are 'Webp' and 'Png'.",
2525
"robloxapi-error-invalid-boolean": "Invalid boolean value '$1'! Must be 'true' or 'false'.",
2626
"robloxapi-error-invalid-return-policy": "Invalid return policy '$1'! Must be 'PlaceHolder', 'ForcePlaceHolder', 'AutoGenerated', or 'ForceAutoGenerated'.",
27-
"robloxapi-error-too-many-required-args": "The argument '$1' exceeds the maximum number of required arguments for this data source! Please refer to the documentation."
27+
"robloxapi-error-too-many-required-args": "The argument '$1' exceeds the maximum number of required arguments for this data source! Please refer to the documentation.",
28+
"robloxapi-error-invalid-user-games-limit": "Invalid limit '$1'! Must be 10, 25 or 50.",
29+
"robloxapi-error-invalid-sort-order": "Invalid sort order '$1'! Must be 'Asc' or 'Desc'."
2830
}

i18n/qqq.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@
2424
"robloxapi-error-invalid-thumbnail-format": "Error message shown when an invalid thumbnail format is provided. $1 is the invalid format. Possible values are 'Webp' and 'Png'",
2525
"robloxapi-error-invalid-boolean": "Error message shown when an invalid boolean value is provided. $1 is the invalid value. Must be 'true' or 'false'",
2626
"robloxapi-error-invalid-return-policy": "Error message shown when an invalid return policy is provided. $1 is the invalid policy. Must be 'PlaceHolder', 'ForcePlaceHolder', 'AutoGenerated', or 'ForceAutoGenerated'",
27-
"robloxapi-error-too-many-required-args": "Error message shown when too many required arguments are provided to a data source. $1 is the argument that exceeds the maximum number of required arguments"
27+
"robloxapi-error-too-many-required-args": "Error message shown when too many required arguments are provided to a data source. $1 is the argument that exceeds the maximum number of required arguments",
28+
"robloxapi-error-invalid-user-games-limit": "Error message shown when an invalid limit is provided for the user games data source. $1 is the invalid limit. Must be 10, 25 or 50",
29+
"robloxapi-error-invalid-sort-order": "Error message shown when an invalid sort order is provided. $1 is the invalid sort order. Must be 'Asc' or 'Desc'"
2830
}

0 commit comments

Comments
 (0)