All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rmbz.Rmbz Maven / Gradle / Ivy

There is a newer version: 1.0.71
Show newest version
package rmbz;

import easy.io.JFile;
import easy.robot.chat.ChatRobot;
import easy.util.Log;
import net.sf.json.JSONObject;

import java.io.IOException;

public class Rmbz extends ChatRobot
{
	@Override
	public String chat(String msg) throws IOException
	{
		msg = msg.replace("#", "");

		String url = String.format("http://we.onexin.com/?mod=dialog&do=talk&title=%s", msg);
		
		String html = JFile.loadHttpFile(url);
		//System.out.println(html);
		JSONObject json = JSONObject.fromObject(html);
		//System.out.println(json.get("message"));
		//System.out.println(json.get("msgbox"));

		return json.getString("message");
	}

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		Rmbz c = new Rmbz();
		try
		{
			System.out.println(c.chat("上传了20张照片到专辑“闪过心头、那一霎那的风景” "));
		}
		catch (IOException e)
		{
			Log.OutException(e);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy