Skip to content
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

redditClient.GetPosts(List<string> fullnames) drops posts if over 25 is requested #175

Open
largenumberhere opened this issue Jan 17, 2023 · 2 comments
Assignees
Labels
Awaiting Feedback Additional information is required before the issue can be resolved.

Comments

@largenumberhere
Copy link

largenumberhere commented Jan 17, 2023

image
Posts are silently discarded if over 25 are requested. Please add documentation and an error to protect against users silently losing posts. Thanks

@largenumberhere largenumberhere changed the title RedditClientGetPosts(List<string> fullnames) RedditClientGetPosts(List<string> fullnames) drops posts if over 25 is requested Jan 17, 2023
@largenumberhere largenumberhere changed the title RedditClientGetPosts(List<string> fullnames) drops posts if over 25 is requested redditClient.GetPosts(List<string> fullnames) drops posts if over 25 is requested Jan 17, 2023
@sirkris
Copy link
Owner

sirkris commented May 28, 2023

Can you post some code to go with this example? As far as I'm aware, there is no such limit. If you request 30 posts, you should get 30 posts. I've done quite a bit of testing to make sure of this.

So my first guess would be an issue with your code, but I'd need to see it in order to be sure.

@sirkris sirkris self-assigned this May 28, 2023
@sirkris sirkris added the Awaiting Feedback Additional information is required before the issue can be resolved. label May 28, 2023
@Shalie
Copy link

Shalie commented Oct 5, 2023

I've noticed the same 25 limit in GetPosts.
Here's an example, using Base36Library to create a list of 50 id's:


string startID = "16xyz93";

//create a list of 50 id's using Base36Library
long startNumber = Base36.Decode(startID);
List<string> ids = new List<string>();
int nextId = 0;
while (nextId < 50)
{
	ids.Add("t3_" + Base36.Encode(startNumber + nextId).ToLower());
	nextId++;
}

//get posts by id
List<Post> posts = new List<Post>();
var refreshToken = AuthorizeUser("appId", "appSecret");
var reddit = new RedditClient("appId", "appSecret", "refreshToken");
posts = reddit.GetPosts(ids);

I've found this reddit post that explains the /by_id? endpoint only gives 25 results, and recommends using the /info endpoint for 100 results. But I can't find how to call that endpoint with Reddit.NET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Feedback Additional information is required before the issue can be resolved.
Projects
None yet
Development

No branches or pull requests

3 participants