diff --git a/html/search.ejs b/html/search.ejs
index 7c753f83..43218758 100644
--- a/html/search.ejs
+++ b/html/search.ejs
@@ -494,7 +494,8 @@ video[counter].classList.add("shake");
<% }) %>
-
Apply!
+
+Apply!
@@ -515,19 +516,14 @@ function isMathExpression(query) {
return /^[0-9\s\+\-\*\/\.\x]+$/.test(query);
}
-function evaluateMathExpression(expression) {
- // twenyone
- if (expression.replace(/\s+/g, '') === '9+10') {
- return '21';
+if (/^[0-9\s+\-*/.x]+$/.test(query)) {
+ const expr = query.replace(/\s+/g, '');
+ answer = expr === '9+10' ? '21' : (() => {
+ try { return eval(expr); } catch { return 'Invalid Expression'; }
+ })();
+ return answer;
}
- try {
- return eval(expression);
- } catch (error) {
- return 'Invalid Expression';
- }
-}
-
function getCurrentDate() {
const now = new Date();
return now.toLocaleDateString();
@@ -538,58 +534,138 @@ function getCurrentYear() {
}
function getTimeInTimezone(location) {
- const timezones = {
- "california": "America/Los_Angeles",
- "new york": "America/New_York",
- "chicago": "America/Chicago",
- "denver": "America/Denver",
- "phoenix": "America/Phoenix",
- "anchorage": "America/Anchorage",
- "honolulu": "Pacific/Honolulu",
- "london": "Europe/London",
- "paris": "Europe/Paris",
- "berlin": "Europe/Berlin",
- "madrid": "Europe/Madrid",
- "rome": "Europe/Rome",
- "moscow": "Europe/Moscow",
- "athens": "Europe/Athens",
- "sydney": "Australia/Sydney",
- "melbourne": "Australia/Melbourne",
- "brisbane": "Australia/Brisbane",
- "perth": "Australia/Perth",
- "tokyo": "Asia/Tokyo",
- "osaka": "Asia/Osaka",
- "seoul": "Asia/Seoul",
- "beijing": "Asia/Shanghai",
- "shanghai": "Asia/Shanghai",
- "hong kong": "Asia/Hong_Kong",
- "taipei": "Asia/Taipei",
- "bangkok": "Asia/Bangkok",
- "jakarta": "Asia/Jakarta",
- "delhi": "Asia/Kolkata",
- "mumbai": "Asia/Kolkata",
- "kolkata": "Asia/Kolkata",
- "karachi": "Asia/Karachi",
- "lahore": "Asia/Karachi",
- "dubai": "Asia/Dubai",
- "abu dhabi": "Asia/Dubai",
- "riyadh": "Asia/Riyadh",
- "johannesburg": "Africa/Johannesburg",
- "cairo": "Africa/Cairo",
- "nairobi": "Africa/Nairobi",
- "lagos": "Africa/Lagos",
- "algiers": "Africa/Algiers",
- "casablanca": "Africa/Casablanca",
- "lisbon": "Europe/Lisbon",
- "dublin": "Europe/Dublin",
- "zurich": "Europe/Zurich",
- "vienna": "Europe/Vienna",
- "stockholm": "Europe/Stockholm",
- "oslo": "Europe/Oslo",
- "helsinki": "Europe/Helsinki"
- };
+const tzMap = {
+ "california": "America/Los_Angeles",
+ "new york": "America/New_York",
+ "chicago": "America/Chicago",
+ "denver": "America/Denver",
+ "phoenix": "America/Phoenix",
+ "anchorage": "America/Anchorage",
+ "honolulu": "Pacific/Honolulu",
+ "london": "Europe/London",
+ "paris": "Europe/Paris",
+ "berlin": "Europe/Berlin",
+ "madrid": "Europe/Madrid",
+ "rome": "Europe/Rome",
+ "moscow": "Europe/Moscow",
+ "athens": "Europe/Athens",
+ "sydney": "Australia/Sydney",
+ "melbourne": "Australia/Melbourne",
+ "brisbane": "Australia/Brisbane",
+ "perth": "Australia/Perth",
+ "tokyo": "Asia/Tokyo",
+ "osaka": "Asia/Osaka",
+ "seoul": "Asia/Seoul",
+ "beijing": "Asia/Shanghai",
+ "shanghai": "Asia/Shanghai",
+ "hong kong": "Asia/Hong_Kong",
+ "taipei": "Asia/Taipei",
+ "bangkok": "Asia/Bangkok",
+ "jakarta": "Asia/Jakarta",
+ "delhi": "Asia/Kolkata",
+ "mumbai": "Asia/Kolkata",
+ "karachi": "Asia/Karachi",
+ "dubai": "Asia/Dubai",
+ "abu dhabi": "Asia/Dubai",
+ "riyadh": "Asia/Riyadh",
+ "johannesburg": "Africa/Johannesburg",
+ "cairo": "Africa/Cairo",
+ "nairobi": "Africa/Nairobi",
+ "lagos": "Africa/Lagos",
+ "algiers": "Africa/Algiers",
+ "casablanca": "Africa/Casablanca",
+ "lisbon": "Europe/Lisbon",
+ "dublin": "Europe/Dublin",
+ "zurich": "Europe/Zurich",
+ "vienna": "Europe/Vienna",
+ "stockholm": "Europe/Stockholm",
+ "oslo": "Europe/Oslo",
+ "helsinki": "Europe/Helsinki",
+ "prague": "Europe/Prague",
+ "budapest": "Europe/Budapest",
+ "warsaw": "Europe/Warsaw",
+ "bucharest": "Europe/Bucharest",
+ "sofia": "Europe/Sofia",
+ "zagreb": "Europe/Zagreb",
+ "belgrade": "Europe/Belgrade",
+ "sarajevo": "Europe/Sarajevo",
+ "podgorica": "Europe/Podgorica",
+ "ljubljana": "Europe/Ljubljana",
+ "tirana": "Europe/Tirane",
+ "valletta": "Europe/Malta",
+ "andorra la vella": "Europe/Andorra",
+ "monaco": "Europe/Monaco",
+ "luxembourg": "Europe/Luxembourg",
+ "bratislava": "Europe/Bratislava",
+ "vilnius": "Europe/Vilnius",
+ "riga": "Europe/Riga",
+ "tallinn": "Europe/Tallinn",
+ "istanbul": "Europe/Istanbul",
+ "jerusalem": "Asia/Jerusalem",
+ "amman": "Asia/Amman",
+ "beirut": "Asia/Beirut",
+ "damascus": "Asia/Damascus",
+ "baghdad": "Asia/Baghdad",
+ "tehran": "Asia/Tehran",
+ "islamabad": "Asia/Karachi",
+ "kathmandu": "Asia/Kathmandu",
+ "thimphu": "Asia/Thimphu",
+ "dhaka": "Asia/Dhaka",
+ "yangon": "Asia/Yangon",
+ "hanoi": "Asia/Ho_Chi_Minh",
+ "ho chi minh city": "Asia/Ho_Chi_Minh",
+ "manila": "Asia/Manila",
+ "singapore": "Asia/Singapore",
+ "kuala lumpur": "Asia/Kuala_Lumpur",
+ "colombo": "Asia/Colombo",
+ "bagotville": "America/Montreal",
+ "toronto": "America/Toronto",
+ "vancouver": "America/Vancouver",
+ "mexico city": "America/Mexico_City",
+ "guadalajara": "America/Mexico_City",
+ "monterrey": "America/Monterrey",
+ "sao paulo": "America/Sao_Paulo",
+ "buenos aires": "America/Argentina/Buenos_Aires",
+ "santiago": "America/Santiago",
+ "rio de janeiro": "America/Sao_Paulo",
+ "caracas": "America/Caracas",
+ "bogota": "America/Bogota",
+ "lima": "America/Lima",
+ "quito": "America/Quito",
+ "georgetown": "America/Guyana",
+ "paramaribo": "America/Paramaribo",
+ "cayenne": "America/Cayenne",
+ "kingston": "America/Jamaica",
+ "port_of_spain": "America/Port_of_Spain",
+ "st johns": "America/St_Johns",
+ "midway": "Pacific/Midway",
+ "apia": "Pacific/Apia",
+ "nuku alofa": "Pacific/Tongatapu",
+ "tarawa": "Pacific/Tarawa",
+ "funafuti": "Pacific/Funafuti",
+ "suva": "Pacific/Fiji",
+ "chatham": "Pacific/Chatham",
+ "pitcairn": "Pacific/Pitcairn",
+ "galapagos": "Pacific/Galapagos",
+ "easter island": "Pacific/Easter",
+ "honiara": "Pacific/Guadalcanal",
+ "port vila": "Pacific/Efate",
+ "palikir": "Pacific/Pohnpei",
+ "palau": "Pacific/Palau",
+ "mcmurdo": "Antarctica/McMurdo",
+ "rothera": "Antarctica/Rothera",
+ "troll": "Antarctica/Troll",
+ "davis": "Antarctica/Davis",
+ "casey": "Antarctica/Casey",
+ "mawson": "Antarctica/Mawson",
+ "vostok": "Antarctica/Vostok",
+ "syowa": "Antarctica/Syowa",
+ "gmt": "Etc/GMT",
+ "utc": "UTC"
+};
- const timezone = timezones[location.toLowerCase()];
+
+ const timezone = tzMap[location.toLowerCase()];
if (!timezone) {
return null;
}
@@ -601,7 +677,166 @@ function getTimeInTimezone(location) {
const query = q.toLowerCase().trim();
let answer = '';
+// 19 utility functions
+function randomCompliment() {
+ const compliments = [
+ "Youโre an awesome friend.",
+ "You light up the room.",
+ "You have a great sense of humor.",
+ "You make a difference.",
+ "You're like a ray of sunshine."
+ ];
+ return compliments[Math.floor(Math.random() * compliments.length)];
+}
+
+function randomEncouragement() {
+ const encourages = [
+ "Keep goingโyouโve got this!",
+ "Donโt give up now!",
+ "Every step counts.",
+ "Believe in yourself.",
+ "You can do anything."
+ ];
+ return encourages[Math.floor(Math.random() * encourages.length)];
+}
+
+function base64Encode(str) {
+ return btoa(str);
+}
+
+function base64Decode(str) {
+ try {
+ return atob(str);
+ } catch {
+ return 'Invalid Base64';
+ }
+}
+
+function hexToDec(str) {
+ return parseInt(str.replace(/^0x/, ''), 16).toString();
+}
+
+function decToHex(num) {
+ return Number(num).toString(16);
+}
+
+function textToCharCodes(text) {
+ return text.split('').map(c => c.charCodeAt(0)).join(' ');
+}
+
+function charCodesToText(codes) {
+ return String.fromCharCode(...codes.split(/\s+/).map(n => +n));
+}
+
+function countWords(text) {
+ return text.trim().split(/\s+/).length;
+}
+
+function titleCase(text) {
+ return text
+ .split(' ')
+ .map(w => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
+ .join(' ');
+}
+
+function slugify(text) {
+ return text
+ .toLowerCase()
+ .trim()
+ .replace(/[^a-z0-9]+/g, '-')
+ .replace(/^-+|-+$/g, '');
+}
+
+function isPrime(n) {
+ n = Number(n);
+ if (n < 2) return false;
+ for (let i = 2; i <= Math.sqrt(n); i++) {
+ if (n % i === 0) return false;
+ }
+ return true;
+}
+
+function gcd(a, b) {
+ a = Math.abs(a); b = Math.abs(b);
+ while (b) [a, b] = [b, a % b];
+ return a;
+}
+
+function lcm(a, b) {
+ return Math.abs(a * b) / gcd(a, b);
+}
+
+function fibonacci(n) {
+ n = Number(n);
+ if (n < 2) return n;
+ let a = 0, b = 1;
+ for (let i = 2; i <= n; i++) [a, b] = [b, a + b];
+ return b;
+}
+
+function generatePassword(length = 8) {
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()';
+ let pw = '';
+ for (let i = 0; i < length; i++) {
+ pw += chars.charAt(Math.floor(Math.random() * chars.length));
+ }
+ return pw;
+}
+
+function daysUntil(dateStr) {
+ const now = new Date();
+ const then = new Date(dateStr);
+ const diff = then - now;
+ return diff > 0
+ ? Math.ceil(diff / (1000 * 60 * 60 * 24)) + ' days'
+ : 'Date passed';
+}
+
+function generateUUID() {
+ return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(
+ /[018]/g,
+ c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
+ );
+}
+
+function generateRandomString(length = 8) {
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+ let s = '';
+ for (let i = 0; i < length; i++) {
+ s += chars.charAt(Math.floor(Math.random() * chars.length));
+ }
+ return s;
+}
+
+
+ const emojiMap = {
+ "grinning face":"๐","grin":"๐","smiley":"๐","smile":"๐","sweat smile":"๐
",
+ "joy":"๐","rofl":"๐คฃ","relaxed":"โบ๏ธ","blush":"๐","innocent":"๐",
+ "slightly_smiling_face":"๐","upside_down":"๐","wink":"๐","relieved":"๐",
+ "heart eyes":"๐","kissing_heart":"๐","kissing":"๐","kissing_smiling_eyes":"๐",
+ "kissing_closed_eyes":"๐","yum":"๐","stuck out tongue":"๐","stuck out tongue wink":"๐",
+ "stuck out tongue closed eyes":"๐","money_mouth":"๐ค","hug":"๐ค","nerd":"๐ค",
+ "sunglasses":"๐","star_struck":"๐คฉ","thinking":"๐ค","zipper_mouth":"๐ค",
+ "raised_eyebrow":"๐คจ","neutral":"๐","expressionless":"๐","no_mouth":"๐ถ",
+ "roll_eyes":"๐","smirk":"๐","persevere":"๐ฃ","disappointed_relieved":"๐ฅ",
+ "cold_sweat":"๐ฐ","pensive":"๐","confused":"๐","worried":"๐","slightly_frowning":"๐",
+ "frowning":"โน๏ธ","anguished":"๐ง","open_mouth":"๐ฎ","grimacing":"๐ฌ","hushed":"๐ฏ",
+ "astonished":"๐ฒ","flushed":"๐ณ","pleading":"๐ฅบ","frowning2":"๐ฆ","anguished2":"๐ง",
+ "cry":"๐ข","disappointed":"๐","scream":"๐ฑ","fearful":"๐จ","tired_face":"๐ซ",
+ "weary":"๐ฉ","triumph":"๐ค","angry":"๐ ","rage":"๐ก","poop":"๐ฉ","thumbsup":"๐",
+ "thumbsdown":"๐","clap":"๐","raised_hands":"๐","pray":"๐","muscle":"๐ช","eyes":"๐",
+ "ear":"๐","nose":"๐","tongue":"๐
","lips":"๐","kiss":"๐","crown":"๐","womans hat":"๐",
+ "eyeglasses":"๐","necktie":"๐","shirt":"๐","jeans":"๐","dress":"๐","kimono":"๐",
+ "bikini":"๐","sandal":"๐ก","boot":"๐ข","mans shoe":"๐","high heel":"๐ ","sock":"๐งฆ",
+ "gloves":"๐งค","scarf":"๐งฃ","tophat":"๐ฉ","billed cap":"๐งข","flag us":"๐บ๐ธ","flag gb":"๐ฌ๐ง",
+ "flag ca":"๐จ๐ฆ","flag de":"๐ฉ๐ช","flag fr":"๐ซ๐ท","flag es":"๐ช๐ธ","flag it":"๐ฎ๐น","flag jp":"๐ฏ๐ต",
+ "flag cn":"๐จ๐ณ","flag in":"๐ฎ๐ณ","flag br":"๐ง๐ท","flag ru":"๐ท๐บ","flag za":"๐ฟ๐ฆ","flag au":"๐ฆ๐บ",
+ "flag nz":"๐ณ๐ฟ","flag ng":"๐ณ๐ฌ","flag eg":"๐ช๐ฌ","flag ar":"๐ฆ๐ท","flag mx":"๐ฒ๐ฝ","flag kr":"๐ฐ๐ท",
+ "flag tr":"๐น๐ท"
+};
+
+let m;
if (isMathExpression(query)) {
answer = evaluateMathExpression(query);
} else if (query.includes('date') || query.includes('what date is it')) {
@@ -618,16 +853,64 @@ if (isMathExpression(query)) {
const options = { weekday: 'long' };
answer = now.toLocaleDateString(undefined, options);
} else if (query.includes('u are cute') || query.includes('you are cute')) {
- answer = "jifshfgdhjf >~< no u"
+ answer = "jifshfgdhjf >~< no u";
} else if (query.includes('ur cute') || query.includes('your cute')) {
- answer = "efkohgefgef >///< no u"
+ answer = "efkohgefgef >///< no u";
} else if (query.includes('am i cute') || query.includes('am i a cutie?')) {
- answer = "yesh :3 u are "
+ answer = "yesh :3 u are ";
} else if (query.includes('am i a good girl') || query.includes('am i a good boy?')) {
- answer = query.includes('girl') ? "yesh :3 u are a good girl" : "yesh :3 u are a good boy";
+ answer = query.includes('girl')
+ ? "yesh :3 u are a good girl"
+ : "yesh :3 u are a good boy";
} else if (query.includes('ur hot') || query.includes('you are hot')) {
- answer = "jrifyehgyerfgu9wdswgfsafgydwgbfwdfge >~< "
-}
+ answer = "jrifyehgyerfgu9wdswgfsafgydwgbfwdfge >~< ";
+} else if (query.startsWith('emoji ')) {
+ const name = query.slice(6);
+ answer = emojiMap[name] || 'Unknown emoji';
+} else if (query.includes('compliment')) {
+ answer = randomCompliment();
+} else if (query.includes('encouragement') || query.includes('encourage me')) {
+ answer = randomEncouragement();
+} else if (query.startsWith('base64 encode ')) {
+ answer = base64Encode(query.slice(14));
+} else if (query.startsWith('base64 decode ')) {
+ answer = base64Decode(query.slice(14));
+} else if ((m = /0x[0-9a-f]+/i.exec(query))) {
+ answer = hexToDec(m[0]);
+} else if (query.match(/\d+\s+to\s+hex/i)) {
+ answer = decToHex(query.match(/\d+/)[0]);
+} else if (query.startsWith('char codes for ')) {
+ answer = textToCharCodes(query.slice(15));
+} else if (query.startsWith('text from codes ')) {
+ answer = charCodesToText(query.slice(16));
+} else if (query.startsWith('word count of ')) {
+ answer = countWords(query.slice(14)).toString();
+} else if (query.startsWith('titlecase ')) {
+ answer = titleCase(query.slice(10));
+} else if (query.startsWith('slugify ')) {
+ answer = slugify(query.slice(8));
+} else if (query.match(/\bprime\b/)) {
+ answer = isPrime(query.match(/\d+/)[0]) ? 'Yes' : 'No';
+} else if (query.includes('gcd of ')) {
+ const nums = query.match(/\d+/g);
+ answer = gcd(nums[0], nums[1]).toString();
+} else if (query.includes('lcm of ')) {
+ const nums = query.match(/\d+/g);
+ answer = lcm(nums[0], nums[1]).toString();
+} else if (query.match(/fib(?:onacci)?\s*\d+/i)) {
+ answer = fibonacci(query.match(/\d+/)[0]).toString();
+} else if (query.startsWith('generate password')) {
+ const n = query.match(/\d+/);
+ answer = generatePassword(n ? Number(n[0]) : undefined);
+} else if (query.includes('days until ')) {
+ answer = daysUntil(query.split('days until ')[1].trim());
+} else if (query.includes('uuid')) {
+ answer = generateUUID();
+} else if (query.startsWith('random string')) {
+ const n = query.match(/\d+/);
+ answer = generateRandomString(n ? Number(n[0]) : undefined);
+}
+
const upsellMessages = [
"[new] Try searching 'What's 4+4?'",
@@ -653,31 +936,89 @@ function extractQueryFromUpsellMessage(message) {
%>
%>
<% if (answer) { %>
-
-
- Answer to ur question
-
-
- <%= answer %>
-
+
+
+ <%= answer %>
+ ">
+ Copy
+
+
+
+
+
+
+
<% } else if (showUpsell) { %>
<% } %>
-
-<% if (q == "ai" || q == "aibot" || q == "chatbot") { %>
-
-
- No, POKE Will Never Have "AI" โBecause It Doesn't Need It
-
-
- POKE doesnโt need "AI." Thereโs no good reason for a YouTube front end to include some gimmicky AI assistant. These days, "AI" just means slapping a ChatGPT wrapper on an app, calling it innovative, and hoping no one notices the lack of actual purpose. Itโs the latest fad, sure, but POKE is about simplicity, privacy, and doing things rightโnot just joining tech trends for the sake of it.
-
- POKE is here to make watching videos smoother, not cluttered with unnecessary "features." Real value doesnโt come from chasing whatever big tech wants to sell you on. Itโs about staying true to what actually helps users. So, yeah, no AI here, and honestly, no need for it.
-
- If u really want a "chatbot" or "ai" : look at the chatgpt website - (or search using the !ai bang - which is made by duckduckgo, not us )
-
-
-<% } %>
+
<%
@@ -1018,12 +1359,12 @@ font-weight: 1000;" href="/watch?v=<%= x.videoId %>" class="title max-lines-2"><
<%= x.author %><% if (x?.authorVerified) { %>
<% } %>