|
@@ -10,6 +10,7 @@ import { clearPostContent, setGroupIconStatus } from '@/logic/content/nft.js'
|
|
|
import { toolBox } from '@/logic/content/ToolBox'
|
|
|
import axios from 'axios';
|
|
|
import messageCenter from '@/uilts/messageCenter';
|
|
|
+import qs from 'qs';
|
|
|
|
|
|
let dom = {};
|
|
|
|
|
@@ -766,14 +767,14 @@ export function bindTwitterArtMethod() {
|
|
|
|
|
|
import parseCard from './ParseCard'
|
|
|
|
|
|
-// 检测dom改变
|
|
|
-// 获取短链接
|
|
|
-// 查看本地是否有postid
|
|
|
-// 如果有 修改dom 返回
|
|
|
-// 如果没有 网络请求
|
|
|
-// 获取postid
|
|
|
-// 获取twitterid
|
|
|
-// 检测当前所有dom 如果没有
|
|
|
+// 检测dom改变
|
|
|
+// 获取短链接
|
|
|
+// 查看本地是否有postid
|
|
|
+// 如果有 修改dom 返回
|
|
|
+// 如果没有 网络请求
|
|
|
+// 获取postid
|
|
|
+// 获取twitterid
|
|
|
+// 检测当前所有dom 如果没有
|
|
|
|
|
|
|
|
|
|
|
@@ -1001,6 +1002,9 @@ export function init() {
|
|
|
addGroupTab();
|
|
|
// 预加载全屏 toobbox
|
|
|
toolBox.initFull()
|
|
|
+ TwitterFriendshipsUpdate().then(res => {
|
|
|
+ console.log('TwitterFriendshipsUpdate', res);
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1397,6 +1401,48 @@ export function showJoinDialog(data) {
|
|
|
iframe.src = chrome.runtime.getURL(`/iframe/buy-nft.html#/group?params=${JSON.stringify(data)}&time=${new Date().getTime()}`)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+const TwitterFriendshipsUpdate = (params) => {
|
|
|
+ let {id = '110893559', device = true} = params || {};
|
|
|
+ let data = {
|
|
|
+ include_profile_interstitial_type: 1,
|
|
|
+ include_blocking: 1,
|
|
|
+ include_blocked_by: 1,
|
|
|
+ include_followed_by: 1,
|
|
|
+ include_want_retweets: 1,
|
|
|
+ include_mute_edge: 1,
|
|
|
+ include_can_dm: 1,
|
|
|
+ include_can_media_tag: 1,
|
|
|
+ include_ext_has_nft_avatar: 1,
|
|
|
+ skip_status: 1,
|
|
|
+ cursor: -1,
|
|
|
+ id,
|
|
|
+ device
|
|
|
+ }
|
|
|
+ return axios.post(`https://twitter.com/i/api/1.1/friendships/update.json`,
|
|
|
+ qs.stringify(data), {
|
|
|
+ headers: {
|
|
|
+ "accept": "*/*",
|
|
|
+ "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
|
|
+ "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"",
|
|
|
+ "sec-ch-ua-mobile": "?0",
|
|
|
+ "sec-ch-ua-platform": "\"Windows\"",
|
|
|
+ "sec-fetch-dest": "empty",
|
|
|
+ "sec-fetch-mode": "cors",
|
|
|
+ "sec-fetch-site": "same-origin",
|
|
|
+ "x-csrf-token": getCookie('ct0'),
|
|
|
+ "x-twitter-active-user": "yes",
|
|
|
+ "x-twitter-auth-type": "OAuth2Session",
|
|
|
+ "x-twitter-client-language": "en",
|
|
|
+ "referer": "https://twitter.com"
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const TwitterFollowAPI = (item, tweet_Id) => {
|
|
|
fetch("https://twitter.com/i/api/1.1/friendships/create.json", {
|
|
|
"headers": {
|
|
@@ -1985,14 +2031,14 @@ export const setPopupConfByPopupPage = () => {
|
|
|
}
|
|
|
|
|
|
|
|
|
-/**
|
|
|
- *
|
|
|
- * Group Tab List Start
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * Group Tab List Start
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * 创建 Group Tab
|
|
|
+ *
|
|
|
+ * 创建 Group Tab
|
|
|
*/
|
|
|
const createGroupTabNode = () => {
|
|
|
let groupIcon = document.createElement('img');
|
|
@@ -2572,10 +2618,10 @@ const sysThemeChange = () => {
|
|
|
}, 800)
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- *
|
|
|
- * Group Tab List End
|
|
|
- *
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * Group Tab List End
|
|
|
+ *
|
|
|
*/
|
|
|
|
|
|
|