大佬们最近更新API不知道写什么了
想看看你们都用的那些好玩的api
让我来模仿写一下哈哈哈哈
谢谢大佬们
17 个赞
插个眼 看看有没什么有意思的接口
插个眼 看看有没什么有意思的接口
+1。。。。
最近写的一个,随机返回ascii塔罗牌,可能重复
https://cfapi.996.ninja/tarot/horoscope?n=1
curl wttr.in/hangzhou
终端看天气
1 个赞
有没有大佬有购物网站比价的api 以前抓了个比价狗的最近这几天封控了
public String jdBiJia(String skuId) {
StringBuilder builder = new StringBuilder();
try {
SimpleDateFormat format = new SimpleDateFormat("yy-MMdd", Locale.CHINA);
String jdUrl = String.format("https://item.jd.com/%s.html", skuId);
Map<String, String> heads = new HashMap<>();
heads.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36");
heads.put("Referer", jdUrl);
String ckUrl = "https://browser.bijiago.com/extension?ac=bdextPermanent&format=json&version=" + System.currentTimeMillis();
Map<String, String> cookies = new HashMap<>();
jRequest(ckUrl, "GET", heads, cookies, null);
Leg.d(TAG, "cookies is : " + cookies);
String bjgUrl = String.format("https://browser.bijiago.com/extension/price_towards?url=%s&format=jsonp&union=union_bijiago&from_device=bijiago&version=%s", jdUrl, System.currentTimeMillis());
String body = jRequest(bjgUrl, "GET", heads, cookies, null);
if (!TextUtils.isEmpty(body) && JSONValidator.from(body).validate()) {
JSONObject data = JSONObject.parseObject(body);
String range = data.getJSONArray("store").getJSONObject(0).getString("price_range");
String lowest = data.getJSONArray("store").getJSONObject(0).getString("lowest");
long min_stamp = data.getJSONArray("store").getJSONObject(0).getLong("min_stamp");
String novice = data.getJSONArray("store").getJSONObject(0).getString("current_price");
builder.append(String.format("当前价:%s \n", novice));
builder.append(String.format("最低:%s (%s)\n", lowest, format.format(min_stamp * 1000)));
builder.append(String.format("区间:%s\n", range));
} else {
Leg.d(TAG, "body is : " + body);
}
} catch (Exception ex) {
Leg.e(TAG, "bijiao异常: " + ex);
}
if (builder.length() == 0) builder.append("转链成功\n无法比价");
return builder.toString();
}