LinkiePie Personal Backups

While I do have off-site backups for linkiepie.com, why not take the safety of your data into your own hands?

Here I will quickly document a simple method of backing up all your link data stored in LinkiePie using the API. As mentioned in a previous post you can access your API key in the settings page ( https://linkiepie.com/settings/ ).

Using this API key you can issue a request to access a JSON blob of all your data. Let's use curl in a simple shell script to download it and save it to your home directory.
#!/usr/bin/env sh

curl -s "https://linkiepie.com/api/v1/links/?username=YOUR_USERNAME&api_key=YOUR_API_KEY&format=json&limit=0&offset=0" -o "$HOME/linkiepie_backup.json"
This will save a JSON file containing all of the links (and associated data) you have added to LinkiePie. This includes data such as the URL and extracted summary text of each link.

Depending on how much you use LinkiePie this may be quite a large file. I like to use an awesome tool called jq for exploring and extracting useful information from JSON files. Here's an example of using jq for extracting just the URLs from this file.

cat linkiepie_backup.json | jq '.objects[].url'

You can add the above sh script to cron for automatic periodic backups.

Easy :)
This was posted on Wed 06 Jan 2016 by Ryan McConville