How to import tweets to mastodon (e.g. https://framapiaf.org )
Thats a simples script to import yours tweets from any Twitter account to a Mastodon account, in any instance.
For this tutorial, you'll need to install Node.js and Git.
Go here for request your Twitter data. You'll recive a link to download a zip file. There will be tweets, images, information etc. It'll be in this configuration:
tweets.js
Extract the file in your Desktop folder. Will be more easy for manipulate. Find the tweets.js file. It'll be, probably inside "data" folder and move it to Desktop.
Clone this repo in your Desktop folder with the command:
git clone https://github.com/FGRibreau/import-tweets-to-mastodon.git
Or download the zip and extract in Desktop.
To request an API key from Mastodon, click here. Create an new application in "New Application". Set an Application Name (e. g.: api-mastodon-twitter) and, at the end of page, click in "Submit".
set MASTODON_API_BASEPATH=https://[YOUR-MASTODON-INSTANCE-DOMAIN]
set MASTODON_API_KEY=YOUR_ACCESS_TOKEN_FROM_MASTODON
set TWITTER_TWEETJS_FILEPATH=tweets.js
export MASTODON_API_BASEPATH=https://[YOUR-MASTODON-INSTANCE-DOMAIN]
export MASTODON_API_KEY=YOUR_ACCESS_TOKEN_FROM_MASTODON
export TWITTER_TWEETJS_FILEPATH=../tweets.js
In the terminal (or CMD), enter in "import-tweets-mastodon" folder, located in Desktop. Write
npm install
After this
node import.js