Skip to content

Instantly share code, notes, and snippets.

@programizer
Created September 6, 2018 13:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save programizer/b80271b096706e0cd2bcec37fcae9c45 to your computer and use it in GitHub Desktop.
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