@@ -10,6 +10,7 @@ import org.springframework.http.HttpHeaders;
import java.io.IOException ;
import java.net.Socket ;
import java.net.UnknownHostException ;
import java.time.LocalDateTime ;
import java.util.Date ;
/**
@@ -42,10 +43,13 @@ public class SocketDemo {
//Date endDate = DateUtils.getPreviousHalfHourOrFullHour(new Date());
//Date startDate = DateUtils.getOneMonthAgo(endDate);
//System.out.println(startDate+" "+endDate);
String textToTranslate = " <p _msthidden=\" 3 \" ><span style=\" color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\" 84072040\" _msthash=\" 1610 \" >API 中 coin 字段可目前仅取值支持: nexa</span></p><p _msthidden=\" 3 \" ><span id= \" step \" ></span></p><h3 style=\" text-align: start;\" _msttexthash=\" 11282648\" _msthash=\" 1609 \" >矿池信息</h3><h3 style=\" text-align: start;\" _msthidden=\" 3 \" ><span style=\" font-size: 16px;\" _msttexthash=\" 11308739\" _msthash=\" 1608 \" >公共结构</span></h3><p style=\" text-align: start;\" _msthidden=\" 3 \" ><strong _msttexthash=\" 7939243\" _msthash=\" 1607 \" >哈希率</strong></p><p style=\" text-align: start;\" _msttexthash=\" 11425713\" _msthash=\" 1606 \" >算力数据</p><p style=\" text-align: start;\" _msthidden=\" 3 \" ><br/></p><table style=\" width: auto;\" _msthidden=\" 3 \" ><tbody><tr><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 120 \" _msttexthash=\" 5204511\" _msthash=\" 1596 \" >名称</th><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 99.03 \" _msttexthash=\" 5230641\" _msthash=\" 1597 \" >类型</th><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 117 \" style=\" text-align: center;\" _msttexthash=\" 4973501\" _msthash=\" 1598 \" >备注</th><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 186 \" style=\" text-align: center;\" _msttexthash=\" 7093697\" _msthash=\" 1599 \" >解释</th></tr><tr><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" ><font _mstmutation=\" 1 \" _msttexthash=\" 5119231\" _msthash=\" 1600 \" >日期</font><br/></td><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" _msttexthash=\" 5119231\" _msthash=\" 1601 \" >日期</td><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" ></td><td colspan= \" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" _msttexthash=\" 23246444\" _msthash=\" 1602 \" >算力统计时间</td></tr><tr><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" ><font _mstmutation=\" 1 \" _msttexthash=\" 5078437\" _msthash=\" 1603 \" >算力</font><br/></td><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" ><font _mstmutation=\" 1 \" _msttexthash=\" 1952132\" _msthash=\" 1604 \" >双</font><br/></td><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" ></td><td colspan= \" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" ><font _mstmutation=\" 1 \" _msttexthash=\" 5078437\" _msthash=\" 1605 \" >算力</font><br/></td></tr></tbody></table><p _msthidden=\" 3 \" ><span id=\" MinersList\" ></span></p><p _msthidden=\" 3 \" ><span style=\" color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\" 10586056\" _msthash=\" 1595 \" >矿工名单</span></p><p _msthidden=\" 3 \" ><span style=\" color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\" 20870291\" _msthash=\" 1594 \" >矿工数量数据</span></p><table style=\" width: auto;\" _msthidden=\" 3 \" ><tbody><tr><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 148.7 \" style=\" text-align: center;\" _msttexthash=\" 5204511\" _msthash=\" 1581 \" >名称</th><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 99 \" style=\" text-align: center;\" _msttexthash=\" 5230641\" _msthash=\" 1582 \" >类型</th><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 111 \" style=\" text-align: center;\" _msttexthash=\" 4973501\" _msthash=\" 1583 \" >备注</th><th colspan=\" 1 \" rowspan= \" 1 \" width= \" 153 \" style=\" text-align: center;\" _msttexthash=\" 7093697\" _msthash=\" 1584 \" >解释</th></tr><tr><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" _msttexthash=\" 2241785\" _msthash=\" 1585 \" >总</td><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" style=\" text-align: center;\" _msttexthash=\" 5064124\" _msthash=\" 1586 \" >整数</td><td colspan=\" 1 \" rowspan= \" 1 \" width= \" auto \" > " ; // 替换为实际要翻译的文本
String apiKey = " " ; // 替换为实际的 API 密钥
String response = translate( textToTranslate, apiKey) ;
System. out . println( response) ;
// String textToTranslate = " <p _msthidden=\"3\" ><span style=\" color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\" 84072040\" _msthash=\"1610\" >API 中 coin 字段可目前仅取值支持: nexa</span></p><p _msthidden=\"3\"><span id=\"step\" ></span></p><h3 style=\" text-align: start;\" _msttexthash=\" 11282648\" _msthash=\"1609\" >矿池信息</h3><h3 style=\" text-align: start;\" _msthidden=\"3\" ><span style=\" font-size: 16px;\" _msttexthash=\" 11308739\" _msthash=\"1608\" >公共结构</span></h3><p style=\" text-align: start;\" _msthidden=\"3\" ><strong _msttexthash=\" 7939243\" _msthash=\"1607\" >哈希率</strong></p><p style=\" text-align: start;\" _msttexthash=\" 11425713\" _msthash=\"1606\" >算力数据</p><p style=\" text-align: start;\" _msthidden=\"3\" ><br/></p><table style=\" width: auto;\" _msthidden=\"3\" ><tbody><tr><th colspan=\"1\" rowspan=\"1\" width=\"120\" _msttexthash=\" 5204511\" _msthash=\"1596\" >名称</th><th colspan=\"1\" rowspan=\"1\" width=\"99.03\" _msttexthash=\" 5230641\" _msthash=\"1597\" >类型</th><th colspan=\"1\" rowspan=\"1\" width=\"117\" style=\" text-align: center;\" _msttexthash=\" 4973501\" _msthash=\"1598\" >备注</th><th colspan=\"1\" rowspan=\"1\" width=\"186\" style=\" text-align: center;\" _msttexthash=\" 7093697\" _msthash=\"1599\" >解释</th></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" ><font _mstmutation=\"1\" _msttexthash=\" 5119231\" _msthash=\"1600\" >日期</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" _msttexthash=\" 5119231\" _msthash=\"1601\" >日期</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\"></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" _msttexthash=\" 23246444\" _msthash=\"1602\" >算力统计时间</td></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" ><font _mstmutation=\"1\" _msttexthash=\" 5078437\" _msthash=\"1603\" >算力</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" ><font _mstmutation=\"1\" _msttexthash=\" 1952132\" _msthash=\"1604\" >双</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\"></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" ><font _mstmutation=\"1\" _msttexthash=\" 5078437\" _msthash=\"1605\" >算力</font><br/></td></tr></tbody></table><p _msthidden=\"3\" ><span id=\" MinersList\" ></span></p><p _msthidden=\"3\" ><span style=\" color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\" 10586056\" _msthash=\"1595\" >矿工名单</span></p><p _msthidden=\"3\" ><span style=\" color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\" 20870291\" _msthash=\"1594\" >矿工数量数据</span></p><table style=\" width: auto;\" _msthidden=\"3\" ><tbody><tr><th colspan=\"1\" rowspan=\"1\" width=\"148.7\" style=\" text-align: center;\" _msttexthash=\" 5204511\" _msthash=\"1581\" >名称</th><th colspan=\"1\" rowspan=\"1\" width=\"99\" style=\" text-align: center;\" _msttexthash=\" 5230641\" _msthash=\"1582\" >类型</th><th colspan=\"1\" rowspan=\"1\" width=\"111\" style=\" text-align: center;\" _msttexthash=\" 4973501\" _msthash=\"1583\" >备注</th><th colspan=\"1\" rowspan=\"1\" width=\"153\" style=\" text-align: center;\" _msttexthash=\" 7093697\" _msthash=\"1584\" >解释</th></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" _msttexthash=\" 2241785\" _msthash=\"1585\" >总</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\" text-align: center;\" _msttexthash=\" 5064124\" _msthash=\"1586\" >整数</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\">"; // 替换为实际要翻译的文本
// String apiKey = ""; // 替换为实际的 API 密钥
// String response = translate( textToTranslate, apiKey) ;
// System.out. println( response) ;
System . out . println ( LocalDateTime . now ( ) . toLocalDate ( ) . atStartOfDay ( ) ) ;
}