Skip to content

Commit

Permalink
add icon and iconUrl field
Browse files Browse the repository at this point in the history
  • Loading branch information
CCharlieLi committed Jul 29, 2017
1 parent 9d860f7 commit 842f30f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
```
{
"Bookmarks": {
"id": "1c6a31e159e649ccb267c332a6b69b3b",
"id": "c2c584eb4059443592d05c97a02d1627",
"prevNode": "[Circular ~]",
"children": [
{
"addDate": "1496371119",
"lastModified": "1496459142",
"name": "Update Scanner's Pages",
"type": "folder",
"id": "1c6a31e159e649ccb267c332a6b69b3b-1",
"id": "c2c584eb4059443592d05c97a02d1627-1",
"prevNode": "[Circular ~.Bookmarks]",
"children": [
{
Expand All @@ -73,7 +73,7 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
"name": "Update Scanner Website",
"type": "bookmark",
"url": "https://addons.mozilla.org/firefox/addon/update-scanner/",
"id": "1c6a31e159e649ccb267c332a6b69b3b-1-1"
"id": "c2c584eb4059443592d05c97a02d1627-1-1"
}
]
},
Expand All @@ -82,25 +82,27 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
"lastModified": "1496466717",
"name": "Bookmarks Toolbar",
"type": "folder",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2",
"id": "c2c584eb4059443592d05c97a02d1627-2",
"description": "添加到此文件夹的书签会被显示到书签工具栏中",
"prevNode": "[Circular ~.Bookmarks]",
"children": [
{
"addDate": "1496371179",
"lastModified": "1496466729",
"name": "IFC Markets",
"name": "Charlie's blog",
"type": "bookmark",
"url": "https://private.ifcmarkets.com/zh_TW/accounts",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2-1",
"url": "http://www.charlieli.cn/",
"id": "c2c584eb4059443592d05c97a02d1627-2-1",
"iconUri": "",
"icon": "",
"description": "META_DESCRIPTION"
},
{
"addDate": "1489373938",
"lastModified": "1496456537",
"name": "Front",
"type": "folder",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2-2",
"id": "c2c584eb4059443592d05c97a02d1627-2-2",
"prevNode": "[Circular ~.Bookmarks.children.1]",
"children": [
{
Expand All @@ -109,7 +111,9 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
"name": "Nucleo",
"type": "bookmark",
"url": "https://nucleoapp.com/",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2-2-1",
"id": "c2c584eb4059443592d05c97a02d1627-2-2-1",
"iconUri": "https://nucleo1-ambercreativelab.netdna-ssl.com/wp-content/themes/nucleo-webapp-12/img/favicon.ico",
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB3klEQVRYhe3Xv27aUBQG8G9uBTZI/WOT7kkX7L4A5gEoNi+BmA2d4lgFx7FjbPw+IU8QsoYMSFiRKCytkif4OkDSdqhiEidupQzfes9POveeqwMArwD4ABIA358pCYDjTW34AJhTAgBY5Aj4BgDXOQJusOlJXoAfL4D/E1ASK1SqDWq1NrVam0q1wVKp8vQAQXhPQ+/zYP+MgTfnKFxyFC4ZeHPa1oSGPqAgSE8DkKRdds0TxtGK/tGMrnPJw8EFDwcXdJ1L+kczxtGKPXNMWd7LFlAovGHXPGE0XNwV/Vui4YI9c8xi8V12AL35lXG0urf4beJoRUPvZwMQRZkH+2f03FlqgOfOaFuTNBfzfoBSbfDYm9N1pqkBrjNl4M+pKs3HA7Ram6Nwmbr4XRvCJetaJxtAnCdAqX5+YAsSqmoGLRDFCm1r8sBLuJPNMzT0/tbPsKUPspsDxcJb9sxx+kHUPaUgZDiIAFCS9tgzx7+N4ukfPffc9Sj+0j2lLH9MU3w7AACKgsSW4dC2zhn4ya/PyE9oW+dsGQ5FUU5bfHvAbcqlHapKk3Wtw7rW4Se1yXL5w1ZnPAqQYV4A/wYgz8XkGsh3NVsA6wUxL0AIrFfkAMDVpifPkSsAQwCvfwKIVTuEZS4vqQAAAABJRU5ErkJggg==",
"description": "A library of 1000+ vector icons and a web app to manage and customize them."
},
{
Expand All @@ -118,7 +122,9 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
"name": "you-dont-need/You-Dont-Need-Javascript: Css is powerful, you can do a lot of things without js.",
"type": "bookmark",
"url": "https://github.com/you-dont-need/You-Dont-Need-Javascript",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2-2-2",
"id": "c2c584eb4059443592d05c97a02d1627-2-2-2",
"iconUri": "https://assets-cdn.github.com/favicon.ico",
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADC0lEQVRYhb2Wv2tUQRDHv9Fwefdul535zp7GRrGz9RcoiEIK/wdBjBhFOwsVxMI/wMbSQrSyiWKwE0t/NHbRIoURJdqI2iRBBZVocxeez93L5XI68Jo3M/v5zuzOvgf0b9F7P2Uid8zsZTRb3tpu/9rabv+KZstm9tJE7njvpwDEdazb28qy3E1y2sgfXeBaj5E/SE6XZbl7YLCqBpI3jVzpF5wQskLypqqGdVcdyTeDgutPJN/03Q3n3ISRi8OCV7qx6Jyb6AkPIez9F/CqiBDC3hxcjXxbS5gz8v4gooxc7OTO1d6/DSHoXwKMvF1fRFWPd9xj3vupaPahOnYUeUyRx9WxjGYfOqM4BgCqejwh7nb90O1LVVGW5Z5qnKqGRqOxC8CmRBM3NRqNXfUTX5blnsza+6rVz2SC9vc8NH1YWZb7M1s0040ZN/JnKkhEJjcqQEQmMwJ+AhiHOnc2FdAm3wPgRgUAIMl3KYY6dxYkp1NO7/2pIcABAN77UykGyWnUx6TbnnVfnz1MVUNqm42cQzT7+pfDbGFY8K6Z2UKdE82+ItWaaDY/bAHR7HWKlRRg5NKwBRi5lBSQdQBbhsjfki00isxm7oATw6KLyInkVovMguStjPMFgNEh8EejyIvMGN6CtlrHUs5OwPWN0klez62vrdYxAPDR7EsuyMh7AMYHYG8z8l5u3Wj2BYAHAKjqjVVVqtecc0co8qQi4nubvMsQznS+YpsTwFHfbB5U584ZOWPk9xy8w7mxmqmq26PZtw5shSIXAIwZ+TzRkRkAIwkBIybyoBe0Uv03Vd3+R7aIXK0GNZvNA0VR7Kx/SFT1UK7nzrnD/QgQkaup/FGSzyqVPupq895PqeqVVqt1NNP+rrXXgpN8hh7TNV69MkXkfA9YymSN1r/GWge6KIod0Wx+NSnGpxrCJe/9SVW9DKAYREA0my+KYke/lZDkw8wVLesVQPIhBvi5GWEIp6PZx0EFRPITQziD9NT0bY4iF8zslZGf0fndztiYkZ/N7BVDuAjAbQT8X+w36KQvZccCoxkAAAAASUVORK5CYII=",
"description": "You-Dont-Need-Javascript - Css is powerful, you can do a lot of things without js."
},
{
Expand All @@ -127,15 +133,17 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
"name": "Markdown.css - make HTML look like plain-text",
"type": "bookmark",
"url": "http://mrcoles.com/demo/markdown-css/",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2-2-3"
"id": "c2c584eb4059443592d05c97a02d1627-2-2-3"
},
{
"addDate": "1489488225",
"lastModified": "1489557893",
"name": "gaearon/redux",
"type": "bookmark",
"url": "https://github.com/gaearon/redux",
"id": "1c6a31e159e649ccb267c332a6b69b3b-2-2-4",
"id": "c2c584eb4059443592d05c97a02d1627-2-2-4",
"iconUri": "https://assets-cdn.github.com/favicon.ico",
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADC0lEQVRYhb2Wv2tUQRDHv9Fwefdul535zp7GRrGz9RcoiEIK/wdBjBhFOwsVxMI/wMbSQrSyiWKwE0t/NHbRIoURJdqI2iRBBZVocxeez93L5XI68Jo3M/v5zuzOvgf0b9F7P2Uid8zsZTRb3tpu/9rabv+KZstm9tJE7njvpwDEdazb28qy3E1y2sgfXeBaj5E/SE6XZbl7YLCqBpI3jVzpF5wQskLypqqGdVcdyTeDgutPJN/03Q3n3ISRi8OCV7qx6Jyb6AkPIez9F/CqiBDC3hxcjXxbS5gz8v4gooxc7OTO1d6/DSHoXwKMvF1fRFWPd9xj3vupaPahOnYUeUyRx9WxjGYfOqM4BgCqejwh7nb90O1LVVGW5Z5qnKqGRqOxC8CmRBM3NRqNXfUTX5blnsza+6rVz2SC9vc8NH1YWZb7M1s0040ZN/JnKkhEJjcqQEQmMwJ+AhiHOnc2FdAm3wPgRgUAIMl3KYY6dxYkp1NO7/2pIcABAN77UykGyWnUx6TbnnVfnz1MVUNqm42cQzT7+pfDbGFY8K6Z2UKdE82+ItWaaDY/bAHR7HWKlRRg5NKwBRi5lBSQdQBbhsjfki00isxm7oATw6KLyInkVovMguStjPMFgNEh8EejyIvMGN6CtlrHUs5OwPWN0klez62vrdYxAPDR7EsuyMh7AMYHYG8z8l5u3Wj2BYAHAKjqjVVVqtecc0co8qQi4nubvMsQznS+YpsTwFHfbB5U584ZOWPk9xy8w7mxmqmq26PZtw5shSIXAIwZ+TzRkRkAIwkBIybyoBe0Uv03Vd3+R7aIXK0GNZvNA0VR7Kx/SFT1UK7nzrnD/QgQkaup/FGSzyqVPupq895PqeqVVqt1NNP+rrXXgpN8hh7TNV69MkXkfA9YymSN1r/GWge6KIod0Wx+NSnGpxrCJe/9SVW9DKAYREA0my+KYke/lZDkw8wVLesVQPIhBvi5GWEIp6PZx0EFRPITQziD9NT0bY4iF8zslZGf0fndztiYkZ/N7BVDuAjAbQT8X+w36KQvZccCoxkAAAAASUVORK5CYII=",
"description": "redux - Atomic Flux with hot reloading"
}
]
Expand All @@ -145,6 +153,7 @@ BMParser.findFromLocalhost(exportFilePath).then(res => { ... });
]
}
}
```

### [Change log](https://github.com/CCharlieLi/Bookmark/blob/master/History.md)
Expand Down
4 changes: 3 additions & 1 deletion lib/bookmark_parser/html_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ module.exports = (fileStream) => {
name: tmp['A']['$t'],
type: 'bookmark',
url: tmp['A']['HREF'],
id: `${idQueue.join('-')}-${++subId}`
id: `${idQueue.join('-')}-${++subId}`,
iconUri: tmp['A']['ICON_URI'],
icon: tmp['A']['ICON']
});
latestNode = currentNode.children[currentNode.children.length - 1];
}
Expand Down

0 comments on commit 842f30f

Please sign in to comment.