A simple Python tool to import your Facebook data dump into Textile Photos
A few months ago, we wrote a simple tool to automatically export your Facebook photo export back into nice, easy to use folders for easier management of your data. The tool turned out to be pretty popular for a while, and gave us some pretty good insight into some of the motivations around #deletefacebook and similar calls to take control of personal data.
Since then, we’ve continued to work on Textile Photos as a safe, secure alternative to photo sharing! So one of the things we’ve wanted to do for a while now is make it easier to import your existing photo feeds (or at least, past feeds) into Textile. Today, we’re demoing a simple command-line tool for developers and our early adopters who want to play around with this a bit. But expect much easier-to-use, user-centric version(s) of this and other tools to come out from the Textile team over the next few months.
Import Facebook & Instagram Photos
All you need to get this tool working is a recent version of Textile, your Facebook data dump, and this simple Python script. We’ll go through the steps to getting all these things setup below, but for the impatient, here’s the tool:
Usage: fb2texile.py [OPTIONS] PATH Takes a Facebook backup archive <PATH> and creates Textile photo groups. Options: -e, --exec PATH Path to your Textile executable (default:textile). --help Show this message and exit.
If you don’t already have Textile installed, you can follow this guide. Really, all you need for this tool to work is the right Textile binary for your system. With that, you can install it, initialize a new Textile repo, and then just point the above Python script to your Textile binary to get importing. Pretty easy.
Deleting your Facebook account is a serious decision, so make sure it’s something you really want to do. Whether you like it or not, social media is ingrained in society… you have been warned. With that in mind, you can go ahead and navigate to the delete account help page on Facebook. Here you’ll see options to deactivate your account, download your data, and even delete your account permanently. Let’s download your data before doing anything drastic…
After clicking Download Info, you’ll be presented with a page with some options. I’ve opted for the JSON download of everything, which is essentially what the Python tool is expecting.
Because this download contains your profile information, you should keep it secure and be careful when storing, sending, or uploading it to any other services. If you have any concerns, be sure to take a look at the Python script to make sure we aren’t trying to steal your data, and get in touch if you have any questions!
Now the easy part, assuming you have Textile installed somewhere reasonable, all you need to do is install one Python dependency (click, which makes for a nice command-line interface), and point the script at your data dump. If you have Textile installed somewhere different, you can specify its location with the script using the -e option (see python3 fb2textile.py --help for some details):
textile daemon pip install click backports.tempfile python facebook.py /path/to/facebook-name.zip
The script basically just wraps the textile binary calls with subprocess, so its quite simple and not very ‘smart’. But it does the trick, and provides a nice way to wrap up a series of clunky manual commands into a single tool. I’ve really only tested the tool with Python 3.2+, but it should work with Python 2.7–3.1 (you’ll need to pip install backports.tempfile). Your mileage may vary of course…
Once the import is done, you can check that you have a bunch of new Threads with photos in them using the Textile command-line tools:
textile threads ls # List threads textile ls # List photos/files
It even imports and adds comments! How fun is that?
With last week’s Textile Photos (textile-mobile) release, you can now invite your mobile Peer to these Threads. This means you can have your exported photos on your phone as well! Its pretty easy to get this setup. All you need to do is create an invite — or even better, send a direct invite to your mobile peer — from the command-line tool. You can do this via the textile invites create tool. And you can grab your phone’s peer id from your account page (gear icon on top right). Then, from the command-line just do: textile invites create -p <peer-id>. It works really nicely if your phone and desktop are on the same network… but it should also work remotely.
Speaking of mobile apps… why not get you friends to sign up for our Textile Photos waitlist so they too can get early access to our upcoming releases! While you’re at it, feel free to get them to check out some of our other stories, to see what we’re building with IPFS. They can always drop us a line and tell us what cool distributed web projects they’re working on — we’d love to hear about them!