QQ信息查询源码

文章摘要
该文章介绍了作者利用寂寞 API 的接口开发了一款 QQ 信息查询工具,可查询包括 QQ 等级、注册时间和 Q 龄等信息。文章提供了相关的 HTML 与 JavaScript 源码示例,但指出页面可能存在 CSS 冲突,需自行美化。作者表示该 API 使用率较低,因此显得十分珍惜地使用了起来。
— 文章部分摘要由DeepSeek深度思考而成

使用了寂寞 API 提供的接口。我看他的 API 都没人怎么用,我给他用起来,哈哈。能查询 QQ 等级,注册时间,Q 龄

图片演示:

图片[1]|QQ信息查询源码|不死鸟资源网

我直接放主题里测试的,css 会有冲突,前端可能有点丑,自己美化一下就好。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>查询QQ用户信息</title>
<style>
  body {
    font-family: Arial, sans-serif;
    padding: 20px;
  }
  .container {
    max-width: 600px;
    margin: 0 auto;
  }
  input, button {
    padding: 10px;
    margin-top: 10px;
    font-size: 16px;
  }
</style>
</head>
<body>
<div class="container">
  <h2>查询QQ用户信息</h2>
  <input type="text" id="qqNumber" placeholder="请输入QQ号码">
  <button onclick="fetchUserData()">查询</button>
  <div id="result">
    <!-- 结果将在这里显示 -->
  </div>
</div>

<script>
function fetchUserData() {
  const qqNumber = document.getElementById('qqNumber').value;
  const apiUrl = `https://api.jmjm.tk/api/qqzcdj/?qq=${qqNumber}`;
  
  // 使用Fetch API发送请求
  fetch(apiUrl)
    .then(response => {
      if (!response.ok) {
        throw new Error('Network response was not ok');
      }
      return response.json();
    })
    .then(data => {
      displayResult(data);
    })
    .catch(error => {
      console.error('There has been a problem with your fetch operation:', error);
      document.getElementById('result').innerText = '请求失败: ' + error.message;
    });
}

function displayResult(data) {
  const resultDiv = document.getElementById('result');
  if (data.status === 'success') {
    resultDiv.innerHTML = `
      <p><strong>QQ号:</strong> ${data.user_id}</p>
      <p><strong>昵称:</strong> ${data.nickname}</p>
      <p><strong>QQ等级:</strong> ${data.qqLevel}</p>
      <p><strong>注册时间:</strong> ${data.reg_time}</p>
      <p><strong>QQ年龄:</strong> ${data.qq_age}</p>
    `;
  } else {
    resultDiv.innerHTML = '<p>查询失败,请检查输入的QQ号码是否正确。</p>';
  }
}
</script>
</body>
</html>

本站文章部分内容可能来源于网络,仅供大家学习参考,如有侵权,请联系站长📧cutwork@qq.com进行删除处理!
QQ信息查询源码|不死鸟资源网
QQ信息查询源码
此内容为免费阅读,请登录后查看
¥0
限时特惠
¥99
文章采用CC BY-NC-SA 4.0许可协议授权
免费阅读
THE END
点赞6 分享