Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
491 stars 46 forks source link

Feature request: Schedule tweets #570

Closed Timtendo12 closed 3 months ago

Timtendo12 commented 4 months ago

Hi! Im using your tool and it has really helped running my X account. I have one feature request that I think is missing from this tool. And that is the option to schedule a tweet.

It seems that its using the following API Endpoint:

https://x.com/i/api/graphql/LCVzRQGxOaGnOnYH01NQXg/CreateScheduledTweet

with the following body:

{
    "variables": {
        "post_tweet_request": {
            "auto_populate_reply_metadata": false,
            "status": "{TWEET DESCRIPTION}",
            "exclude_reply_user_ids": [],
            "media_ids": []
        },
        "execute_at": 1721460420
    },
    "queryId": "LCVzRQGxOaGnOnYH01NQXg"
}

with the 'execute_at' being the scheduled date in a unix timestamp. In this example 1721460420 equals to Sat Jul 20 2024 07:27:00 GMT+0000

Fetching scheduled tweets

Fetching scheduled tweets happen at the following endpoint:

https://x.com/i/api/graphql/ITtjAzvlZni2wWXwf295Qg/FetchScheduledTweets

so far I could only find 1 variable that can be used which is a boolen for "ascending" ?variables=%7B%22ascending%22%3Atrue%7D => ?variables={"ascending":true}

Timtendo12 commented 4 months ago

There is also 2 other endpoints, 1 for editing and 1 for deleting scheduled tweets. I might be able to get info on their API data later today.

Rishikant181 commented 4 months ago

Thanks for the code snippet. After some inspection and testing, I'll make sure to include it in the next feature update. Meanwhile, I'll keep this issue open. It will be closed only after the feature has been merged to the dev branch. After that, it might take some time before the new release is created from dev.

Thanks for the feedback!