Skip to content

Instantly share code, notes, and snippets.

@tarchan
Last active January 2, 2016 16:29
Show Gist options
  • Save tarchan/8330228 to your computer and use it in GitHub Desktop.
Save tarchan/8330228 to your computer and use it in GitHub Desktop.
irc client idea
IRCClient bot = new IRCClient(config.json);
bot.addServer(name, host, port, nick, user, real, encoding, tls, rooms);
bot.addListener("join", new IRCListener() {
handle(IRCMessage msg) {
String line = msg.read();
msg.send("hello!");
}
}):
IRCNameManager nameManager = new IRCNameManager();
nameManager.addListener(new IRCListener(){
handle(String channel, String[] names) {
// channel = "#dameTunes"
// names = {"tarchan", "cafebot", ...}
}
});
bot.addListener(nameManager);
bot.removeServer("name");
bot.login("name");
bot.loginAll();
bot.quit("name");
bot.quitAll();
IRCConfig.from()
.setName("name")
.setHost("host")
.setPort(6667)
.setNick("nick")
.setPassword("password")
.setUser("user")
.setReal("Real Name")
.setEncoding("JIS")
.setTls(...)
.setRooms("#javabreak", #dameTunes", ...)
.setAutoJoin(true)
.asMap();
IRCConfig.from("irc.properties").asMap();
@tarchan
Copy link
Author

tarchan commented Jan 30, 2014

@tarchan
Copy link
Author

tarchan commented Jan 30, 2014

http://www.studyinghttp.net/range#RangeRequest

  • 最初の 500 バイト (バイトオフセットは始点・終点を含めて、0-499): bytes=0-499
  • 次の 500 バイト (バイトオフセットは始点・終点を含めて、500-999): bytes=500-999
  • 最後の 500 バイト (バイトオフセットは始点・終点を含めて、9500-9999) : bytes=-500
  • あるいは bytes=9500-
  • 最初と最後の 1 バイト (バイトオフセットは 0 と 9999) : bytes=0-0,-1

@tarchan
Copy link
Author

tarchan commented Feb 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment