scrapebadger 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +2 -316
- package/dist/index.d.ts +2 -316
- package/dist/index.js +20 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3583,9 +3583,7 @@ var SubredditsClient = class {
|
|
|
3583
3583
|
* ```
|
|
3584
3584
|
*/
|
|
3585
3585
|
async get(subreddit) {
|
|
3586
|
-
return this.client.request(
|
|
3587
|
-
`/v1/reddit/subreddits/${subreddit}`
|
|
3588
|
-
);
|
|
3586
|
+
return this.client.request(`/v1/reddit/subreddits/${subreddit}`);
|
|
3589
3587
|
}
|
|
3590
3588
|
/**
|
|
3591
3589
|
* Get posts from a subreddit.
|
|
@@ -3613,17 +3611,14 @@ var SubredditsClient = class {
|
|
|
3613
3611
|
* ```
|
|
3614
3612
|
*/
|
|
3615
3613
|
async posts(subreddit, options = {}) {
|
|
3616
|
-
return this.client.request(
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
after: options.after,
|
|
3623
|
-
limit: options.limit
|
|
3624
|
-
}
|
|
3614
|
+
return this.client.request(`/v1/reddit/subreddits/${subreddit}/posts`, {
|
|
3615
|
+
params: {
|
|
3616
|
+
sort: options.sort,
|
|
3617
|
+
time: options.time,
|
|
3618
|
+
after: options.after,
|
|
3619
|
+
limit: options.limit
|
|
3625
3620
|
}
|
|
3626
|
-
);
|
|
3621
|
+
});
|
|
3627
3622
|
}
|
|
3628
3623
|
/**
|
|
3629
3624
|
* Get the rules for a subreddit.
|
|
@@ -3643,39 +3638,7 @@ var SubredditsClient = class {
|
|
|
3643
3638
|
* ```
|
|
3644
3639
|
*/
|
|
3645
3640
|
async rules(subreddit) {
|
|
3646
|
-
return this.client.request(
|
|
3647
|
-
`/v1/reddit/subreddits/${subreddit}/rules`
|
|
3648
|
-
);
|
|
3649
|
-
}
|
|
3650
|
-
/**
|
|
3651
|
-
* Get the moderators of a subreddit.
|
|
3652
|
-
*
|
|
3653
|
-
* @param subreddit - Subreddit name (without r/ prefix).
|
|
3654
|
-
* @param options - Optional parameters.
|
|
3655
|
-
* @param options.after - Pagination cursor for the next page.
|
|
3656
|
-
* @param options.limit - Number of results to return.
|
|
3657
|
-
* @returns List of moderators with pagination metadata.
|
|
3658
|
-
* @throws NotFoundError - If the subreddit doesn't exist.
|
|
3659
|
-
* @throws AuthenticationError - If the API key is invalid.
|
|
3660
|
-
*
|
|
3661
|
-
* @example
|
|
3662
|
-
* ```typescript
|
|
3663
|
-
* const response = await client.reddit.subreddits.moderators("programming");
|
|
3664
|
-
* for (const mod of response.moderators) {
|
|
3665
|
-
* console.log(`u/${mod.name}: [${mod.mod_permissions.join(", ")}]`);
|
|
3666
|
-
* }
|
|
3667
|
-
* ```
|
|
3668
|
-
*/
|
|
3669
|
-
async moderators(subreddit, options = {}) {
|
|
3670
|
-
return this.client.request(
|
|
3671
|
-
`/v1/reddit/subreddits/${subreddit}/moderators`,
|
|
3672
|
-
{
|
|
3673
|
-
params: {
|
|
3674
|
-
after: options.after,
|
|
3675
|
-
limit: options.limit
|
|
3676
|
-
}
|
|
3677
|
-
}
|
|
3678
|
-
);
|
|
3641
|
+
return this.client.request(`/v1/reddit/subreddits/${subreddit}/rules`);
|
|
3679
3642
|
}
|
|
3680
3643
|
/**
|
|
3681
3644
|
* List all wiki pages in a subreddit.
|
|
@@ -3715,9 +3678,7 @@ var SubredditsClient = class {
|
|
|
3715
3678
|
* ```
|
|
3716
3679
|
*/
|
|
3717
3680
|
async wikiPage(subreddit, page) {
|
|
3718
|
-
return this.client.request(
|
|
3719
|
-
`/v1/reddit/subreddits/${subreddit}/wiki/${page}`
|
|
3720
|
-
);
|
|
3681
|
+
return this.client.request(`/v1/reddit/subreddits/${subreddit}/wiki/${page}`);
|
|
3721
3682
|
}
|
|
3722
3683
|
/**
|
|
3723
3684
|
* Get the most popular subreddits on Reddit.
|
|
@@ -3737,15 +3698,12 @@ var SubredditsClient = class {
|
|
|
3737
3698
|
* ```
|
|
3738
3699
|
*/
|
|
3739
3700
|
async popular(options = {}) {
|
|
3740
|
-
return this.client.request(
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
after: options.after,
|
|
3745
|
-
limit: options.limit
|
|
3746
|
-
}
|
|
3701
|
+
return this.client.request("/v1/reddit/subreddits/popular", {
|
|
3702
|
+
params: {
|
|
3703
|
+
after: options.after,
|
|
3704
|
+
limit: options.limit
|
|
3747
3705
|
}
|
|
3748
|
-
);
|
|
3706
|
+
});
|
|
3749
3707
|
}
|
|
3750
3708
|
/**
|
|
3751
3709
|
* Get newly created subreddits on Reddit.
|
|
@@ -3765,15 +3723,12 @@ var SubredditsClient = class {
|
|
|
3765
3723
|
* ```
|
|
3766
3724
|
*/
|
|
3767
3725
|
async newSubreddits(options = {}) {
|
|
3768
|
-
return this.client.request(
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
after: options.after,
|
|
3773
|
-
limit: options.limit
|
|
3774
|
-
}
|
|
3726
|
+
return this.client.request("/v1/reddit/subreddits/new", {
|
|
3727
|
+
params: {
|
|
3728
|
+
after: options.after,
|
|
3729
|
+
limit: options.limit
|
|
3775
3730
|
}
|
|
3776
|
-
);
|
|
3731
|
+
});
|
|
3777
3732
|
}
|
|
3778
3733
|
};
|
|
3779
3734
|
|