Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'json'
filename = '<username>_diaspora_data_<hash>.json'
username = '<username>'
file = File.read(filename)
data_hash = JSON.parse(file)
bio = data_hash['user']['profile']['entity_data']['bio']
user = User.find_by(username: username)
profile = Profile.find_by(id: user.id)
profile.update(bio: bio)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment