<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$qq='22222';
$url = "https://api.jisuapi.com/qqluck/query?appkey=$appkey&qq=$qq";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
echo $result['qq'].' '.$result['score'].' '.$result['luck'].'
';
echo $result['content'].' '.$result['character'].' '.$result['characterdetail'].'
';
#!/usr/bin/python
# encoding:utf-8
import urllib2, json, urllib
# 1、QQ号码测吉凶
data = {}
data["appkey"] = "your_appkey_here"
data["qq"] = "22222"
url_values = urllib.urlencode(data)
url = "https://api.jisuapi.com/qqluck/query" + "?" + url_values
request = urllib2.Request(url)
result = urllib2.urlopen(request)
jsonarr = json.loads(result.read())
if jsonarr["status"] != u"0":
print jsonarr["msg"]
exit()
result = jsonarr["result"]
print result["qq"],result["score"],result["luck"]
print result["content"],result["character"],result["characterdetail"]
package api.jisuapi.qqluck;
import api.util.HttpUtil;
import net.sf.json.JSONObject;
public class Query {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.jisuapi.com/qqluck/query";
public static final String qq = "22222";
public static void Get() {
String result = null;
String url = URL + "?qq=" + qq + "&appkey=" + APPKEY;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONObject resultarr = json.optJSONObject("result");
String qq = resultarr.getString("qq");
String score = resultarr.getString("score");
String luck = resultarr.getString("luck");
String content = resultarr.getString("content");
String character = resultarr.getString("character");
String characterdetail = resultarr.getString("characterdetail");
System.out.println(
qq + " " + score + " " + luck + " " + content + " " + character + " " + characterdetail);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}