GithubHelp home page GithubHelp logo

migrate-notes-2-csb's Introduction

This is a project to help user migrate notes to Crossbell blockchain. For instance, you could migrate your WeChat moments(朋友圈) or qqzone feeds(说说) on Crossbell. After the migration, a new character will be created and you could see your notes on xFeed.

Getting Started

  1. Prepare your notes as following structure and then convert it to json file moments.json:
interface Moments {
    account: {
        banner?: string;
        avatar?: string;
        bio?: string;
        nickname: string;
        id: string;
    };
    moments: {
        content: string;
        type: "share" | "text";
        images: string[];
        display_images?: string[];
        share_title: string;
        share_desc: string;
        share_url: string;
        share_image?: string;
        publish_time: string;
        id: string;
    };
}

Note: the image urls are expected to be http(s), and if you hope to backup all images as well, rather than only urls, you could put all images under /public/images with the name that are base64 encoded from the http url.

const localImg = `/images/${Buffer.from(imgHttpUrl).toString("base64")}.jpg`
  1. Put moments.json in /public, and then run the project locally
npm run dev
# or
yarn dev
# or
pnpm dev

Finally in http://localhost:3000 you will see something like: display

  1. Upload notes to Crossbell

If you click "use local images", as said before, the image /images/${Buffer.from(imgHttpUrl).toString("base64")}.jpg will be used for images src, and also local images will be uploaded to ipfs. If not, images src will be http(s) urls, and images will not be uploaded to ipfs.

And after clicking the "上链存储" button, follow the instructions step by step, you will finally see something like that: display-onchain

Then you can go to xFeed as instructed to see your notes on Crossbell.

migrate-notes-2-csb's People

Contributors

atlasoin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.