Skip to content

Commit

Permalink
fix tweet counts
Browse files Browse the repository at this point in the history
Trying to calculate the difference was probably a bad idea.
  • Loading branch information
lucahammer authored Nov 23, 2024
1 parent de8d566 commit 8f7a735
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tweetXer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name TweetXer
// @namespace https://github.com/lucahammer/tweetXer/
// @version 0.8.1
// @version 0.8.2
// @description Delete all your Tweets for free.
// @author Luca,dbort,pReya,Micolithe,STrRedWolf
// @license NoHarm-draft
Expand Down Expand Up @@ -403,13 +403,15 @@
.replace(/\.(\d+)K/, '$1'.padEnd(4, '0'))
.replace('K', '000')
.replace(',', '')
.replace('.', '')
} catch (error) {
try {
TweetsXer.TweetCount = document.querySelector('[data-testid="TopNavBar"]>div>div')
.textContent.match(/((\d|,|\.|K)+) (\w+)$/)[1]
.replace(/\.(\d+)K/, '$1'.padEnd(4, '0'))
.replace('K', '000')
.replace(',', '')
.replace('.', '')
}
catch (error) {
console.log("Wasn't able to find Tweet count on profile. Setting it to 1 million.")
Expand Down

0 comments on commit 8f7a735

Please sign in to comment.