Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

comment on a post #38

Open
ninjonxb opened this issue Dec 18, 2014 · 1 comment
Open

comment on a post #38

ninjonxb opened this issue Dec 18, 2014 · 1 comment

Comments

@ninjonxb
Copy link

I am trying to figure out how to post a comment to a reddit post I just made.
So far I have tried saving the object that is returned when I do a submit and doing:
RedditKit.submit_comment(submit_object, "test") -- which errors with permission denied
I have tried making a link that I could put in the submit_comment but that just keeps returning nil even though within the same session I was able to make the post originally.
test_link = RedditKit.link("http://www.reddit.com/r/redditbotplaygroundsw/comments/2poh23/test_title/")
Not sure what else to try. The ruby doc says that it will return nil if I am not currently signed in but I am:

2.1.2 :021 > RedditKit.sign_in 'OMIT', "OMIT"
=> "OMIT"
2.1.2 :022 > test_link = RedditKit.link("http://www.reddit.com/r/redditbotplaygroundsw/comments/2poh23/test_title/")
=> nil

This is a private reddit I have for getting my bot working. I am the moderator and I can without issue make posts. I just can't comment.

@BukhariH
Copy link
Contributor

That's because you're not using the fullname of the link.

The fullname of a link is the 'kind' of t3 and then an underscore followed by the link id. (You can see here for more: https://www.reddit.com/dev/api#fullnames)

E.G. For your link it would be:

t3_2poh23

So, you would do:

RedditKit.link("t3_2poh23")

Hope that helps!
Hasnain

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants