# Interactive Terminal Search Scripts Two PowerShell scripts for searching travel deals via interactive prompts. ## ๐Ÿš€ Quick Start ### 1. Start the Server ```powershell npm run dev ``` ### 2. Run a Search Script **Option A: Full Interactive Search** (with detailed feature preferences) ```powershell .\search-interactive.ps1 ``` **Option B: Quick Search** (simplified prompts) ```powershell .\search-quick.ps1 ``` --- ## ๐Ÿ“‹ What You'll Be Asked ### Basic Travel Info 1. **Where are you leaving from?** - Enter IATA airport code (e.g., `YOW`, `YYZ`, `YUL`, `YVR`) 2. **Where do you want to go?** - Enter destinations separated by commas (e.g., `CUN,PUJ,MBJ`) 3. **When do you want to travel?** - Earliest departure date: `2025-12-15` - Latest return date: `2026-01-15` 4. **How long do you want to stay?** - Minimum nights: `5` - Maximum nights: `9` 5. **What's your budget?** - Enter amount in CAD or leave blank for no limit 6. **Flight preferences** - Non-stop flights only? (y/n) ### Destination Features (Rate 0-10) The script will ask you to rate the importance of: - ๐Ÿ–๏ธ **Beach** - Direct beach access - ๐ŸŠ **Pool** - Swimming pool facilities - โ›ณ **Golf** - Golf courses nearby - ๐Ÿ’† **Spa** - Spa and wellness facilities - ๐Ÿฝ๏ธ **Food** - Dining options and local cuisine - ๐ŸŽ‰ **Nightlife** - Bars, clubs, entertainment - ๐Ÿ›๏ธ **Shopping** - Shopping centers and markets - ๐Ÿ›๏ธ **Culture** - Museums, historical sites - ๐Ÿšต **Outdoor** - Hiking, water sports, activities - ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ **Family** - Family-friendly amenities **Rating Guide:** - `0` = Not important at all - `5` = Nice to have - `10` = Must have ### Search Sources Choose which sources to include: - Deal sites (YOWDeals, YYZDeals, etc.) - Skyscanner - Google Flights - Air Canada --- ## ๐ŸŽฏ Example Session ``` ======================================== Holiday Travel Deal Finder ======================================== Where are you leaving from? (Enter IATA airport code, e.g., YOW, YYZ, YUL, YVR) Origin: YOW Where do you want to go? (Enter one or more IATA codes, separated by commas) Examples: CUN,PUJ,MBJ (Caribbean) or LHR,CDG,FCO (Europe) Destinations: CUN,PUJ,MBJ When do you want to travel? Earliest departure date (YYYY-MM-DD): Start date: 2025-12-15 Latest return date (YYYY-MM-DD): End date: 2026-01-15 How long do you want to stay? Minimum nights: 7 Maximum nights: 9 What's your budget? (Leave blank for no budget limit) Budget (CAD): 1000 Flight preferences: Non-stop flights only? (y/n): n ======================================== Destination Features ======================================== Rate the importance of these features (0-10): 0 = Not important, 10 = Must have Beach access: Rating (0-10): 10 Swimming pool: Rating (0-10): 8 Golf course nearby: Rating (0-10): 2 Spa & wellness: Rating (0-10): 7 Food & dining options: Rating (0-10): 9 Nightlife & entertainment: Rating (0-10): 6 Shopping: Rating (0-10): 3 Cultural attractions: Rating (0-10): 4 Outdoor activities (hiking, water sports): Rating (0-10): 8 Family-friendly: Rating (0-10): 7 ======================================== Search Sources ======================================== Which sources do you want to search? Deal sites (YOWDeals, etc)? (y/n): y Skyscanner? (y/n): y Google Flights? (y/n): y Air Canada? (y/n): y ======================================== Search Summary ======================================== From: YOW To: CUN, PUJ, MBJ Dates: 2025-12-15 to 2026-01-15 Stay: 7-9 nights Budget: $1000 CAD Non-stop only: False Sources: Deals, Skyscanner, GoogleFlights, AirCanada Top priorities: beach: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 10/10 food: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 9/10 pool: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 8/10 ======================================== Search now? (y/n): y Searching for deals... (This may take 10-30 seconds) โœ“ Found 47 results! ======================================== Top Deals ======================================== [1] Ottawa โ†’ Cancun (7 nights) Price: $685 CAD Duration: 7 nights Dates: 2025-12-20 โ†’ 2025-12-27 Source: Skyscanner Link Link: https://www.skyscanner.ca/... Score: 10542 [2] YOW โ†’ PUJ (8 nights) Price: $712 CAD Duration: 8 nights Dates: 2025-12-22 โ†’ 2025-12-30 Source: yowdeals.com Link: https://www.yowdeals.com/... Score: 10235 ... Export all results to CSV? (y/n): y โœ“ Exported to travel_deals_2025-10-29_143052.csv Open top deal in browser? (y/n): y โœ“ Opening in browser... Happy travels! โœˆ๏ธ๐Ÿ–๏ธ ``` --- ## ๐ŸŽจ How Feature Weighting Works The app matches your preferences with destination profiles: ### Example: Cancun (CUN) - Beach: 10/10 โญโญโญโญโญ - Pool: 9/10 โญโญโญโญโญ - Golf: 6/10 โญโญโญ - Spa: 8/10 โญโญโญโญ - Food: 8/10 โญโญโญโญ - Nightlife: 9/10 โญโญโญโญโญ - Shopping: 7/10 โญโญโญโญ - Culture: 5/10 โญโญโญ - Outdoor: 8/10 โญโญโญโญ - Family: 9/10 โญโญโญโญโญ If you rate **Beach: 10** and **Food: 9**, destinations like Cancun will score higher because they excel in those areas. ### Supported Destinations **Caribbean**: CUN, PUJ, MBJ, NAS **Europe**: LHR, CDG, FCO, BCN, AMS **USA**: LAX, LAS, MIA, MCO, HNL *Other destinations use average ratings* --- ## ๐Ÿ’ก Tips 1. **Be specific with priorities** - Rate 3-5 features as 8+ for best matching 2. **Set realistic budgets** - Add 10-15% buffer for better results 3. **Multiple destinations** - Enter 3-5 options to see more deals 4. **Flexible dates** - Wider date ranges (30-60 days) find more options 5. **Save results** - Export to CSV for comparison and analysis --- ## ๐Ÿ”ง Troubleshooting **"Unable to connect to the remote server"** - Make sure the dev server is running: `npm run dev` - Check that it's on port 4000: look for "Local: http://localhost:4000" **"No deals found"** - Try removing or increasing the budget - Expand your date range - Add more destination options - Set non-stop to `n` instead of `y` **Script won't run** - Enable script execution: `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned` - Or run with: `powershell -ExecutionPolicy Bypass -File .\search-interactive.ps1` --- ## ๐Ÿ“Š Understanding Results Results are sorted by a **composite score** that considers: - **Price** (lower is better) - **Flight type** (non-stop gets bonus) - **Trip length** (closer to 7 nights is ideal) - **Source reliability** (curated deal sites get bonus) - **Feature match** (how well destination matches your priorities) Higher scores = better matches for your criteria! --- Happy searching! ๐ŸŒดโœˆ๏ธ