Пример #1
0
        internal static void ParseBookmarks(string parserType, string bookmarksFile, string outputPath)
        {
            Bookmarks2Json converter = null;

            switch (parserType)
            {
            case "delicious":
                converter = new Bookmarks2Json(new DeliciousParser.Parser());
                break;

            case "bibsonomy":
                converter = new Bookmarks2Json(new BibsonomyParser.Parser());
                break;

            case "pinterest":
                converter = new Bookmarks2Json(new PinterestParser.Parser());
                break;

            case "gitmarks":
                converter = new Bookmarks2Json(new GitmarksParser.Parser());
                break;
            }

            var content = converter.Write(bookmarksFile);

            using (var writer = new StreamWriter(outputPath))
            {
                writer.Write(content);
            }
        }
        public void TestMergeBookmarks(string file1, string file2, string outputPath)
        {
            var bookmarks = MergeBookmarks.Merge(file1, file2);

            string content = Bookmarks2Json.ExportToMongoFormat(bookmarks);

            using (var writer = new StreamWriter(outputPath))
            {
                writer.Write(content);
            }
        }