Skip to content

Commit

Permalink
chore: host memos.json local
Browse files Browse the repository at this point in the history
  • Loading branch information
eallion committed Aug 21, 2023
1 parent e6406da commit 1d365aa
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 9 deletions.
20 changes: 12 additions & 8 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ if (typeof (memos) !== "undefined") {

var limit = memo.limit
var memos = memo.host.replace(/\/$/, '')
var memoUrl = memos + "/api/v1/memo?creatorId=" + memo.creatorId + "&rowStatus=NORMAL"
//var memoUrl = memos + "/api/v1/memo?creatorId=" + memo.creatorId + "&rowStatus=NORMAL"
memoUrl = "../assets/memos.json"
var page = 1,
offset = 0,
nextLength = 0,
Expand Down Expand Up @@ -93,7 +94,8 @@ if (memoDom) {
}

function getFirstList() {
var memoUrl_first = memoUrl + "&limit=" + limit;
// var memoUrl_first = memoUrl + "&limit=" + limit;
var memoUrl_first = memoUrl
fetch(memoUrl_first).then(res => res.json()).then(resdata => {
updateHTMl(resdata)
var nowLength = resdata.length
Expand All @@ -109,11 +111,12 @@ function getFirstList() {
}
// 预加载下一页数据
function getNextList() {
if (tag){
var memoUrl_next = memoUrl + "&limit=" + limit + "&offset=" + offset + "&tag=" + tag;
} else {
var memoUrl_next = memoUrl + "&limit=" + limit + "&offset=" + offset;
}
// if (tag){
// var memoUrl_next = memoUrl + "&limit=" + limit + "&offset=" + offset + "&tag=" + tag;
// } else {
// var memoUrl_next = memoUrl + "&limit=" + limit + "&offset=" + offset;
// }
var memoUrl_next = memoUrl
fetch(memoUrl_next).then(res => res.json()).then(resdata => {
nextDom = resdata
nextLength = nextDom.length
Expand Down Expand Up @@ -167,7 +170,8 @@ function getTagFirstList() {
nextLength = 0;
nextDom = '';
memoDom.innerHTML = "";
var memoUrl_tag = memoUrl + "&limit=" + limit + "&tag=" + tag;
// var memoUrl_tag = memoUrl + "&limit=" + limit + "&tag=" + tag;
var memoUrl_tag = memoUrl
fetch(memoUrl_tag).then(res => res.json()).then(resdata => {
updateHTMl(resdata);
var nowLength = resdata.length
Expand Down
212 changes: 212 additions & 0 deletions assets/memos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
[
{
"id": 5526,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670079000,
"updatedTs": 1670079004,
"displayTs": 1670079000,
"content": "#Hello 👋 Welcome to [https://memos.top/](https://memos.top/)",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5540,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670078984,
"updatedTs": 1670079030,
"displayTs": 1670078984,
"content": "《Miłość od pierwszego wejrzenia》 - 辛波斯卡",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5539,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670078926,
"updatedTs": 1670079035,
"displayTs": 1670078926,
"content": "他们彼此深信,是瞬间迸发的热情让他们相遇。<br />Oboje są przekonani, że połączyło ich uczucie nagłe.",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5538,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670078918,
"updatedTs": 1670079044,
"displayTs": 1670078918,
"content": "这样的确定是美丽的,但变幻无常更为美丽。<br />Piękna jest taka pewność, ale niepewność piękniejsza.",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5537,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670078912,
"updatedTs": 1670079050,
"displayTs": 1670078912,
"content": "他们素未谋面,所以他们确定彼此并无任何瓜葛。<br />Sądzą, że skoro nie znali się wcześniej, nic między nimi nigdy się nie działo.",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5527,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670077260,
"updatedTs": 1670079074,
"displayTs": 1670077260,
"content": "- [ ] To do something.",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5535,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670077242,
"updatedTs": 1678858812,
"displayTs": 1670077242,
"content": "#Picture #Image \nBing daily 必应每日一图。\n![](https://api.eallion.com/bing?region=zh-CN&type=image)",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5534,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670077007,
"updatedTs": 1670077072,
"displayTs": 1670077007,
"content": "HTML\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n \u003cmeta charset=\"UTF-8\"\u003e\n \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"\u003e\n \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n \u003ctitle\u003eDocument\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n \n\u003c/body\u003e\n\u003c/html\u003e\n```\nCSS\n```css\n.hidden {\n display: none;\n}\n```\nJS\n```js\nconsole.log(hello memos)\n```",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5533,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670076814,
"updatedTs": 1670076814,
"displayTs": 1670076814,
"content": "#电影 \n分享豆瓣电影《星际穿越》\nhttps://movie.douban.com/subject/1889243/",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5532,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670076761,
"updatedTs": 1670076761,
"displayTs": 1670076761,
"content": "#读书 \n分享豆瓣读书《苏菲的世界》-(挪威)乔斯坦·贾德\nhttps://book.douban.com/subject/1045818/",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5529,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670076381,
"updatedTs": 1670076381,
"displayTs": 1670076381,
"content": "#音乐 \n分享来自 QQ 音乐的《平凡之路》- 朴树\nhttps://y.qq.com/n/ryqq/songDetail/000T1Ws32MWrUj",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5528,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670076309,
"updatedTs": 1670076309,
"displayTs": 1670076309,
"content": "#音乐 \n分享来自网易云音乐的《光辉岁月》- Beyond\nhttps://music.163.com/#/song?id=346576",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5530,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670076240,
"updatedTs": 1670077572,
"displayTs": 1670076240,
"content": "#视频 \n分享来自 Bilibili 的视频 《【华语巅峰】2004年华语乐坛金曲榜TOP120》\nhttps://www.bilibili.com/video/BV1bq4y137DD/",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
},
{
"id": 5531,
"rowStatus": "NORMAL",
"creatorId": 102,
"createdTs": 1670076120,
"updatedTs": 1670078710,
"displayTs": 1670076120,
"content": "#视频 \n分享来自 Youtube 的父爱视频《What is that?》\nhttps://www.youtube.com/watch?v=mNK6h1dfy2o",
"visibility": "PUBLIC",
"pinned": false,
"creatorName": "demo",
"creatorUsername": "demo",
"resourceList": [],
"relationList": []
}
]
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1>Memos Top</h1>
<p>Je <del>memos</del>, donc je suis - <em>René Descartes fans</em></p>
</blockquote>

<div class="total">Total <span id="total">10</span> Memos 🎉 ( Demo from <a href="https://memos.eallion.com/u/102" target="_blank" rel="noopener noreferrer">https://memos.eallion.com/u/102</a> )</div>
<div class="total">Total <span id="total">10</span> Memos 🎉 ( Demo from <a href="https://eallion.com/" target="_blank" rel="noopener noreferrer">https://eallion.com</a> )</div>

<div id="memos" class="memos">
<!-- Memos Container -->
Expand Down

1 comment on commit 1d365aa

@vercel
Copy link

@vercel vercel bot commented on 1d365aa Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

memostop – ./

memostop-git-gh-pages-eallion.vercel.app
memostop-eallion.vercel.app
memos.top

Please sign in to comment.