我想要一个 JavaScript 代码,它允许我指定某个关键字并让 Twitter 点击包含该关键字的链接。该脚本应为 Google Chrome 编写,并且必须与互联网 Twitter 源 TweetDeck 一起使用。我试过这个,但无济于事。
set myKeyword to "Jordan"
tell application "Google Chrome"
tell window 1 to tell active tab
set URL to "https://web.tweetdeck.com/"
delay 3
set num_links to (execute javascript "document.links.length") - 1
repeat with i from 0 to num_links
set myLink to execute javascript "document.links[" & i & "].href"
if myLink contains myKeyword then
execute javascript "document.links[" & i & "].click()"
end if
end repeat
end tell
end tell