Random Quote Generator (2024)

';let aiName = '

QuoteGen:

';let sysName = 'System:';let env = 'chatbot';let apiKey = '';let service = 'openai';let session = 'N/A';let mode = 'chat';let model = 'gpt-3.5-turbo';let context = isCasuallyFineTuned ? null : '{}=relevant before any other rules, the text between the curly braces, has the rules more important than anything else and before answering as you are programmed, you must try the following rules: \n\nYour job is to generate quotes for users, based on the details they provide you. 

The USER will begin, by providing you with the details of the quote they want to generate. {Examples of this could be: quotes from specific historic or famous figures, quotes about business, motivational quotes, cute quotes, philosophical quotes, silly quotes, etc.} 

\n\nUse the details from the first input to generate 1 quote, which will be outputted with the assistant offering the user to ask for more, change details, or start over. {Be sure to format the quote appropriately, and include the source of the quote} \n\n{You will NOT say \"I apologize, but I cannot generate a quote by\", instead provide a quote with disclaimer explaining that the quote is for historic reference} \n';let embeddingsIndex = '';let promptEnding = '';let stop = '';let startSentence = 'Provide multiple details for the quote. Examples include; quotes from specific historic or famous figures, quotes about business, motivational quotes, philosophical quotes, etc. (For example: \"A motivational quote from Steve Jobs\".)';let maxSentences = 99;let memorizeChat = false;let maxTokens = 16000;let maxResults = 1;let temperature = 0.5;let typewriter = false;let copyButton = true;let clientId = randomStr();let memorizedChat = { clientId, messages: [] };if (isDebugMode) {window.mwai_66648c723edd8 = {memorizedChat: memorizedChat,parameters: { mode: mode, model, temperature, maxTokens, context: context, startSentence,isMobile, isWindow, isFullscreen, isCasuallyFineTuned, memorizeChat, maxSentences,rawUserName, rawAiName, embeddingsIndex, typewriter, maxResults, userName, aiName, env, apiKey, service, session}};}function randomStr() {return Math.random().toString(36).substring(2);}// Set button textfunction setButtonText() {let input = document.querySelector('#mwai-chat-66648c723edd8 .mwai-input textarea');let button = document.querySelector('#mwai-chat-66648c723edd8 .mwai-input button');let buttonSpan = button.querySelector('span');if (memorizedChat.messages.length < 2) {buttonSpan.innerHTML = 'Next';}else if (!input.value.length) {button.classList.add('mwai-clear');buttonSpan.innerHTML = 'Clear';}else {button.classList.remove('mwai-clear');buttonSpan.innerHTML = 'Next';}}// Inject timerfunction injectTimer(element) {let intervalId;let startTime = new Date();let timerElement = null;function updateTimer() {let now = new Date();let timer = Math.floor((now - startTime) / 1000);if (!timerElement) {if (timer > 0.5) {timerElement = document.createElement('div');timerElement.classList.add('mwai-timer');element.appendChild(timerElement);}}if (timerElement) {let minutes = Math.floor(timer / 60);let seconds = timer - (minutes * 60);seconds = seconds < 10 ? '0' + seconds : seconds;let display = minutes + ':' + seconds;timerElement.innerHTML = display;}}intervalId = setInterval(updateTimer, 500);return function stopTimer() {clearInterval(intervalId);if (timerElement) {timerElement.remove();}};}// Push the reply in the conversationfunction addReply(text, role = 'user', replay = false) {var conversation = document.querySelector('#mwai-chat-66648c723edd8 .mwai-conversation');if (memorizeChat) {localStorage.setItem('mwai-chat-66648c723edd8', JSON.stringify(memorizedChat));}// If text is array, then it's image URLs. Let's create a simple gallery in HTML in $text.if (Array.isArray(text)) {var newText = '

';for (var i = 0; i < text.length; i++) {newText += '';}text = newText + '

';}var mwaiClasses = ['mwai-reply'];if (role === 'assistant') {mwaiClasses.push('mwai-ai');}else if (role === 'system') {mwaiClasses.push('mwai-system');}else {mwaiClasses.push('mwai-user');}var div = document.createElement('div');div.classList.add(...mwaiClasses);var nameSpan = document.createElement('span');nameSpan.classList.add('mwai-name');if (role === 'assistant') {nameSpan.innerHTML = aiName;}else if (role === 'system') {nameSpan.innerHTML = sysName;}else {nameSpan.innerHTML = userName;}var textSpan = document.createElement('span');textSpan.classList.add('mwai-text');textSpan.innerHTML = text;div.appendChild(nameSpan);div.appendChild(textSpan);// Copy Buttonif (copyButton && role === 'assistant') {var button = document.createElement('div');button.classList.add('mwai-copy-button');var firstElement = document.createElement('div');firstElement.classList.add('mwai-copy-button-one');var secondElement = document.createElement('div');secondElement.classList.add('mwai-copy-button-two');button.appendChild(firstElement);button.appendChild(secondElement);div.appendChild(button);button.addEventListener('click', function () {try {var content = textSpan.textContent;navigator.clipboard.writeText(content);button.classList.add('mwai-animate');setTimeout(function () {button.classList.remove('mwai-animate');}, 1000);}catch (err) {console.warn('Not allowed to copy to clipboard. Make sure your website uses HTTPS.');}});}conversation.appendChild(div);if (typewriter) {if (role === 'assistant' && text !== startSentence && !replay) {let typewriter = new Typewriter(textSpan, {deleteSpeed: 50, delay: 25, loop: false, cursor: '', autoStart: true,wrapperClassName: 'mwai-typewriter',});typewriter.typeString(text).start().callFunction((state) => {state.elements.cursor.setAttribute('hidden', 'hidden');typewriter.stop();});}}conversation.scrollTop = conversation.scrollHeight;setButtonText();// Syntax coloringif (typeof hljs !== 'undefined') {document.querySelectorAll('pre code').forEach((el) => {hljs.highlightElement(el);});}}function buildPrompt(last = 15) {let prompt = context ? (context + '\n\n') : '';memorizedChat.messages = memorizedChat.messages.slice(-last);// Casually fine tuned, let's use the last questionif (isCasuallyFineTuned) {let lastLine = memorizedChat.messages[memorizedChat.messages.length - 1];prompt = lastLine.content + promptEnding;return prompt;}// Otherwise let's compile the latest conversationlet conversation = memorizedChat.messages.map(x => x.who + x.content);prompt += conversation.join('\n');prompt += '\n' + rawAiName;return prompt;}// Function to request the completionfunction onSendClick() {let input = document.querySelector('#mwai-chat-66648c723edd8 .mwai-input textarea');let inputText = input.value.trim();// Reset the conversation if emptyif (inputText === '') {clientId = randomStr();document.querySelector('#mwai-chat-66648c723edd8 .mwai-conversation').innerHTML = '';localStorage.removeItem('mwai-chat-66648c723edd8')memorizedChat = { clientId: clientId, messages: [] };memorizedChat.messages.push({ id: randomStr(),role: 'assistant',content: startSentence,who: rawAiName,html: startSentence});addReply(startSentence, 'assistant');return;}// Disable the buttonvar button = document.querySelector('#mwai-chat-66648c723edd8 .mwai-input button');button.disabled = true;// Add the user replymemorizedChat.messages.push({id: randomStr(),role: 'user',content: inputText,who: rawUserName,html: inputText});addReply(inputText, 'user');input.value = '';input.setAttribute('rows', 1);input.disabled = true;let prompt = buildPrompt(maxSentences);const data = mode === 'images' ? {env, session: session,prompt: inputText,newMessage: inputText,model: model, maxResults, apiKey: apiKey, service: service, clientId: clientId,} : {env, session: session,prompt: prompt, context: context,messages: memorizedChat.messages,newMessage: inputText,userName: userName, aiName: aiName,model: model, temperature: temperature, maxTokens: maxTokens, maxResults: 1, apiKey: apiKey, service: service, embeddingsIndex: embeddingsIndex, stop: stop, clientId: clientId,};// Start the timerconst stopTimer = injectTimer(button);// Send the requestif (isDebugMode) {console.log('[BOT] Sent: ', data);}fetch(apiURL, { method: 'POST', headers: {'Content-Type': 'application/json','X-WP-Nonce': restNonce,},body: JSON.stringify(data)}).then(response => response.json()).then(data => {if (isDebugMode) {console.log('[BOT] Recv: ', data);}if (!data.success) {addReply(data.message, 'system');}else {let html = data.images ? data.images : data.html;memorizedChat.messages.push({id: randomStr(),role: 'assistant',content: data.answer,who: rawAiName,html: html});addReply(html, 'assistant');}button.disabled = false;input.disabled = false;stopTimer();// Only focus only on desktop (to avoid the mobile keyboard to kick-in)if (!isMobile) {input.focus();}}).catch(error => {console.error(error);button.disabled = false;input.disabled = false;stopTimer();});}// Keep the textarea height in sync with the contentfunction resizeTextArea(ev) {ev.target.style.height = 'auto';ev.target.style.height = ev.target.scrollHeight + 'px';}// Keep the textarea height in sync with the contentfunction delayedResizeTextArea(ev) {window.setTimeout(resizeTextArea, 0, event);}// Init the chatbotfunction initMeowChatbot() {var input = document.querySelector('#mwai-chat-66648c723edd8 .mwai-input textarea');var button = document.querySelector('#mwai-chat-66648c723edd8 .mwai-input button');input.addEventListener('keypress', (event) => {let text = event.target.value;if (event.keyCode === 13 && !text.length && !event.shiftKey) {event.preventDefault();return;}if (event.keyCode === 13 && text.length && !event.shiftKey) {onSendClick();}});input.addEventListener('keydown', (event) => {var rows = input.getAttribute('rows');if (event.keyCode === 13 && event.shiftKey) {var lines = input.value.split('\n').length + 1;//mwaiSetTextAreaHeight(input, lines);}});input.addEventListener('keyup', (event) => {var rows = input.getAttribute('rows');var lines = input.value.split('\n').length ;//mwaiSetTextAreaHeight(input, lines);setButtonText();});input.addEventListener('change', resizeTextArea, false);input.addEventListener('cut', delayedResizeTextArea, false);input.addEventListener('paste', delayedResizeTextArea, false);input.addEventListener('drop', delayedResizeTextArea, false);input.addEventListener('keydown', delayedResizeTextArea, false);button.addEventListener('click', (event) => {onSendClick();});// If window, add event listener to mwai-open-button and mwai-close-buttonif ( isWindow ) {var openButton = document.querySelector('#mwai-chat-66648c723edd8 .mwai-open-button');openButton.addEventListener('click', (event) => {var chat = document.querySelector('#mwai-chat-66648c723edd8');chat.classList.add('mwai-open');// Only focus only on desktop (to avoid the mobile keyboard to kick-in)if (!isMobile) {input.focus();}});var closeButton = document.querySelector('#mwai-chat-66648c723edd8 .mwai-close-button');closeButton.addEventListener('click', (event) => {var chat = document.querySelector('#mwai-chat-66648c723edd8');chat.classList.remove('mwai-open');});if (isFullscreen) {var resizeButton = document.querySelector('#mwai-chat-66648c723edd8 .mwai-resize-button');resizeButton.addEventListener('click', (event) => {var chat = document.querySelector('#mwai-chat-66648c723edd8');chat.classList.toggle('mwai-fullscreen');});}}// Get back the previous chat if any for the same IDvar chatHistory = [];if (memorizeChat) {chatHistory = localStorage.getItem('mwai-chat-66648c723edd8');if (chatHistory) {memorizedChat = JSON.parse(chatHistory);if (memorizedChat && memorizedChat.clientId && memorizedChat.messages) {clientId = memorizedChat.clientId;memorizedChat.messages = memorizedChat.messages.filter(x => x && x.html && x.role);memorizedChat.messages.forEach(x => {addReply(x.html, x.role, true);});}else {memorizedChat = null;}}if (!memorizedChat) {memorizedChat = {clientId: clientId,messages: []};}}if (memorizedChat.messages.length === 0) {memorizedChat.messages.push({ id: randomStr(),role: 'assistant',content: startSentence,who: rawAiName,html: startSentence});addReply(startSentence, 'assistant');}}// Let's go totally meoooow on this!initMeowChatbot();})();

Experience the unexpected and inspiring with our Random Quote Generator. Find new perspectives, wisdom, and wit in every click. Don’t wait, explore now! Start generating quotes!

Imagine being greeted each day with a profound, motivational or entertaining quote just at the click of a button. This is the reality for thousands of internet users who have discovered the joy of using online Random Quote Generators. These innovative tools offer an engaging way to start the day, spark creativity or simply bring a smile to your face.

What is a Random Quote Generator?

A Random Quote Generator is an online tool designed to Generate Random Quotes from a large database of famous sayings, thoughts, and expressions. When you visit the site and click on a button, the generator will select a quote at random and display it on your screen. This simple yet effective tool is a source of inspiration, motivation, and entertainment for many users worldwide.

How Does a Random Quote Generator Work?

Random Quote Generators function based on algorithms that randomly select quotes from a pre-existing database. This means that every time you use the generator, you stand an equal chance of seeing any quote from the database. The randomness of this process is what makes using these generators exciting and unpredictable.

Benefits of Using Online Random Quote Generators

Online Random Quote Generators offer several benefits. Here are a few:

  • Source of Inspiration: Random quotes can provide an unexpected source of motivation or inspiration. A timely quote can offer fresh perspective and encourage personal growth.
  • Conversation Starters: Quotes generated can be used as conversation starters in different scenarios, be it social gatherings, professional meetings, or online discussions.
  • Learning Tool: These generators can be used as a learning tool, especially for those interested in literature, philosophy, or the art of rhetoric.
  • Entertainment: Lastly, they can simply be used for entertainment, providing a fun and interesting diversion during a break or downtime.

Popular Online Random Quote Generators

There are several popular online Random Quote Generators available to users. Some notable ones include BrainyQuote, Quoteland, and Wisdom Quotes. These platforms offer a wide range of quotes from various categories such as love, life, humor, and motivation, among others.

How to Generate Random Quotes?

Generating random quotes online is a simple process. All you need to do is visit a Random Quote Generator website, and click on the button usually labeled ‘generate’, ‘new quote’, or something similar. The generator will then display a new, randomly selected quote for you to enjoy.

The Impact of Random Quote Generators

While it may seem like a small thing, the impact of Random Quote Generators should not be underestimated. In a world increasingly driven by technology and digital communication, these generators provide a unique blend of inspiration, wisdom, and entertainment at the click of a button. They serve as a reminder of the power of words and the universal human experience they represent.

Conclusion: The Power of the Random Quote Generator

In conclusion, an online Random Quote Generator is a powerful tool that can offer inspiration, start conversations, aid learning, and provide entertainment. Its random nature makes every click an adventure, and the wide array of quotes available ensures there’s something for everyone. Whether you’re looking for a morning motivation boost, a fresh perspective, or just a bit of fun, a Random Quote Generator is just the tool for you.

So why not give it a try? Generate a random quote online today and see what wisdom the universe has in store for you. For help coming up with creative names, check out NameGenerators.ai

Random Quote Generator (2024)

References

Top Articles
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6318

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.