提供一个工厂方法,创建电影、书籍、音乐、游戏对应的看过、在看、想看等条目的 Getter 方法。
现在阔以把标记为看过的影视、标记为读过的书、标记为玩过的游戏...以 JSON 格式存至本地。
引入包
yarn add https://github.com/hqweay/markall-douban-backup.git
使用
let createDoubanDataGetter = require('markall-douban-backup');
// 存储路径
const STORE_PATH = "douban-data-backup";
// 豆瓣帐号
const user = "";
let getDoubanWatchedMovies = createDoubanDataGetter("watchedMovies");
// 获取用户在豆瓣标记为看过的电影条目
getDoubanWatchedMovies(user, STORE_PATH);
Getter 的可选参数
getDoubanWatchedMovies(userName, STORE_PATH, endItemsCount = 999999, sleepTimer = 1500)
let getDoubanWatchedMovies = createDoubanDataGetter("watchedMovies");
let getDoubanWishMovies = createDoubanDataGetter("wishMovies");
let getDoubanWatchingMovies = createDoubanDataGetter("watchingMovies");
let getDoubanReadBooks = createDoubanDataGetter("readBooks");
let getDoubanWishBooks = createDoubanDataGetter("wishBooks");
let getDoubanReadingBooks = createDoubanDataGetter("readingBooks");
let getDoubanListenedMusics = createDoubanDataGetter("listenedMusics");
let getDoubanWishMusics = createDoubanDataGetter("wishMusics");
let getDoubanListeningMusics = createDoubanDataGetter("listeningMusics");
let getDoubanPlayedGames = createDoubanDataGetter("playedGames");
let getDoubanWishGames = createDoubanDataGetter("wishGames");
let getDoubanPlayingGames = createDoubanDataGetter("playingGames");
其它看 readme 吧 ^^...
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.