Skip to content

Instantly share code, notes, and snippets.

Keiichiro 9SQ

Block or report user

Report or block 9SQ

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@9SQ
9SQ / Sent.java
Created Aug 17, 2014
カンマ区切りusername宛にYoを送信
View Sent.java
package sent_yo;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
@9SQ
9SQ / Callback.java
Last active Aug 29, 2015
Yo APIからのcallbackでコマンド等を実行
View Callback.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@9SQ
9SQ / gist:69de80d78d8b58a14750
Created Aug 15, 2014
PubSubHubbub subscriber (購読確認)
View gist:69de80d78d8b58a14750
private static final String verifyToken = "this_is_test";
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String hubMode = request.getParameter("hub.mode");
String hubChallenge = request.getParameter("hub.challenge");
String hubVerifyToken = request.getParameter("hub.verify_token");
if (hubMode != null && !hubMode.isEmpty() && hubChallenge != null
&& !hubChallenge.isEmpty() && hubVerifyToken != null && !hubVerifyToken.isEmpty()) {
if (hubVerifyToken.equals(verifyToken)) {
@9SQ
9SQ / Csv2array.java
Last active Aug 29, 2015
カンマ区切りで渡された引数を配列に
View Csv2array.java
public class Csv2array {
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage: java -jar Csv2array.jar [username(comma separated username)]");
System.exit(-1);
}
String[] split = args[0].split(",");
String[] usernameArray = new String[split.length];
for (int i = 0; i < usernameArray.length; i++) {
You can’t perform that action at this time.