微博粉丝ID提取脚本: 油猴脚本获取粉丝数据
// ==UserScript== // @name Extract Weibo Fans ID // @namespace http://tampermonkey.net/ // @version 1.0 // @description Extract Weibo fans IDs and save to text file // @author Your name // @match https://weibo.com/* // @grant none // ==/UserScript==
(function() { 'use strict';
// Modify the URL below to match the page you want to extract fans from
const fansUrl = 'https://weibo.com/ajax/friendships/friends?relate=fans&page=1&uid=3977639513&type=fans&newFollowerCount=0';
// Modify the file name and path below to save the IDs to a different location
const fileName = 'weibo_fans_ids.txt';
fetch(fansUrl)
.then(response => response.json())
.then(data => {
const fans = data.users;
const ids = fans.map(fan => fan.id);
const text = ids.join('\n');
const blob = new Blob([text], {type: 'text/plain'});
const link = document.createElement('a');
link.download = fileName;
link.href = window.URL.createObjectURL(blob);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
})();
原文地址: https://www.cveoy.top/t/topic/n2y4 著作权归作者所有。请勿转载和采集!