Skip to content

Rough code for converting dumped Instagram data to a WordPress import file

Notifications You must be signed in to change notification settings

artlung/InstalooterToWordPress

Repository files navigation

InstalooterToWordPress

Background

The itch I needed to scratch was this: I had posts from many years ago that I had not imported to my personal website. I started using IFTTT in 2013 to import them as I posted them and that has worked okay since then. Instalooter is an excellent tool for downloading images and metadata for your instagram posts.

Requirements

You will need to be able to run a recent version of PHP on the command line. You'll need Instalooter running locally. data and run something like ``

Steps on the Command Line!

  1. cd instalooter_dumps

  2. Typical usage would be to download a particular user's data, in this case I'll use my own little used bloggingbot account as an example, use your own here. Note that I have not tested this against multiple-image posts or videos yet! But here's the command I used:

    instalooter user bloggingbot --dump-json

    Output:
    2020-08-16 14:33:33 MacbookLungPro.local instalooter.cli[37084] NOTICE Starting download of bloggingbot
    2020-08-16 14:33:34 MacbookLungPro.local instalooter.cli[37084] SUCCESS Downloaded 1 post.

  3. cd ..

  4. Edit run.php and edit the line that says $I2W->setBaseUrlForAssets and change the value to match where you are going to put these files. I use the WordPress plugin Import External Images 2 after import to import them into my WordPress instance. You may have another way. Also in run.php you can set the author name and email, which may be used if you don't set an existing author at import. Also you can add categories and tags to posts globally so you can manipulate them in bulk inside WordPress. Comment these out to not do that.

  5. php run.php

    Output:

    Reading JPEG 1722297278800439303.jpg
    Reading JSON 1722297278800439303.json
    generating xml for 2018

  6. You should now have a file called 2018.xml in the wordpress_imports directory you can import into WordPress.


Questions? Feel free to comment here or hit me on email [email protected] or twitter @artlung.

About

Rough code for converting dumped Instagram data to a WordPress import file

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages