特定の日時のリンク一覧を取得
Twitterでブログなどに特定の日時のツイートのリンクをコピーしたいことがある。
例えばiwb.jpの場合は月に一度いいねのページから前月のリンク一覧をコピーしてブログに貼り付けて投稿している。
やり方は簡単で必要な範囲のツイートが表示されるまでスクロールしてChromeのデベロッパーツールで下記のコマンドを実行するだけだ。
// 実行するとundefinedと表示されるが問題なクリップボードにコピーされている copy($$('.stream-items [title*="2017年2月"]').reverse().join('\n'))
reverse()は取得した順番を反転するために使用している。
例えばtrump taxと検索してスクロールしてツイートを一定量表示させたあとに下記を実行すれば2017年2月4日分のツイートのリンク一覧をコピーすることができる。
copy($$('.stream-items [title*="2017年2月4日"]').join('\n'))
コピーしてブログに貼り付けると以下のように表示される。
Not only is it a golf resort, trump makes money going there. Our tax money. https://t.co/uEtLusdhkD
— pam (@realpamdorra) February 4, 2017
Daily reminder that Trump still has not divested from his many many businesses. Nor has he released his tax returns.
— Talia (@2020fight) February 4, 2017
As Trump flies to FL on vacation on Air Force One, it's a good time to revisit his feelings about wasting tax payer money in this way. https://t.co/rLi3x6CyVG
— A Once Great Nation (@USARedOrchestra) February 4, 2017
40+ million Americans live in poverty, but Trump spends tax $$$ to keep his wife away & can't think of anything to pray for besides ratings.
— Kaivan Shroff (@KaivanShroff) February 4, 2017
https://twitter.com/StopTrump2020/status/827678005627613184
Trump says he'll only take a salary of $1, but we prefer he take full salary &stop squandering tax dollars on Erik's business trips #Uruguay
— Millennial Democrats (@Millennial_Dems) February 4, 2017
LOL‼️ Al Sharpton's daughter arrested protesting at Trump Tower. When is her daddy getting arrested for tax evasion? https://t.co/1Ae2CmTk99
— Cristina Laila (@cristinalaila1) February 3, 2017
Schwarzenegger fans the flames of Trump feud with a jab about his tax returns https://t.co/aJ0N0v5qvx pic.twitter.com/2XiJbMpc5e
— The Hill (@thehill) February 3, 2017
The @washingtonpost says Eric Trump's trip to Uruguay for the Trump Organization cost tax payers nearly $100k. https://t.co/Wj5cEdeDDv
— Twitter Moments (@TwitterMoments) February 3, 2017
This U.S. has over 500,000 homeless. The $97,830 in tax dollars spent on Erik Trump's #Uruguay trip could've fed 60,000 of them a hot meal.
— Kaivan Shroff (@KaivanShroff) February 3, 2017
If Trump spends all our tax money on keeping Melania in NY & sending Erik on personal trips to Uruguay-what will we use to pay for the wall?
— Kaivan Shroff (@KaivanShroff) February 3, 2017