summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprzemyslawpluta <przemekpluta@hotmail.com>2015-08-06 22:06:44 +0100
committerprzemyslawpluta <przemekpluta@hotmail.com>2015-08-06 22:06:44 +0100
commit26d1a1af0a7ad4d8fef24be22bd579ed292fc2f3 (patch)
treeeb05b13ed0eabffca6f57ab08d7821ecc20020f4
parent6dfe97bfb474c53d91ee000f30ac8d5a4bcf0be9 (diff)
downloadmongo-edu-26d1a1af0a7ad4d8fef24be22bd579ed292fc2f3.zip
add video preferences check and control
-rw-r--r--lib/emoji.js859
-rw-r--r--lib/initialize.js47
-rw-r--r--lib/login.js59
-rw-r--r--lib/prompts.js2
-rw-r--r--package.json8
5 files changed, 957 insertions, 18 deletions
diff --git a/lib/emoji.js b/lib/emoji.js
new file mode 100644
index 0000000..112b2cd
--- /dev/null
+++ b/lib/emoji.js
@@ -0,0 +1,859 @@
+'use strict';
+
+// via emoji-named-characters
+module.exports = {
+ "100": "๐Ÿ’ฏ",
+ "1234": "๐Ÿ”ข",
+ "+1": "๐Ÿ‘",
+ "-1": "๐Ÿ‘Ž",
+ "8ball": "๐ŸŽฑ",
+ "a": "๐Ÿ…ฐ",
+ "ab": "๐Ÿ†Ž",
+ "abc": "๐Ÿ”ค",
+ "abcd": "๐Ÿ”ก",
+ "accept": "๐Ÿ‰‘",
+ "aerial_tramway": "๐Ÿšก",
+ "airplane": "โœˆ๏ธ",
+ "alarm_clock": "โฐ",
+ "alien": "๐Ÿ‘ฝ",
+ "ambulance": "๐Ÿš‘",
+ "anchor": "โš“๏ธ",
+ "angel": "๐Ÿ‘ผ",
+ "anger": "๐Ÿ’ข",
+ "angry": "๐Ÿ˜ ",
+ "anguished": "๐Ÿ˜Ÿ",
+ "ant": "๐Ÿœ",
+ "apple": "๐ŸŽ",
+ "aquarius": "โ™’๏ธ",
+ "aries": "โ™ˆ๏ธ",
+ "arrow_backward": "โ—€๏ธ",
+ "arrow_double_down": "โฌ",
+ "arrow_double_up": "โซ",
+ "arrow_down": "โฌ‡๏ธ",
+ "arrow_down_small": "๐Ÿ”ฝ",
+ "arrow_forward": "โ–ถ๏ธ",
+ "arrow_heading_down": "โคต๏ธ",
+ "arrow_heading_up": "โคด๏ธ",
+ "arrow_left": "โฌ…๏ธ",
+ "arrow_lower_left": "โ†™๏ธ",
+ "arrow_lower_right": "โ†˜๏ธ",
+ "arrow_right": "โžก๏ธ",
+ "arrow_right_hook": "โ†ช๏ธ",
+ "arrow_up": "โฌ†๏ธ",
+ "arrow_up_down": "โ†•๏ธ",
+ "arrow_up_small": "๐Ÿ”ผ",
+ "arrow_upper_left": "โ†–๏ธ",
+ "arrow_upper_right": "โ†—๏ธ",
+ "arrows_clockwise": "๐Ÿ”ƒ",
+ "arrows_counterclockwise": "๐Ÿ”„",
+ "art": "๐ŸŽจ",
+ "articulated_lorry": "๐Ÿš›",
+ "astonished": "๐Ÿ˜ฒ",
+ "atm": "๐Ÿง",
+ "b": "๐Ÿ…ฑ",
+ "baby": "๐Ÿ‘ถ",
+ "baby_bottle": "๐Ÿผ",
+ "baby_chick": "๐Ÿค",
+ "baby_symbol": "๐Ÿšผ",
+ "baggage_claim": "๐Ÿ›„",
+ "balloon": "๐ŸŽˆ",
+ "ballot_box_with_check": "โ˜‘๏ธ",
+ "bamboo": "๐ŸŽ",
+ "banana": "๐ŸŒ",
+ "bangbang": "โ€ผ๏ธ",
+ "bank": "๐Ÿฆ",
+ "bar_chart": "๐Ÿ“Š",
+ "barber": "๐Ÿ’ˆ",
+ "baseball": "โšพ๏ธ",
+ "basketball": "๐Ÿ€",
+ "bath": "๐Ÿ›€",
+ "bathtub": "๐Ÿ›",
+ "battery": "๐Ÿ”‹",
+ "bear": "๐Ÿป",
+ "bee": "๐Ÿ",
+ "beer": "๐Ÿบ",
+ "beers": "๐Ÿป",
+ "beetle": "๐Ÿž",
+ "beginner": "๐Ÿ”ฐ",
+ "bell": "๐Ÿ””",
+ "bento": "๐Ÿฑ",
+ "bicyclist": "๐Ÿšด",
+ "bike": "๐Ÿšฒ",
+ "bikini": "๐Ÿ‘™",
+ "bird": "๐Ÿฆ",
+ "birthday": "๐ŸŽ‚",
+ "black_circle": "โšซ",
+ "black_joker": "๐Ÿƒ",
+ "black_nib": "โœ’๏ธ",
+ "black_square": "โฌ›๏ธ",
+ "black_square_button": "๐Ÿ”ฒ",
+ "blossom": "๐ŸŒผ",
+ "blowfish": "๐Ÿก",
+ "blue_book": "๐Ÿ“˜",
+ "blue_car": "๐Ÿš™",
+ "blue_heart": "๐Ÿ’™",
+ "blush": "๐Ÿ˜Š",
+ "boar": "๐Ÿ—",
+ "boat": "โ›ต๏ธ",
+ "bomb": "๐Ÿ’ฃ",
+ "book": "๐Ÿ“–",
+ "bookmark": "๐Ÿ”–",
+ "bookmark_tabs": "๐Ÿ“‘",
+ "books": "๐Ÿ“š",
+ "boom": "๐Ÿ’ฅ",
+ "boot": "๐Ÿ‘ข",
+ "bouquet": "๐Ÿ’",
+ "bow": "๐Ÿ™‡",
+ "bowling": "๐ŸŽณ",
+ "boy": "๐Ÿ‘ฆ",
+ "bread": "๐Ÿž",
+ "bride_with_veil": "๐Ÿ‘ฐ",
+ "bridge_at_night": "๐ŸŒ‰",
+ "briefcase": "๐Ÿ’ผ",
+ "broken_heart": "๐Ÿ’”",
+ "bug": "๐Ÿ›",
+ "bulb": "๐Ÿ’ก",
+ "bullettrain_front": "๐Ÿš†",
+ "bullettrain_side": "๐Ÿš…",
+ "bus": "๐ŸšŒ",
+ "busstop": "๐Ÿš",
+ "bust_in_silhouette": "๐Ÿ‘ค",
+ "busts_in_silhouette": "๐Ÿ‘ฅ",
+ "cactus": "๐ŸŒต",
+ "cake": "๐Ÿฐ",
+ "calendar": "๐Ÿ“†",
+ "calling": "๐Ÿ“ฒ",
+ "camel": "๐Ÿซ",
+ "camera": "๐Ÿ“ท",
+ "cancer": "โ™‹๏ธ",
+ "candy": "๐Ÿฌ",
+ "capital_abcd": "๐Ÿ” ",
+ "capricorn": "โ™‘๏ธ",
+ "car": "๐Ÿš—",
+ "card_index": "๐Ÿ“‡",
+ "carousel_horse": "๐ŸŽ ",
+ "cat": "๐Ÿฑ",
+ "cat2": "๐Ÿˆ",
+ "cd": "๐Ÿ’ฟ",
+ "chart": "๐Ÿ’น",
+ "chart_with_downwards_trend": "๐Ÿ“‰",
+ "chart_with_upwards_trend": "๐Ÿ“ˆ",
+ "checkered_flag": "๐Ÿ",
+ "cherries": "๐Ÿ’",
+ "cherry_blossom": "๐ŸŒธ",
+ "chestnut": "๐ŸŒฐ",
+ "chicken": "๐Ÿ”",
+ "children_crossing": "๐Ÿšธ",
+ "chocolate_bar": "๐Ÿซ",
+ "christmas_tree": "๐ŸŽ„",
+ "church": "โ›ช๏ธ",
+ "cinema": "๐ŸŽฆ",
+ "circus_tent": "๐ŸŽช",
+ "city_sunrise": "๐ŸŒ‡",
+ "city_sunset": "๐ŸŒ†",
+ "cl": "๐Ÿ†‘",
+ "clap": "๐Ÿ‘",
+ "clapper": "๐ŸŽฌ",
+ "clipboard": "๐Ÿ“‹",
+ "clock1": "๐Ÿ•",
+ "clock10": "๐Ÿ•™",
+ "clock1030": "๐Ÿ•ฅ",
+ "clock11": "๐Ÿ•š",
+ "clock1130": "๐Ÿ•ฆ",
+ "clock12": "๐Ÿ•›",
+ "clock1230": "๐Ÿ•ง",
+ "clock130": "๐Ÿ•œ",
+ "clock2": "๐Ÿ•‘",
+ "clock230": "๐Ÿ•",
+ "clock3": "๐Ÿ•’",
+ "clock330": "๐Ÿ•ž",
+ "clock4": "๐Ÿ•“",
+ "clock430": "๐Ÿ•Ÿ",
+ "clock5": "๐Ÿ•”",
+ "clock530": "๐Ÿ• ",
+ "clock6": "๐Ÿ••",
+ "clock630": "๐Ÿ•ก",
+ "clock7": "๐Ÿ•–",
+ "clock730": "๐Ÿ•ข",
+ "clock8": "๐Ÿ•—",
+ "clock830": "๐Ÿ•ฃ",
+ "clock9": "๐Ÿ•˜",
+ "clock930": "๐Ÿ•ค",
+ "closed_book": "๐Ÿ“•",
+ "closed_lock_with_key": "๐Ÿ”",
+ "closed_umbrella": "๐ŸŒ‚",
+ "cloud": "โ˜๏ธ",
+ "clubs": "โ™ฃ๏ธ",
+ "cn": "๐Ÿ‡จ๐Ÿ‡ณ",
+ "cocktail": "๐Ÿธ",
+ "coffee": "โ˜•๏ธ",
+ "cold_sweat": "๐Ÿ˜ฐ",
+ "collision": "๐Ÿ’ฅ",
+ "computer": "๐Ÿ’ป",
+ "confetti_ball": "๐ŸŽŠ",
+ "confounded": "๐Ÿ˜–",
+ "confused": "๐Ÿ˜•",
+ "congratulations": "ใŠ—๏ธ",
+ "construction": "๐Ÿšง",
+ "construction_worker": "๐Ÿ‘ท",
+ "convenience_store": "๐Ÿช",
+ "cookie": "๐Ÿช",
+ "cool": "๐Ÿ†’",
+ "cop": "๐Ÿ‘ฎ",
+ "copyright": "ยฉ",
+ "corn": "๐ŸŒฝ",
+ "couple": "๐Ÿ‘ซ",
+ "couple_with_heart": "๐Ÿ’‘",
+ "couplekiss": "๐Ÿ’",
+ "cow": "๐Ÿฎ",
+ "cow2": "๐Ÿ„",
+ "credit_card": "๐Ÿ’ณ",
+ "crocodile": "๐ŸŠ",
+ "crossed_flags": "๐ŸŽŒ",
+ "crown": "๐Ÿ‘‘",
+ "cry": "๐Ÿ˜ข",
+ "crying_cat_face": "๐Ÿ˜ฟ",
+ "crystal_ball": "๐Ÿ”ฎ",
+ "cupid": "๐Ÿ’˜",
+ "curly_loop": "โžฐ",
+ "currency_exchange": "๐Ÿ’ฑ",
+ "curry": "๐Ÿ›",
+ "custard": "๐Ÿฎ",
+ "customs": "๐Ÿ›ƒ",
+ "cyclone": "๐ŸŒ€",
+ "dancer": "๐Ÿ’ƒ",
+ "dancers": "๐Ÿ‘ฏ",
+ "dango": "๐Ÿก",
+ "dart": "๐ŸŽฏ",
+ "dash": "๐Ÿ’จ",
+ "date": "๐Ÿ“…",
+ "de": "๐Ÿ‡ฉ๐Ÿ‡ช",
+ "deciduous_tree": "๐ŸŒณ",
+ "department_store": "๐Ÿฌ",
+ "diamond_shape_with_a_dot_inside": "๐Ÿ’ ",
+ "diamonds": "โ™ฆ๏ธ",
+ "disappointed": "๐Ÿ˜ž",
+ "disappointed_relieved": "๐Ÿ˜ฅ",
+ "dizzy": "๐Ÿ’ซ",
+ "dizzy_face": "๐Ÿ˜ต",
+ "do_not_litter": "๐Ÿšฏ",
+ "dog": "๐Ÿถ",
+ "dog2": "๐Ÿ•",
+ "dollar": "๐Ÿ’ต",
+ "dolls": "๐ŸŽŽ",
+ "dolphin": "๐Ÿฌ",
+ "donut": "๐Ÿฉ",
+ "door": "๐Ÿšช",
+ "doughnut": "๐Ÿฉ",
+ "dragon": "๐Ÿ‰",
+ "dragon_face": "๐Ÿฒ",
+ "dress": "๐Ÿ‘—",
+ "dromedary_camel": "๐Ÿช",
+ "droplet": "๐Ÿ’ง",
+ "dvd": "๐Ÿ“€",
+ "e-mail": "๐Ÿ“ง",
+ "ear": "๐Ÿ‘‚",
+ "ear_of_rice": "๐ŸŒพ",
+ "earth_africa": "๐ŸŒ",
+ "earth_americas": "๐ŸŒŽ",
+ "earth_asia": "๐ŸŒ",
+ "egg": "๐Ÿณ",
+ "eggplant": "๐Ÿ†",
+ "eight": "8๏ธโƒฃ",
+ "eight_pointed_black_star": "โœด๏ธ",
+ "eight_spoked_asterisk": "โœณ๏ธ",
+ "electric_plug": "๐Ÿ”Œ",
+ "elephant": "๐Ÿ˜",
+ "email": "๐Ÿ“ฉ",
+ "end": "๐Ÿ”š",
+ "envelope": "โœ‰๏ธ",
+ "es": "๐Ÿ‡ช๐Ÿ‡ธ",
+ "euro": "๐Ÿ’ถ",
+ "european_castle": "๐Ÿฐ",
+ "european_post_office": "๐Ÿค",
+ "evergreen_tree": "๐ŸŒฒ",
+ "exclamation": "โ—๏ธ",
+ "expressionless": "๐Ÿ˜‘",
+ "eyeglasses": "๐Ÿ‘“",
+ "eyes": "๐Ÿ‘€",
+ "facepunch": "๐Ÿ‘Š",
+ "factory": "๐Ÿญ",
+ "fallen_leaf": "๐Ÿ‚",
+ "family": "๐Ÿ‘ช",
+ "fast_forward": "โฉ",
+ "fax": "๐Ÿ“ ",
+ "fearful": "๐Ÿ˜จ",
+ "feet": "๐Ÿ‘ฃ",
+ "ferris_wheel": "๐ŸŽก",
+ "file_folder": "๐Ÿ“",
+ "fire": "๐Ÿ”ฅ",
+ "fire_engine": "๐Ÿš’",
+ "fireworks": "๐ŸŽ†",
+ "first_quarter_moon": "๐ŸŒ“",
+ "first_quarter_moon_with_face": "๐ŸŒ›",
+ "fish": "๐ŸŸ",
+ "fish_cake": "๐Ÿฅ",
+ "fishing_pole_and_fish": "๐ŸŽฃ",
+ "fist": "โœŠ",
+ "five": "5๏ธโƒฃ",
+ "flags": "๐ŸŽ",
+ "flashlight": "๐Ÿ”ฆ",
+ "floppy_disk": "๐Ÿ’พ",
+ "flower_playing_cards": "๐ŸŽด",
+ "flushed": "๐Ÿ˜ณ",
+ "foggy": "๐ŸŒ",
+ "football": "๐Ÿˆ",
+ "fork_and_knife": "๐Ÿด",
+ "fountain": "โ›ฒ๏ธ",
+ "four": "4๏ธโƒฃ",
+ "four_leaf_clover": "๐Ÿ€",
+ "fr": "๐Ÿ‡ซ๐Ÿ‡ท",
+ "free": "๐Ÿ†“",
+ "fried_shrimp": "๐Ÿค",
+ "fries": "๐ŸŸ",
+ "frog": "๐Ÿธ",
+ "frowning": "๐Ÿ˜ฆ",
+ "fuelpump": "โ›ฝ๏ธ",
+ "full_moon": "๐ŸŒ•",
+ "full_moon_with_face": "๐ŸŒ",
+ "game_die": "๐ŸŽฒ",
+ "gb": "๐Ÿ‡ฌ๐Ÿ‡ง",
+ "gem": "๐Ÿ’Ž",
+ "gemini": "โ™Š๏ธ",
+ "ghost": "๐Ÿ‘ป",
+ "gift": "๐ŸŽ",
+ "gift_heart": "๐Ÿ’",
+ "girl": "๐Ÿ‘ง",
+ "globe_with_meridians": "๐ŸŒ",
+ "goat": "๐Ÿ",
+ "golf": "โ›ณ๏ธ",
+ "grapes": "๐Ÿ‡",
+ "green_apple": "๐Ÿ",
+ "green_book": "๐Ÿ“—",
+ "green_heart": "๐Ÿ’š",
+ "grey_exclamation": "โ•",
+ "grey_question": "โ”",
+ "grimacing": "๐Ÿ˜ฌ",
+ "grin": "๐Ÿ˜",
+ "grinning": "๐Ÿ˜€",
+ "guardsman": "๐Ÿ’‚",
+ "guitar": "๐ŸŽธ",
+ "gun": "๐Ÿ”ซ",
+ "haircut": "๐Ÿ’‡",
+ "hamburger": "๐Ÿ”",
+ "hammer": "๐Ÿ”จ",
+ "hamster": "๐Ÿน",
+ "hand": "โœ‹",
+ "handbag": "๐Ÿ‘œ",
+ "hankey": "๐Ÿ’ฉ",
+ "hash": "#๏ธโƒฃ",
+ "hatched_chick": "๐Ÿฅ",
+ "hatching_chick": "๐Ÿฃ",
+ "headphones": "๐ŸŽง",
+ "hear_no_evil": "๐Ÿ™‰",
+ "heart": "โค๏ธ",
+ "heart_decoration": "๐Ÿ’Ÿ",
+ "heart_eyes": "๐Ÿ˜",
+ "heart_eyes_cat": "๐Ÿ˜ป",
+ "heartbeat": "๐Ÿ’“",
+ "heartpulse": "๐Ÿ’—",
+ "hearts": "โ™ฅ๏ธ",
+ "heavy_check_mark": "โœ”๏ธ",
+ "heavy_division_sign": "โž—",
+ "heavy_dollar_sign": "๐Ÿ’ฒ",
+ "heavy_exclamation_mark": "โ—๏ธ",
+ "heavy_minus_sign": "โž–",
+ "heavy_multiplication_x": "โœ–๏ธ",
+ "heavy_plus_sign": "โž•",
+ "helicopter": "๐Ÿš",
+ "herb": "๐ŸŒฟ",
+ "hibiscus": "๐ŸŒบ",
+ "high_brightness": "๐Ÿ”†",
+ "high_heel": "๐Ÿ‘ ",
+ "hocho": "๐Ÿ”ช",
+ "honey_pot": "๐Ÿฏ",
+ "honeybee": "๐Ÿ",
+ "horse": "๐Ÿด",
+ "horse_racing": "๐Ÿ‡",
+ "hospital": "๐Ÿฅ",
+ "hotel": "๐Ÿจ",
+ "hotsprings": "โ™จ๏ธ",
+ "hourglass": "โŒ›๏ธ",
+ "hourglass_flowing_sand": "โณ",
+ "house": "๐Ÿ ",
+ "house_with_garden": "๐Ÿก",
+ "hushed": "๐Ÿ˜ง",
+ "ice_cream": "๐Ÿจ",
+ "icecream": "๐Ÿฆ",
+ "id": "๐Ÿ†”",
+ "ideograph_advantage": "๐Ÿ‰",
+ "imp": "๐Ÿ‘ฟ",
+ "inbox_tray": "๐Ÿ“ฅ",
+ "incoming_envelope": "๐Ÿ“จ",
+ "information_desk_person": "๐Ÿ’",
+ "information_source": "โ„น๏ธ",
+ "innocent": "๐Ÿ˜‡",
+ "interrobang": "โ‰๏ธ",
+ "iphone": "๐Ÿ“ฑ",
+ "it": "๐Ÿ‡ฎ๐Ÿ‡น",
+ "izakaya_lantern": "๐Ÿฎ",
+ "jack_o_lantern": "๐ŸŽƒ",
+ "japan": "๐Ÿ—พ",
+ "japanese_castle": "๐Ÿฏ",
+ "japanese_goblin": "๐Ÿ‘บ",
+ "japanese_ogre": "๐Ÿ‘น",
+ "jeans": "๐Ÿ‘–",
+ "joy": "๐Ÿ˜‚",
+ "joy_cat": "๐Ÿ˜น",
+ "jp": "๐Ÿ‡ฏ๐Ÿ‡ต",
+ "key": "๐Ÿ”‘",
+ "keycap_ten": "๐Ÿ”Ÿ",
+ "kimono": "๐Ÿ‘˜",
+ "kiss": "๐Ÿ’‹",
+ "kissing": "๐Ÿ˜—",
+ "kissing_cat": "๐Ÿ˜ฝ",
+ "kissing_closed_eyes": "๐Ÿ˜š",
+ "kissing_face": "๐Ÿ˜š",
+ "kissing_heart": "๐Ÿ˜˜",
+ "kissing_smiling_eyes": "๐Ÿ˜™",
+ "koala": "๐Ÿจ",
+ "koko": "๐Ÿˆ",
+ "kr": "๐Ÿ‡ฐ๐Ÿ‡ท",
+ "large_blue_circle": "๐Ÿ”ต",
+ "large_blue_diamond": "๐Ÿ”ท",
+ "large_orange_diamond": "๐Ÿ”ถ",
+ "last_quarter_moon": "๐ŸŒ—",
+ "last_quarter_moon_with_face": "๐ŸŒœ",
+ "laughing": "๐Ÿ˜†",
+ "leaves": "๐Ÿƒ",
+ "ledger": "๐Ÿ“’",
+ "left_luggage": "๐Ÿ›…",
+ "left_right_arrow": "โ†”๏ธ",
+ "leftwards_arrow_with_hook": "โ†ฉ๏ธ",
+ "lemon": "๐Ÿ‹",
+ "leo": "โ™Œ๏ธ",
+ "leopard": "๐Ÿ†",
+ "libra": "โ™Ž๏ธ",
+ "light_rail": "๐Ÿšˆ",
+ "link": "๐Ÿ”—",
+ "lips": "๐Ÿ‘„",
+ "lipstick": "๐Ÿ’„",
+ "lock": "๐Ÿ”’",
+ "lock_with_ink_pen": "๐Ÿ”",
+ "lollipop": "๐Ÿญ",
+ "loop": "โžฟ",
+ "loudspeaker": "๐Ÿ“ข",
+ "love_hotel": "๐Ÿฉ",
+ "love_letter": "๐Ÿ’Œ",
+ "low_brightness": "๐Ÿ”…",
+ "m": "โ“œ",
+ "mag": "๐Ÿ”",
+ "mag_right": "๐Ÿ”Ž",
+ "mahjong": "๐Ÿ€„๏ธ",
+ "mailbox": "๐Ÿ“ซ",
+ "mailbox_closed": "๐Ÿ“ช",
+ "mailbox_with_mail": "๐Ÿ“ฌ",
+ "mailbox_with_no_mail": "๐Ÿ“ญ",
+ "man": "๐Ÿ‘จ",
+ "man_with_gua_pi_mao": "๐Ÿ‘ฒ",
+ "man_with_turban": "๐Ÿ‘ณ",
+ "mans_shoe": "๐Ÿ‘ž",
+ "maple_leaf": "๐Ÿ",
+ "mask": "๐Ÿ˜ท",
+ "massage": "๐Ÿ’†",
+ "meat_on_bone": "๐Ÿ–",
+ "mega": "๐Ÿ“ฃ",
+ "melon": "๐Ÿˆ",
+ "memo": "๐Ÿ“",
+ "mens": "๐Ÿšน",
+ "metro": "๐Ÿš‡",
+ "microphone": "๐ŸŽค",
+ "microscope": "๐Ÿ”ฌ",
+ "milky_way": "๐ŸŒŒ",
+ "minibus": "๐Ÿš",
+ "minidisc": "๐Ÿ’ฝ",
+ "mobile_phone_off": "๐Ÿ“ด",
+ "money_with_wings": "๐Ÿ’ธ",
+ "moneybag": "๐Ÿ’ฐ",
+ "monkey": "๐Ÿ’",
+ "monkey_face": "๐Ÿต",
+ "monorail": "๐Ÿš",
+ "moon": "๐ŸŒ™",
+ "mortar_board": "๐ŸŽ“",
+ "mount_fuji": "๐Ÿ—ป",
+ "mountain_bicyclist": "๐Ÿšต",
+ "mountain_cableway": "๐Ÿš ",
+ "mountain_railway": "๐Ÿšž",
+ "mouse": "๐Ÿญ",
+ "mouse2": "๐Ÿ",
+ "movie_camera": "๐ŸŽฅ",
+ "moyai": "๐Ÿ—ฟ",
+ "muscle": "๐Ÿ’ช",
+ "mushroom": "๐Ÿ„",
+ "musical_keyboard": "๐ŸŽน",
+ "musical_note": "๐ŸŽต",
+ "musical_score": "๐ŸŽผ",
+ "mute": "๐Ÿ”‡",
+ "nail_care": "๐Ÿ’…",
+ "name_badge": "๐Ÿ“›",
+ "necktie": "๐Ÿ‘”",
+ "negative_squared_cross_mark": "โŽ",
+ "neutral_face": "๐Ÿ˜",
+ "new": "๐Ÿ†•",
+ "new_moon": "๐ŸŒ‘",
+ "new_moon_with_face": "๐ŸŒš",
+ "newspaper": "๐Ÿ“ฐ",
+ "ng": "๐Ÿ†–",
+ "nine": "9๏ธโƒฃ",
+ "no_bell": "๐Ÿ”•",
+ "no_bicycles": "๐Ÿšณ",
+ "no_entry": "โ›”๏ธ",
+ "no_entry_sign": "๐Ÿšซ",
+ "no_good": "๐Ÿ™…",
+ "no_mobile_phones": "๐Ÿ“ต",
+ "no_mouth": "๐Ÿ˜ถ",
+ "no_pedestrians": "๐Ÿšท",
+ "no_smoking": "๐Ÿšญ",
+ "non-potable_water": "๐Ÿšฑ",
+ "nose": "๐Ÿ‘ƒ",
+ "notebook": "๐Ÿ““",
+ "notebook_with_decorative_cover": "๐Ÿ“”",
+ "notes": "๐ŸŽถ",
+ "nut_and_bolt": "๐Ÿ”ฉ",
+ "o": "โญ•๏ธ",
+ "o2": "๐Ÿ…พ",
+ "ocean": "๐ŸŒŠ",
+ "octopus": "๐Ÿ™",
+ "oden": "๐Ÿข",
+ "office": "๐Ÿข",
+ "ok": "๐Ÿ†—",
+ "ok_hand": "๐Ÿ‘Œ",
+ "ok_woman": "๐Ÿ™†",
+ "older_man": "๐Ÿ‘ด",
+ "older_woman": "๐Ÿ‘ต",
+ "on": "๐Ÿ”›",
+ "oncoming_automobile": "๐Ÿš˜",
+ "oncoming_bus": "๐Ÿš",
+ "oncoming_police_car": "๐Ÿš”",
+ "oncoming_taxi": "๐Ÿš–",
+ "one": "1๏ธโƒฃ",
+ "open_file_folder": "๐Ÿ“‚",
+ "open_hands": "๐Ÿ‘",
+ "open_mouth": "๐Ÿ˜ฎ",
+ "ophiuchus": "โ›Ž",
+ "orange_book": "๐Ÿ“™",
+ "outbox_tray": "๐Ÿ“ค",
+ "ox": "๐Ÿ‚",
+ "page_facing_up": "๐Ÿ“„",
+ "page_with_curl": "๐Ÿ“ƒ",
+ "pager": "๐Ÿ“Ÿ",
+ "palm_tree": "๐ŸŒด",
+ "panda_face": "๐Ÿผ",
+ "paperclip": "๐Ÿ“Ž",
+ "parking": "๐Ÿ…ฟ๏ธ",
+ "part_alternation_mark": "ใ€ฝ๏ธ",
+ "partly_sunny": "โ›…๏ธ",
+ "passport_control": "๐Ÿ›‚",
+ "paw_prints": "๐Ÿพ",
+ "peach": "๐Ÿ‘",
+ "pear": "๐Ÿ",
+ "pencil": "๐Ÿ“",
+ "pencil2": "โœ๏ธ",
+ "penguin": "๐Ÿง",
+ "pensive": "๐Ÿ˜”",
+ "performing_arts": "๐ŸŽญ",
+ "persevere": "๐Ÿ˜ฃ",
+ "person_frowning": "๐Ÿ™",
+ "person_with_blond_hair": "๐Ÿ‘ฑ",
+ "person_with_pouting_face": "๐Ÿ™Ž",
+ "phone": "โ˜Ž๏ธ",
+ "pig": "๐Ÿท",
+ "pig2": "๐Ÿ–",
+ "pig_nose": "๐Ÿฝ",
+ "pill": "๐Ÿ’Š",
+ "pineapple": "๐Ÿ",
+ "pisces": "โ™“๏ธ",
+ "pizza": "๐Ÿ•",
+ "plus1": "๐Ÿ‘",
+ "point_down": "๐Ÿ‘‡",
+ "point_left": "๐Ÿ‘ˆ",
+ "point_right": "๐Ÿ‘‰",
+ "point_up": "โ˜๏ธ",
+ "point_up_2": "๐Ÿ‘†",
+ "police_car": "๐Ÿš“",
+ "poodle": "๐Ÿฉ",
+ "poop": "๐Ÿ’ฉ",
+ "post_office": "๐Ÿฃ",
+ "postal_horn": "๐Ÿ“ฏ",
+ "postbox": "๐Ÿ“ฎ",
+ "potable_water": "๐Ÿšฐ",
+ "pouch": "๐Ÿ‘",
+ "poultry_leg": "๐Ÿ—",
+ "pound": "๐Ÿ’ท",
+ "pouting_cat": "๐Ÿ˜พ",
+ "pray": "๐Ÿ™",
+ "princess": "๐Ÿ‘ธ",
+ "punch": "๐Ÿ‘Š",
+ "purple_heart": "๐Ÿ’œ",
+ "purse": "๐Ÿ‘›",
+ "pushpin": "๐Ÿ“Œ",
+ "put_litter_in_its_place": "๐Ÿšฎ",
+ "question": "โ“",
+ "rabbit": "๐Ÿฐ",
+ "rabbit2": "๐Ÿ‡",
+ "racehorse": "๐ŸŽ",
+ "radio": "๐Ÿ“ป",
+ "radio_button": "๐Ÿ”˜",
+ "rage": "๐Ÿ˜ก",
+ "railway_car": "๐Ÿš‹",
+ "rainbow": "๐ŸŒˆ",
+ "raised_hand": "โœ‹",
+ "raised_hands": "๐Ÿ™Œ",
+ "raising_hand": "๐Ÿ™‹",
+ "ram": "๐Ÿ",
+ "ramen": "๐Ÿœ",
+ "rat": "๐Ÿ€",
+ "recycle": "โ™ป๏ธ",
+ "red_car": "๐Ÿš—",
+ "red_circle": "๐Ÿ”ด",
+ "registered": "ยฎ",
+ "relaxed": "โ˜บ๏ธ",
+ "relieved": "๐Ÿ˜Œ",
+ "repeat": "๐Ÿ”",
+ "repeat_one": "๐Ÿ”‚",
+ "restroom": "๐Ÿšป",
+ "revolving_hearts": "๐Ÿ’ž",
+ "rewind": "โช",
+ "ribbon": "๐ŸŽ€",
+ "rice": "๐Ÿš",
+ "rice_ball": "๐Ÿ™",
+ "rice_cracker": "๐Ÿ˜",
+ "rice_scene": "๐ŸŽ‘",
+ "ring": "๐Ÿ’",
+ "rocket": "๐Ÿš€",
+ "roller_coaster": "๐ŸŽข",
+ "rooster": "๐Ÿ“",
+ "rose": "๐ŸŒน",
+ "rotating_light": "๐Ÿšจ",
+ "round_pushpin": "๐Ÿ“",
+ "rowboat": "๐Ÿšฃ",
+ "ru": "๐Ÿ‡ท๐Ÿ‡บ",
+ "rugby_football": "๐Ÿ‰",
+ "runner": "๐Ÿƒ",
+ "running": "๐Ÿƒ",
+ "running_shirt_with_sash": "๐ŸŽฝ",
+ "sa": "๐Ÿˆ‚",
+ "sagittarius": "โ™๏ธ",
+ "sailboat": "โ›ต๏ธ",
+ "sake": "๐Ÿถ",
+ "sandal": "๐Ÿ‘ก",
+ "santa": "๐ŸŽ…",
+ "satellite": "๐Ÿ“ก",
+ "satisfied": "๐Ÿ˜†",
+ "saxophone": "๐ŸŽท",
+ "school": "๐Ÿซ",
+ "school_satchel": "๐ŸŽ’",
+ "scissors": "โœ‚๏ธ",
+ "scorpius": "โ™๏ธ",
+ "scream": "๐Ÿ˜ฑ",
+ "scream_cat": "๐Ÿ™€",
+ "scroll": "๐Ÿ“œ",
+ "seat": "๐Ÿ’บ",
+ "secret": "ใŠ™๏ธ",
+ "see_no_evil": "๐Ÿ™ˆ",
+ "seedling": "๐ŸŒฑ",
+ "seven": "7๏ธโƒฃ",
+ "shaved_ice": "๐Ÿง",
+ "sheep": "๐Ÿ‘",
+ "shell": "๐Ÿš",
+ "ship": "๐Ÿšข",
+ "shirt": "๐Ÿ‘•",
+ "shit": "๐Ÿ’ฉ",
+ "shoe": "๐Ÿ‘Ÿ",
+ "shower": "๐Ÿšฟ",
+ "signal_strength": "๐Ÿ“ถ",
+ "six": "6๏ธโƒฃ",
+ "six_pointed_star": "๐Ÿ”ฏ",
+ "ski": "๐ŸŽฟ",
+ "skull": "๐Ÿ’€",
+ "sleeping": "๐Ÿ˜ด",
+ "sleepy": "๐Ÿ˜ช",
+ "slot_machine": "๐ŸŽฐ",
+ "small_blue_diamond": "๐Ÿ”น",
+ "small_orange_diamond": "๐Ÿ”ธ",
+ "small_red_triangle": "๐Ÿ”บ",
+ "small_red_triangle_down": "๐Ÿ”ป",
+ "smile": "๐Ÿ˜„",
+ "smile_cat": "๐Ÿ˜ธ",
+ "smiley": "๐Ÿ˜ƒ",
+ "smiley_cat": "๐Ÿ˜บ",
+ "smiling_imp": "๐Ÿ˜ˆ",
+ "smirk": "๐Ÿ˜",
+ "smirk_cat": "๐Ÿ˜ผ",
+ "smoking": "๐Ÿšฌ",
+ "snail": "๐ŸŒ",
+ "snake": "๐Ÿ",
+ "snowboarder": "๐Ÿ‚",
+ "snowflake": "โ„๏ธ",
+ "snowman": "โ›„๏ธ",
+ "sob": "๐Ÿ˜ญ",
+ "soccer": "โšฝ๏ธ",
+ "soon": "๐Ÿ”œ",
+ "sos": "๐Ÿ†˜",
+ "sound": "๐Ÿ”‰",
+ "space_invader": "๐Ÿ‘พ",
+ "spades": "โ™ ๏ธ",
+ "spaghetti": "๐Ÿ",
+ "sparkler": "๐ŸŽ‡",
+ "sparkles": "โœจ",
+ "sparkling_heart": "๐Ÿ’–",
+ "speak_no_evil": "๐Ÿ™Š",
+ "speaker": "๐Ÿ”ˆ",
+ "speech_balloon": "๐Ÿ’ฌ",
+ "speedboat": "๐Ÿšค",
+ "star": "โญ๏ธ",
+ "star2": "๐ŸŒŸ",
+ "stars": "๐ŸŒ ",
+ "station": "๐Ÿš‰",
+ "statue_of_liberty": "๐Ÿ—ฝ",
+ "steam_locomotive": "๐Ÿš‚",
+ "stew": "๐Ÿฒ",
+ "straight_ruler": "๐Ÿ“",
+ "strawberry": "๐Ÿ“",
+ "stuck_out_tongue": "๐Ÿ˜›",
+ "stuck_out_tongue_closed_eyes": "๐Ÿ˜",
+ "stuck_out_tongue_winking_eye": "๐Ÿ˜œ",
+ "sun_with_face": "๐ŸŒž",
+ "sunflower": "๐ŸŒป",
+ "sunglasses": "๐Ÿ˜Ž",
+ "sunny": "โ˜€๏ธ",
+ "sunrise": "๐ŸŒ…",
+ "sunrise_over_mountains": "๐ŸŒ„",
+ "surfer": "๐Ÿ„",
+ "sushi": "๐Ÿฃ",
+ "suspension_railway": "๐ŸšŸ",
+ "sweat": "๐Ÿ˜“",
+ "sweat_drops": "๐Ÿ’ฆ",
+ "sweat_smile": "๐Ÿ˜…",
+ "sweet_potato": "๐Ÿ ",
+ "swimmer": "๐ŸŠ",
+ "symbols": "๐Ÿ”ฃ",
+ "syringe": "๐Ÿ’‰",
+ "tada": "๐ŸŽ‰",
+ "tanabata_tree": "๐ŸŽ‹",
+ "tangerine": "๐ŸŠ",
+ "taurus": "โ™‰๏ธ",
+ "taxi": "๐Ÿš•",
+ "tea": "๐Ÿต",
+ "telephone": "โ˜Ž๏ธ",
+ "telephone_receiver": "๐Ÿ“ž",
+ "telescope": "๐Ÿ”ญ",
+ "tennis": "๐ŸŽพ",
+ "tent": "โ›บ๏ธ",
+ "thought_balloon": "๐Ÿ’ญ",
+ "three": "3๏ธโƒฃ",
+ "thumbsdown": "๐Ÿ‘Ž",
+ "thumbsup": "๐Ÿ‘",
+ "ticket": "๐ŸŽซ",
+ "tiger": "๐Ÿฏ",
+ "tiger2": "๐Ÿ…",
+ "tired_face": "๐Ÿ˜ซ",
+ "tm": "โ„ข",
+ "toilet": "๐Ÿšฝ",
+ "tokyo_tower": "๐Ÿ—ผ",
+ "tomato": "๐Ÿ…",
+ "tongue": "๐Ÿ‘…",
+ "top": "๐Ÿ”",
+ "tophat": "๐ŸŽฉ",
+ "tractor": "๐Ÿšœ",
+ "traffic_light": "๐Ÿšฅ",
+ "train": "๐Ÿš‹",
+ "train2": "๐Ÿš†",
+ "tram": "๐ŸšŠ",
+ "triangular_flag_on_post": "๐Ÿšฉ",
+ "triangular_ruler": "๐Ÿ“",
+ "trident": "๐Ÿ”ฑ",
+ "triumph": "๐Ÿ˜ค",
+ "trolleybus": "๐ŸšŽ",
+ "trophy": "๐Ÿ†",
+ "tropical_drink": "๐Ÿน",
+ "tropical_fish": "๐Ÿ ",
+ "truck": "๐Ÿšš",
+ "trumpet": "๐ŸŽบ",
+ "tshirt": "๐Ÿ‘•",
+ "tulip": "๐ŸŒท",
+ "turtle": "๐Ÿข",
+ "tv": "๐Ÿ“บ",
+ "twisted_rightwards_arrows": "๐Ÿ”€",
+ "two": "2๏ธโƒฃ",
+ "two_hearts": "๐Ÿ’•",
+ "two_men_holding_hands": "๐Ÿ‘ฌ",
+ "two_women_holding_hands": "๐Ÿ‘ญ",
+ "u5272": "๐Ÿˆน",
+ "u5408": "๐Ÿˆด",
+ "u55b6": "๐Ÿˆบ",
+ "u6307": "๐Ÿˆฏ๏ธ",
+ "u6708": "๐Ÿˆท",
+ "u6709": "๐Ÿˆถ",
+ "u6e80": "๐Ÿˆต",
+ "u7121": "๐Ÿˆš๏ธ",
+ "u7533": "๐Ÿˆธ",
+ "u7981": "๐Ÿˆฒ",
+ "u7a7a": "๐Ÿˆณ",
+ "uk": "๐Ÿ‡ฌ๐Ÿ‡ง",
+ "umbrella": "โ˜”๏ธ",
+ "unamused": "๐Ÿ˜’",
+ "underage": "๐Ÿ”ž",
+ "unlock": "๐Ÿ”“",
+ "up": "๐Ÿ†™",
+ "us": "๐Ÿ‡บ๐Ÿ‡ธ",
+ "v": "โœŒ๏ธ",
+ "vertical_traffic_light": "๐Ÿšฆ",
+ "vhs": "๐Ÿ“ผ",
+ "vibration_mode": "๐Ÿ“ณ",
+ "video_camera": "๐Ÿ“น",
+ "video_game": "๐ŸŽฎ",
+ "violin": "๐ŸŽป",
+ "virgo": "โ™๏ธ",
+ "volcano": "๐ŸŒ‹",
+ "vs": "๐Ÿ†š",
+ "walking": "๐Ÿšถ",
+ "waning_crescent_moon": "๐ŸŒ˜",
+ "waning_gibbous_moon": "๐ŸŒ–",
+ "warning": "โš ๏ธ",
+ "watch": "โŒš๏ธ",
+ "water_buffalo": "๐Ÿƒ",
+ "watermelon": "๐Ÿ‰",
+ "wave": "๐Ÿ‘‹",
+ "wavy_dash": "ใ€ฐ",
+ "waxing_crescent_moon": "๐ŸŒ’",
+ "waxing_gibbous_moon": "๐ŸŒ”",
+ "wc": "๐Ÿšพ",
+ "weary": "๐Ÿ˜ฉ",
+ "wedding": "๐Ÿ’’",
+ "whale": "๐Ÿณ",
+ "whale2": "๐Ÿ‹",
+ "wheelchair": "โ™ฟ๏ธ",
+ "white_check_mark": "โœ…",
+ "white_circle": "โšช",
+ "white_flower": "๐Ÿ’ฎ",
+ "white_large_square": "โ—ป๏ธ",
+ "white_square_button": "๐Ÿ”ณ",
+ "wind_chime": "๐ŸŽ",
+ "wine_glass": "๐Ÿท",
+ "wink": "๐Ÿ˜‰",
+ "wolf": "๐Ÿบ",
+ "woman": "๐Ÿ‘ฉ",
+ "womans_clothes": "๐Ÿ‘š",
+ "womans_hat": "๐Ÿ‘’",
+ "womens": "๐Ÿšบ",
+ "worried": "๐Ÿ˜Ÿ",
+ "wrench": "๐Ÿ”ง",
+ "x": "โŒ",
+ "yellow_heart": "๐Ÿ’›",
+ "yen": "๐Ÿ’ด",
+ "yum": "๐Ÿ˜‹",
+ "zap": "โšก๏ธ",
+ "zero": "0๏ธโƒฃ",
+ "zzz": "๐Ÿ’ค"
+}; \ No newline at end of file
diff --git a/lib/initialize.js b/lib/initialize.js
index ae94f85..6adb6cd 100644
--- a/lib/initialize.js
+++ b/lib/initialize.js
@@ -9,31 +9,62 @@
var mdbvideos = require('./login'),
videoHandler = require('./videos'),
prompts = require('./prompts'),
+ pkg = require('../package'),
+ emoji = require('./emoji'),
colors = require('colors'),
inquirer = require('inquirer');
+function checkName(profile) {
+
+ 'use strict';
+
+ var greetings = 'Hi ';
+ return ((profile.firstName !== '') ? greetings + profile.firstName : greetings + profile.userName) + ' ' + emoji.smile;
+}
+
module.exports = function run(profile, argv) {
'use strict';
- var lookFor = ((!argv.h)? 'Videos' : 'Handouts');
+ var lookFor = ((!argv.h)? 'Videos' : 'Handouts'), videoPreference = 'youtube';
inquirer.prompt(profile, function prompt(answers) {
- var list = prompts.list, classes = list, check = prompts.check;
+ var list = prompts.list, classes = list, check = prompts.check, confirm = prompts.confirm;
+
+ mdbvideos.init(answers, argv, function get(err, data, profile) {
- mdbvideos.init(answers, argv, function get(err, data) {
if (err !== null) { throw err; }
+ if (profile.preset.video[1] === videoPreference || argv.h) { return processList(data, profile); }
+
+ confirm[0].message = 'Your current video preference is set to ' + profile.preset.video[1].underline + '. Switch to: ' + videoPreference.green;
+
+ return inquirer.prompt(confirm, function prompt(answers) {
+ if (!answers.confirm) { return console.log('i'.red + ' ' + pkg.name + ' requires video preferences set to ' + videoPreference + '.\n'); }
+
+ mdbvideos.updateProfile({
+ provider: videoPreference,
+ language: profile.preset.language[1]
+ }, function status(err, resp) {
+ if (err !== null) { throw err; }
+ if (resp.success) { processList(data, profile); }
+ });
+
+ });
+
+ });
+
+ function processList(data, profile) {
+
if (data.length) {
- classes[0].message = 'Found ' + data.length + ' Course'+ ((data.length > 1)? 's' : '') + '. Select:';
+ classes[0].message = checkName(profile) + ' . Found ' + data.length + ' Course'+ ((data.length > 1)? 's' : '') + '. Select:';
classes[0].choices = data;
return currentList();
}
-
- });
+ }
function currentList() {
inquirer.prompt(classes, function prompt(answers) {
@@ -56,8 +87,8 @@ module.exports = function run(profile, argv) {
}
return console.log('i'.red + ' Unable to locate any ' + lookFor.toLowerCase() + ' lists in the wiki. Are ' +
- lookFor.toLowerCase() + ' list present in the wiki?' +
- ((lookFor === 'Videos') ? '\n\nTry to add ' + '--cw'.green + ' to switch and search on courseware instead; make sure your mongodb user profile video preferences are set to youtube.\n' : ''));
+ lookFor.toLowerCase() + ' list present?' +
+ ((lookFor === 'Videos') ? '\n\n' + ((!argv.cw) ? 'Try to add ' + '--cw'.green + ' to switch and search on courseware instead.\n' : '') : ''));
});
});
diff --git a/lib/login.js b/lib/login.js
index 88b97f0..4715bc3 100644
--- a/lib/login.js
+++ b/lib/login.js
@@ -13,7 +13,7 @@ var request = require('request'),
videoHandler = require('./videos'),
coursewareHandler = require('./courseware');
-var jar = request.jar(), host = 'https://university.mongodb.com';
+var jar = request.jar(), host = 'https://university.mongodb.com', xcsrftoken = {};
function addCookies(cookies, url) {
@@ -29,16 +29,18 @@ module.exports = {
'use strict';
var url = host,
- bar = new ProgressBar('>'.magenta + ' Searching [:bar] :percent', { complete: '=', incomplete: ' ', width: 20, total: 5 }),
+ bar = new ProgressBar('>'.magenta + ' Searching [:bar] :percent', { complete: '=', incomplete: ' ', width: 20, total: 7 }),
CSRFTokenCookie = '',
login = function login(token) {
+ xcsrftoken = { 'X-CSRFToken': token[0].split('=')[1] };
+
request({
uri: url + '/login',
method: 'POST',
jar: jar,
- headers: { 'X-CSRFToken': token[0].split('=')[1] },
+ headers: xcsrftoken,
form: { 'email': opt.user, 'password': opt.password }
}, function post(err, res, body) {
@@ -50,7 +52,7 @@ module.exports = {
bar.tick();
- return checkCourses(bar);
+ return checkProfile(bar);
}
@@ -59,7 +61,34 @@ module.exports = {
});
},
- checkCourses = function checkCourses(bar) {
+ checkProfile = function checkProfile(bar) {
+ request({ url: url + '/edit_profile', jar: jar }, function get(err, res, body) {
+ if (err !== null) { return callback(err, null); }
+ bar.tick();
+ if (res.statusCode === 200) {
+
+ bar.tick();
+
+ var $ = cheerio.load(body),
+ provider = $('select[name="provider"] option:selected'),
+ language = $('select[name="language"] option:selected'),
+ currentProfile = {
+ preset: {
+ video: [provider.text(), provider.val()],
+ language: [language.text(), language.val()]
+ },
+ firstName: $('input[name="first_name"]').attr('value'),
+ lastName: $('input[name="last_name"]').attr('value'),
+ username: $('input[name="username"]').attr('value')
+ };
+
+ return checkCourses(bar, currentProfile);
+ }
+ });
+
+ },
+
+ checkCourses = function checkCourses(bar, currentProfile) {
bar.tick();
@@ -82,7 +111,7 @@ module.exports = {
bar.tick();
- callback(null, list);
+ callback(null, list, currentProfile);
}
});
@@ -211,5 +240,23 @@ module.exports = {
}
callback(new Error('Server Response: '.red + response.statusCode));
});
+ },
+
+ updateProfile: function updateProfile(options, callback) {
+
+ 'use strict';
+
+ request.post({
+ uri: host + '/save_video_preferences',
+ method: 'POST',
+ jar: jar,
+ headers: xcsrftoken,
+ form: { csrfmiddlewaretoken: xcsrftoken, provider: options.provider, language: options.language }
+ }, function post(err, res, body) {
+
+ if (err !== null) { return callback(err, null); }
+ if (res.statusCode === 200) { callback(null, JSON.parse(body)); }
+
+ });
}
};
diff --git a/lib/prompts.js b/lib/prompts.js
index 7e90cc5..e29716d 100644
--- a/lib/prompts.js
+++ b/lib/prompts.js
@@ -22,6 +22,8 @@ module.exports = (function build() {
list: [{ type: 'list', name: 'url', message: '', choices: [] }],
+ confirm: [{ type: 'confirm', name: 'confirm', message: '' }],
+
check: [{ type: 'checkbox', message: '', name: 'videos', choices: [],
validate: function validate(answer) {
if ( answer.length < 1 ) { return 'You must choose at least one option.'; }
diff --git a/package.json b/package.json
index 381cae7..6266e9c 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "mongo-edu",
"preferGlobal": true,
- "version": "0.2.15",
+ "version": "0.2.16",
"author": "Przemyslaw Pluta <przemyslawplutadev@gmail.com> (http://przemyslawpluta.com)",
"description": "Select and download videos and handouts from university.mongodb.com courses",
"main": "./mongo-edu",
@@ -33,10 +33,10 @@
"cheerio": "~0.19.0",
"colors": "~1.1.2",
"easy-table": "~1.0.0",
- "filesize": "~3.1.2",
+ "filesize": "~3.1.3",
"glob": "~5.0.14",
"inquirer": "~0.9.0",
- "lodash": "~3.10.0",
+ "lodash": "~3.10.1",
"mkdirp": "~0.5.1",
"mv": "~2.1.1",
"path-extra": "~1.0.3",
@@ -46,7 +46,7 @@
"rimraf": "~2.4.2",
"unzip": "~0.1.11",
"which": "~1.1.1",
- "yargs": "~3.15.0",
+ "yargs": "~3.17.1",
"youtube-dl": "~1.10.5"
},
"engines": {