migrating emoji

may not cover all emojis
download by left clicking from

…which will lead to the right name

discourse requires maximum batch size of upload of 20, use the script to split files to dirs

dir_size=20
dir_name="folder"
n=$((`find . -maxdepth 1 -type f | wc -l`/$dir_size+1))
for i in `seq 1 $n`;
do
    mkdir -p "$dir_name$i";
    find . -maxdepth 1 -type f | head -n $dir_size | xargs -i mv "{}" "$dir_name$i"
done

reactions

DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "cat_hugs"
        t.reaction_value = "hugging_face_cat"
        t.save!
        puts t.postid
    end
end

DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "face_holding_back_tears"
        t.reaction_value = "face_holding_back_tears_hugging_face"
        t.save!
        puts t.post_id
    end
end


DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "exploding_head_hugs"
        t.reaction_value = "hugging_face_exploding_head"
        t.save!
        puts t.post_id
    end
end

DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "sweat_smile_pleading"
        t.reaction_value = "sweat_smile_pleading_face"
        t.save!
    end
end

DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "innocent_kissing_heart"
        t.reaction_value = "kissing_heart_innocent"
        t.save!
    end
end
DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "magic_joy"
        t.reaction_value = "magic_wand_grin"
        t.save!
    end
end
DiscourseReactions::Reaction.find_each do |t|
    if t.reaction_value == "rofl_kissing_heart"
        t.reaction_value = "rolling_on_the_floor_laughing_kissing_heart"
        t.save!
    end
end

retort

Retort.find_each do |t|
    if t.emoji == "cat_hugs"
        t.emoji = "hugging_face_cat"
        t.save!
        puts t.post_id
    end
end

Retort.find_each do |t|
    if t.emoji == "face_holding_back_tears"
        t.emoji = "face_holding_back_tears_hugging_face"
        t.save!
        puts t.post_id
    end
end


Retort.find_each do |t|
    if t.emoji == "exploding_head_hugs"
        t.emoji = "hugging_face_exploding_head"
        t.save!
        puts t.post_id
    end
end

Retort.find_each do |t|
    if t.emoji == "sweat_smile_pleading"
        t.emoji = "sweat_smile_pleading_face"
        t.save!
    end
end

Retort.find_each do |t|
    if t.emoji == "innocent_kissing_heart"
        t.emoji = "kissing_heart_innocent"
        t.save!
    end
end
Retort.find_each do |t|
    if t.emoji == "magic_joy"
        t.emoji = "magic_wand_grin"
        t.save!
    end
end
Retort.find_each do |t|
    if t.emoji == "rofl_kissing_heart"
        t.emoji = "rolling_on_the_floor_laughing_kissing_heart"
        t.save!
    end
end
1 Like

发现有趣的可以下载下来发给我添加

2 Likes