Comments (3)
https://help.flomoapp.com/basic/storage.html
flomo导出的数据是html格式的,如何导入到memos?今天看到一个仓库 Flomo To Json。还没测试,不知道导出的json格式是否兼容
尝试了一下发现有个小bug:部分memo输出的content会内容重复 例如a b会变成a a b b,需要注意一下
import json, csv, time
from datetime import datetime
def time2ts(x):
return int(datetime.strptime(x, "%Y-%m-%d %H:%M:%S").timestamp())
res = [["id","creator_id","created_ts","updated_ts","row_status","content","visibility"]]
for idx,i in enumerate(json.load(open("myMemos.json"))):
contents = i["content"]
if not contents:
continue
c = [contents[0]]
oldline = contents[0]
for line in contents:
if line==oldline:
continue
oldline = line
c.append(line)
res.append([1005+idx, 101, time2ts(i["time"]), time2ts(i["time"]), "NORMAL", "\n".join(c)+" ", "PRIVATE"])
csv.writer(open("out.csv", "w")).writerows(res)
我写了这个简单的python来转换为csv格式,然后用navicat手动导入了一下(从服务器复制db文件 navicat打开 对memo表导入 db文件复制到服务器替换) 效果还行
没有处理附件图片,其中1005需要改成当前表格最大id+1,101为authorid只有一个账号的话就是101,导入的content末尾加个空格是发现memos目前不会把末尾的tag认为是tag,除非加上了空格
from memos.
因为涉及到编码问题,我在这位作者的源代码基础上添加上了UTF-8编码参数,经测试使用没有问题
import json, csv, time
from datetime import datetime
def time2ts(x):
return int(datetime.strptime(x, "%Y-%m-%d %H:%M:%S").timestamp())
res = [["id","creator_id","created_ts","updated_ts","row_status","content","visibility"]]
for idx,i in enumerate(json.load(open("myMemos.json",encoding="UTF-8"))):
contents = i["content"]
if not contents:
continue
c = [contents[0]]
oldline = contents[0]
for line in contents:
if line==oldline:
continue
oldline = line
c.append(line)
res.append([1005+idx, 101, time2ts(i["time"]), time2ts(i["time"]), "NORMAL", "\n".join(c)+" ", "PRIVATE"])
csv.writer(open("out.csv", "w",encoding="UTF-8")).writerows(res)
from memos.
https://help.flomoapp.com/basic/storage.html
flomo导出的数据是html格式的,如何导入到memos?
今天看到一个仓库 Flomo To Json。还没测试,不知道导出的json格式是否兼容
from memos.
Related Issues (20)
- 使用内嵌方式添加引用时点击确定没有反应 HOT 2
- show comment count HOT 3
- 關於markdown無法定位圖片位置的問題 HOT 4
- cant create memo with picture HOT 6
- Edit note creation date HOT 1
- can't save new memos
- Tags List sorting
- markdown语法问题(Grammar issues) HOT 2
- Easire access to currently hidden features in note context menu HOT 3
- How to add CA certificate to transport to solve tls issue HOT 3
- Automated deleting expired memos HOT 4
- Tags UI Modification HOT 1
- 如果输入错误的格式就崩溃了 HOT 2
- index-DSN3RLTl.js:7350 Uncaught (in promise) TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
- Is it possible to send Telegram message to post new memo via Channel or Group?
- certain text pattern cause memos crash HOT 1
- Can someone help me understand what is Workspace? HOT 1
- No more memos but "fetch more" still available
- The prompt sequence of tags needs to be optimized. HOT 1
- Could not find the language '__mermaid', did you forget to load/include a language module? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memos.