Skip to content

Commit

Permalink
fix tweet length counting
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 11, 2023
1 parent 0ed1dfe commit 0301418
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,8 @@ const API = {
variables.attachment_url = tweet.attachment_url;
}
debugLog('tweet.postV2', 'init', {tweet, variables});
fetch(`https://twitter.com/i/api/graphql/${text.length > 280 ? 'pokID4auGUSzBxijrqpIlw/CreateNoteTweet' : 'tTsjMKyhajZvK4q76mpIBg/CreateTweet'}`, {
let parsedTweet = twttr.txt.parseTweet(text);
fetch(`https://twitter.com/i/api/graphql/${parsedTweet.weightedLength > 280 ? 'pokID4auGUSzBxijrqpIlw/CreateNoteTweet' : 'tTsjMKyhajZvK4q76mpIBg/CreateTweet'}`, {
method: 'POST',
headers: {
"authorization": OLDTWITTER_CONFIG.public_token,
Expand Down

0 comments on commit 0301418

Please sign in to comment.