-
Notifications
You must be signed in to change notification settings - Fork 75
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
Can I change the user behind the VotableThing instance? #236
Comments
I think you'd want to just use your |
Gotcha, I will look into that now. I need to find the member of exportReddit that takes a URL/thingid. |
It looks like RedditUser doesn't implement anything to actually save posts. It may need a pull request to add that functionality, i'm only seeing a way to retrieve them. |
There is a .Save() on the post itself. That doesn't work? Or that won't
work for this usecase you mean?
…On Wed, Feb 3, 2021, 9:55 AM CrustyJew ***@***.***> wrote:
It looks like RedditUser doesn't implement anything to actually save
posts. It may need a pull request to add that functionality, i'm only
seeing a way to retrieve them.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#236 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWMN27SIKIJ4A3FJU3LWELS5FWX3ANCNFSM4W7ZKCCA>
.
|
ohhh yeah that might work. So in that case you'd want to do a new "get post" on your import instance and then save the post. Alternatively I think you can actually just call the LogIn method again on your instance of Reddit to change the user like you were originally wanting to do now that I think about it more >.< |
I just tested this with the following code and it seems to be working. var savedThingies = importAccount.GetSaved().ToList();
// Change login instance!
importReddit.LogIn(DestUsername, DestPassword);
foreach (var savedPost in savedThingies)
{
Console.WriteLine("Saving thing " + savedPost.FullName + " " + savedPost.Id + " " + savedPost.Shortlink);
try {
savedPost.Save();
Console.WriteLine("Success.");
}
catch(Exception ex)
{
Console.WriteLine("Failed!");
Console.WriteLine(ex);
}
} |
Imagine I have two logins:
How can I then transfer the saved things to the second account?
Ideally, I need to be able to
.SetUser(User)
and then loop and call Save. IE:I was thinking there had to be another way. Can I somehow get the URI from savedPost, load up a new VotableItem or something and then save?
The text was updated successfully, but these errors were encountered: