janpetryk / reddit-bot Goto Github PK
View Code? Open in Web Editor NEWJava Reddit bot project.
Java Reddit bot project.
Tests in error:
testCommentContainsLongTwitterLinkInTheBeginning(pl.jpetryk.redditbot.utils.CommentParserTest)
testCommentContainsOnlyLongTwitterLink(pl.jpetryk.redditbot.utils.CommentParserTest)
testCommentContainsLongTwitterLinkInTheEnd(pl.jpetryk.redditbot.utils.CommentParserTest)
testMultipleLinksInOneComment(pl.jpetryk.redditbot.utils.CommentParserTest)
testCommentDoesNotContainTwitterLink(pl.jpetryk.redditbot.utils.CommentParserTest)
testCommentContainsLongTwitterLinkInTheMiddle(pl.jpetryk.redditbot.utils.CommentParserTest)
initializationError(pl.jpetryk.redditbot.bot.AbstractRedditBotTest): Guice creation errors:(..)
Is there setup advice? Like a throwaway user name and password needed?
It appears the bot is not escaping backslashes. This can be seen at this comment. It converted the shrug emote to ¯\\_(ツ)\_/¯
while it should be ¯\\\_(ツ)\_/¯
. The underscores were escaped, but since there is a backslash already the one supposed to escape the first underscore is instead displayed as backslash.
Polls are not displayed in comments
Expected result: poll is displayed
Hi,
Currently playing around with the replytocomment method, but when I try to actually reply to a comment I get a 403 back. Any idea why?
The code I've been using:
` public PostCommentResult replyToComment(String parentCommentFullName, String responseCommentBody) {
try {
RedditResponse response = redditClient.execute(redditClient.request()
.endpoint(Endpoints.COMMENT)
.post(JrawUtils.args(
"api_type", "json",
"text", responseCommentBody,
"thing_id", parentCommentFullName))
.build());
return processResponse(response);
} catch (NetworkException e) {
if (e.getCode() == 403) {
return PostCommentResult.bannedFromThisSub();
}
return null;
}
}
private PostCommentResult processResponse(RedditResponse response) {
if (response.hasErrors()) {
String message = response.getErrors()[0].getMessage();
if (message.contains("DELETED_COMMENT")) {
return PostCommentResult.commentDeleted();
} else {
return PostCommentResult.unsuccessful(message);
}
} else {
return PostCommentResult.successful(response.getJson().get("json").get("data").get("things").get(0)
.get("data").get("id").toString().substring(3));
}
}
`
Getting posts and authenticating works fine, but as soon as I want to reply I get a 403 forbidden back.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.