<commit_before>var libxmljs = require("libxmljs");
var fs = require("fs");
var parseArgs = require("minimist");

var argv = parseArgs(process.argv.slice(2), {
    default: {
        l: process.env["HOME"] + "/Music/iTunes"
    }
});

var playListName = argv.p;
var libraryFile = argv.l + "/iTunes\ Music\ Library.xml"; 

if (!playListName) {
    console.log("No play list name specified.");
    console.log("usage: node save_tunes.js -p %playlist_name% -l %library_path%");
    process.exit(1);
}

fs.readFile(libraryFile, function(err, data) {
    if (err) {
        console.log("Cannot open iTunes library file.");
        return;
    }

    var doc = libxmljs.parseXmlString(data),
        tracksNode = doc.get("dict/key[text()='Tracks']/following-sibling::dict[1]"),
        playlistsNode = doc.get("dict/key[text()='Playlists']/following-sibling::array[1]"),<commit_msg>Info message extended a bit.<commit_after>var libxmljs = require("libxmljs");
var fs = require("fs");
var parseArgs = require("minimist");

var argv = parseArgs(process.argv.slice(2), {
    default: {
        l: process.env["HOME"] + "/Music/iTunes"
    }
});

var playListName = argv.p;
var libraryFile = argv.l + "/iTunes\ Music\ Library.xml"; 

if (!playListName) {
    console.log("No play list name specified.");
    console.log("usage: node save_tunes.js -p %playlist_name% -l %library_path%");
    process.exit(1);
}

fs.readFile(libraryFile, function(err, data) {
    if (err) {
        console.log("Cannot open iTunes library file (iTunes Music Library.xml).");
        return;
    }

    var doc = libxmljs.parseXmlString(data),
        tracksNode = doc.get("dict/key[text()='Tracks']/following-sibling::dict[1]"),
        playlistsNode = doc.get("dict/key[text()='Playlists']/following-sibling::array[1]"),
{'fraction_non_alphanumeric': 0.17522321428571427, 'fraction_numerical': 0.004464285714285714, 'mean_word_length': 3.718421052631579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7168782', 'n_tokens_mistral': 616, 'n_tokens_neox': 607, 'n_words': 122}