|
@@ -1080,7 +1080,7 @@ export const getTweetUserFollowStatus = (params) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- chrome.runtime.sendMessage({ actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES', data: list, tweetId, type: params.type }, () => { })
|
|
|
+ chrome.runtime.sendMessage({ actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES', data: list, tweetId, type: params.type, iframeId: params.iframeId }, () => { })
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -1401,7 +1401,7 @@ export function getTweetAuthorByDom(params) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-export function doTaskTwitterAPI({ task_data, task_type, tasks }) {
|
|
|
+export function doTaskTwitterAPI({ task_data, task_type, tasks, iframeId }) {
|
|
|
switch (task_type) {
|
|
|
case 'like':
|
|
|
TwitterLikeAPI(task_data.tweet_Id)
|
|
@@ -1436,7 +1436,7 @@ export function doTaskTwitterAPI({ task_data, task_type, tasks }) {
|
|
|
// 推文发推
|
|
|
case '10':
|
|
|
// 发推
|
|
|
- TwitterApiCreateTweet({ text: task_data.tweet_text, tweet_Id: task_data.tweet_Id })
|
|
|
+ TwitterApiCreateTweet({ text: task_data.tweet_text, tweet_Id: task_data.tweet_Id, iframeId })
|
|
|
break
|
|
|
}
|
|
|
|
|
@@ -1547,7 +1547,7 @@ const TwitterLikeAPI = (tweet_Id) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const TwitterApiCreateTweet = ({ text, tweet_Id }) => {
|
|
|
+const TwitterApiCreateTweet = ({ text, tweet_Id, iframeId }) => {
|
|
|
let data = {
|
|
|
queryId: "hC1nuE-2d1NX5LYBuuAvtQ",
|
|
|
features: {
|
|
@@ -1593,27 +1593,12 @@ const TwitterApiCreateTweet = ({ text, tweet_Id }) => {
|
|
|
"x-twitter-client-language": "en"
|
|
|
},
|
|
|
}).then(function (response) {
|
|
|
- console.log('TwitterApiCreateTweet1', response)
|
|
|
- sendChromeMessage('是', tweet_Id, response)
|
|
|
+ chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '是', response, iframeId })
|
|
|
}).catch(function (err) {
|
|
|
- console.log('TwitterApiCreateTweet2', err)
|
|
|
- sendChromeMessage('否', tweet_Id)
|
|
|
+ chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '否', iframeId })
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-const sendChromeMessage = (done, tweet_Id, response) => {
|
|
|
- try {
|
|
|
- console.log('sendChromeMessage', done)
|
|
|
- if (done == '是') {
|
|
|
- chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '是', response })
|
|
|
- } else {
|
|
|
- chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '否' })
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('catch', error)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
const TwitterApiUserByScreenNameReq = (params) => {
|
|
|
let { screen_name } = params || {};
|
|
|
return axios.get(`https://twitter.com/i/api/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22${screen_name}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`, {
|