Created
July 26, 2015 10:50
-
-
Save orekyuu/2ae1cd6e790f0345b9d6 to your computer and use it in GitHub Desktop.
女装プラグインっぽいなにか
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.orekyuu.example; | |
| import net.orekyuu.javatter.api.plugin.OnPostInit; | |
| import net.orekyuu.javatter.api.service.TwitterUserService; | |
| import javax.inject.Inject; | |
| public class ExamplePlugin { | |
| @Inject | |
| private TwitterUserService service; | |
| @OnPostInit | |
| public void initialize() { | |
| service.allUser().each(user -> { | |
| user.userStream().onStatus(tweet -> { | |
| if (tweet.getOwner().getId() != user.getUser().getId() && | |
| tweet.getText().contains("女装")) { | |
| user.createTweet() | |
| .setAsync() | |
| .replyTo(tweet) | |
| .setText("@" + tweet.getOwner().getScreenName() + " 女装") | |
| .tweet(); | |
| } | |
| }); | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment