-
Notifications
You must be signed in to change notification settings - Fork 76
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
Does this gem support the "save" scope? #47
Comments
Yes it does! Here's the relevant method on the github documentation. There are a few things you have to keep in mind if you want to go through a user's saved posts history:
And here's that script: all_saved = []
after = nil
loop do
# Get all posts after the post in the 'after' variable
results = reddit.me.saved(after: after, limit: 100)
puts "Fetched #{results.count} posts."
# Store the fetched results
all_saved.concat(results)
# Keep track of what post to get the saved posts after
after = results.after
# If after was nil, we've reached the end.
break if after.nil?
end
puts all_saved.length # => 938 # reddit is limiting me to 938 posts |
@avinashbot Wow! Thank you for the explanation and script! I didn't know about the 1000 post limit, either. Is that also the case for the Reddit website? (I have around 950 saves, so I'm not sure.) The only workaround I see (for my app in particular) to the 1K posts issue is... If I store each post in my own database, and every time the user syncs up, the saved count goes up past 1K if needed. But that assumes a user has under 1K posts to begin with... (I am preparing the migrations for this approach just for a deadline for class, but am still unsure whether I should do this, as I'd be documenting the entirety of reddit almost.) |
Yep, a thousands posts is the limitation for every type of listing on the website. It is annoying, since my saves only go back 2 years and I'd like to look at posts I've saved earlier than that. Storing user's posts seems to be the only safe option, but at least you'll only need to save the object's fullname (by calling Hope that was helpful! |
I want to be able to retrieve a user's saved posts/comments (see app)
Does this gem offer such capability? I was thinking of using RedditKit, but as listed here, it does not support OAuth. However, I plan to use omniauth-reddit for signing in users to my app.
Thank you.
The text was updated successfully, but these errors were encountered: