记录「从 X / Twitter 链接点进来」的真实来源证据 · 运行中
上报接口
POST /api/hit.php(JSON 或 form-urlencoded)· 也支持 GET /api/hit.php?... 同参
| 字段 | 类型 | 说明 |
| target | string | 必填,目标 URL |
| referer | string | 来源页 URL(服务端 HTTP_REFERER 为空时兜底) |
| ua | string | 客户端 UA |
| sid | string | 会话 ID |
| platform | string | ios | android | h5 |
| appver | string | 客户端版本 |
| source_hint | string | 客户端判定的来源,如 x.com / t.co |
| title | string | 页面标题 |
| extra | string | 附加 JSON 字符串 |
| profile | string(48) | v2 请求头伪装方案 id,如 x-ios / fb-ios / wx-android |
| headers | string(JSON) | v2 客户端实际发出的请求头对象(JSON.stringify 后),入库到 headers_json |
| env | string(JSON) | v2 客户端环境参数(os/device/screen/net/nav/app/tz/battery),入库到 env_json |
服务端另外自行记录:REMOTE_ADDR、X-Forwarded-For、真实 HTTP_REFERER、HTTP_USER_AGENT、Accept-Language。
返回示例
{
"code": 0,
"msg": "ok",
"id": 123,
"source": "x",
"source_type": "t_co",
"referer_host": "t.co",
"from_x": true,
"profile": "x-ios",
"ts": "2026-11-04 02:40:00"
}
headers / env 为 JSON 字符串,服务端原样存入 headers_json / env_json(MEDIUMTEXT,单条上限 64KB),后台详情可展开查看格式化结果。
来源判定
| referer host | source_type | from_x |
| x.com / *.x.com / twitter.com / *.twitter.com | x_site | 1 |
| t.co / *.t.co | t_co | 1 |
| 其它含 twitter / twimg.com | x_other | 1 |
| 空(referer 为空,source_hint 兜底) | direct | 0 |
| 其它外链 | other | 0 |
UA 含 Twitter for 时,from_x 直接为 true。