Skip to content

Instantly share code, notes, and snippets.

@orekyuu
Created July 26, 2015 10:50
Show Gist options
  • Select an option

  • Save orekyuu/2ae1cd6e790f0345b9d6 to your computer and use it in GitHub Desktop.

Select an option

Save orekyuu/2ae1cd6e790f0345b9d6 to your computer and use it in GitHub Desktop.
女装プラグインっぽいなにか
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