WordPress: Importing Tweets with Twitter Archive to WP Plugin

WordPress: Importing Tweets with Twitter Archive to WP Plugin

@Tim@mastodon.timnolte.com recommended and introduced me to @shawnhooper@fosstodon.org on Mastodon who created a plugin called Twitter Archive to WP. This plugin uses the Twitter Archive. Previously, I was experimenting with a plugin to import my tweets. There appeared to be a limit of 199 tweets and I have 3,590 tweets, I tried the Twitter Archive to WP to see if it would import all of the tweets.

Setup

Install the Plugin

This post won’t include all of the instructions because I followed Shawn’s instruction in the readme.txt file. I will point out a few extra instructions.

I downloaded the plugin as a zip file. This took a few minutes because I wasn’t sure where the zip file was. 🙂 But then found it.

Aside: I found the setting that was causing all of my zip file to download and unzip automatically on my Mac. But I digress.

I uploaded the plugin into my WordPress Multisite website and enabled in my sandbox site. (This becomes important later on.)

Upload the Tweet Archive to the WordPress Uploads Folder

I made a copy of the Tweet archive on my local computer. I deleted all of the files except for the one’s that Shawn said to include in the instructions.

I zipped that file and uploaded to my site using the cPanel file manager. I then extracted the file.

Open the WP-CLI

You will have to figure out how to do this on your own. 🙂

Run the Command

Tip: The username is not the username that you log into WordPress with, it is a number. Since I am the only user on my site, the username was “1”.

When I ran the original command I received this message.

import-twitter’ is not a registered wp command

Shawn had me ensure the plugin was activated and it was on the sandbox site. I network activated the plugin and this error went away. I did not go back to see if I could have corrected this using the proper command line commands.

I ran it again and received the following error.

Warning: file_get_contents(/home/xxx/tmichellemoore.com/wp-content/uploads/twitter-archive/account.js): Failed to open stream: No such file or directory in /home/xxx/tmichellemoore.com/wp-content/plugins/twitter-archive-to-wp-main/classes/import-twitter-command.php on line 209
Error: Error while reading account.js: Syntax error

Tip: Ensure your files are in the correct folder. Mine were in a data subfolder and I had to move them up one level.

I ran the command again and receive this error.

Error: invalid post author ID.

Once all of the issues above were resolved the command ran correctly and the command line indicated that I imported 3,561 tweets. I possibly tweeted a few more after I downloaded the archive which may be why the numbers are different.

Results

Screenshots

Conclusion

Being able to import all of these tweets is a nice to have. If was not able to recover them, it would have been ok. Thanks to Shawn for his plugin because now I have them.

At this point, I will probably migrate them to a custom post type that I created so that I can have control over their disposition.

I would rate the skills needed to do this as intermediate and not beginner level.


Comments

10 responses to “WordPress: Importing Tweets with Twitter Archive to WP Plugin”

  1. This Article was mentioned on brid.gy

  2. This Article was mentioned on brid.gy

  3. This Article was mentioned on brid.gy

  4. This Article was mentioned on brid.gy

  5. This Article was mentioned on brid.gy

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.