BlendQuote

Test this app for free
108
import os
from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from random import choice
import logging

logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.WARNING)

app = FastAPI()

# Updated list of quotes provided by the builder
quotes = [
    "When you have a dream, you've got to grab it and never let go - Carol Burnett",
    "Nothing is impossible. The word itself says 'I'm possible!' - Audrey Hepburn",
    "There is nothing impossible to they who will try. - Alexander the Great",
    "The bad news is time flies. The good news is you're the pilot. - Michael Altshuler",
    "Life has got all those twists and turns. You've got to hold on tight and off you go. - Nicole Kidman",
    "Keep your face always toward the sunshine, and shadows will fall behind you. - Walt Whitman",
    "Be courageous. Challenge orthodoxy. Stand up for what you believe in. When you are in your rocking chair talking to your grandchildren many years from now, be sure you have a good story to tell. - Amal Clooney",
    "You make a choice: continue living your life feeling muddled in this abyss of self-misunderstanding, or you find your identity independent of it. You draw your own box. - Duchess Meghan",
    "I just want you to know that if you are out there and you are being really hard on yourself right now for something that has happened ... it's normal. That is what is going to happen to you in life. No one gets through unscathed. We are all going to have a few scratches on us. Please be kind to yourselves and stand up for yourself, please. - Taylor Swift",
    "Success is not final, failure is not fatal: it is the courage to continue that counts. - Winston Churchill",
    "You define your own life. Don't let other people write your script. - Oprah Winfrey",
Get full code

Frequently Asked Questions

How can BlendQuote be used for business marketing purposes?

BlendQuote can be an excellent tool for business marketing in several ways: - Social media engagement: Share daily quotes on your business's social media platforms to increase follower interaction. - Email marketing: Include a "Quote of the Day" in your newsletters to add value and encourage opens. - Website enhancement: Embed BlendQuote on your company website to increase visitor engagement and time spent on site. - Brand personality: Use quotes that align with your brand values to reinforce your company's image and message.

Can BlendQuote be customized for specific industries or themes?

Absolutely! BlendQuote is highly customizable. You can tailor the quote list to fit specific industries or themes by: - Curating quotes relevant to your industry (e.g., tech, finance, healthcare). - Adding quotes from thought leaders in your field. - Including company-specific quotes or mottos. - Adjusting the color scheme and fonts to match your brand identity.

How can BlendQuote be monetized as a standalone product?

There are several ways to monetize BlendQuote as a standalone product: - Freemium model: Offer basic functionality for free, with premium features (e.g., more quotes, custom themes) for a subscription fee. - API access: Provide API access for developers to integrate BlendQuote into their applications for a fee. - White-label solution: Sell customized versions of BlendQuote to businesses for internal use or client-facing applications. - Ad-supported model: Include non-intrusive ads in the free version of the app.

How can I add new quotes to the BlendQuote application?

To add new quotes to BlendQuote, you can modify the quotes list in the main.py file. Here's an example of how to add a new quote:

python quotes = [ # ... existing quotes ... "Your new quote goes here. - Author Name", ]

You can add as many quotes as you like. Remember to maintain the format of "Quote text - Author" for consistency.

How can I change the background image in BlendQuote?

To change the background image in BlendQuote, you need to update the background_image_url variable in the root_path() function. Here's how you can do it:

python @app.get("/", response_class=HTMLResponse) def root_path(): try: background_image_url = "https://your-new-image-url.com/image.jpg" html_content = f"""<!DOCTYPE html> <html lang="en"> <head> ... <style> body {{ background: url('{background_image_url}') no-repeat center center fixed; background-size: cover; }} ... </style> </head> ... </html> """ return HTMLResponse(content=html_content, status_code=200) except Exception as e: ...

Replace "https://your-new-image-url.com/image.jpg" with the URL of your desired background image. Make sure the image is accessible and has the appropriate permissions for use in your application.

Created: | Last Updated:

A random quote generator app with an enticing colour theme

Introduction to the BlendQuote Template

Welcome to the BlendQuote template, a Lazy template designed to help you create a random quote generator app with an appealing color theme. This app uses FastAPI to serve a web interface where users can click to receive a random inspirational quote displayed in a random font. The app also provides an API endpoint to fetch a random quote programmatically.

Getting Started with the BlendQuote Template

To begin building your random quote generator app using the BlendQuote template, simply click on "Start with this Template" in the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.

Test: Deploying the App

Once you have started with the template, the next step is to deploy your app. Press the "Test" button to initiate the deployment process. The Lazy CLI will handle the deployment, and you won't need to install any libraries or set up your environment, as Lazy takes care of all of that for you.

Using the BlendQuote App

After pressing the "Test" button and the deployment is complete, Lazy will provide you with a dedicated server link. You can use this link to access the web interface of your app. The main page will display a message inviting users to click to get their quote. Upon clicking, a random quote along with a random font will be displayed.

If you want to interact with the app programmatically, you can use the provided API endpoint /get_quote. Lazy will also provide a link to the FastAPI documentation, where you can see all available API endpoints and their details.

Here's a sample request to the API:

GET /get_quote

And a sample response might look like this:

{
    "quote": "Life has got all those twists and turns. You've got to hold on tight and off you go. - Nicole Kidman",
    "font": "Times New Roman"
}

Integrating the BlendQuote App

If you wish to integrate the BlendQuote app into another service or frontend, you can use the server link provided by Lazy to make API calls from your external tool. For example, if you have a website and want to display a random quote, you can make an AJAX call to the /get_quote endpoint and display the result on your site.

Here's an example of how you might integrate the API into an external website:

fetch('YOUR_SERVER_LINK/get_quote')
    .then(response \=> response.json())
    .then(data \=> {
        // Use data.quote and data.font to display the quote in your website's UI
    })
    .catch(error \=> console.error('Error fetching the quote:', error));

Replace YOUR_SERVER_LINK with the actual server link provided by Lazy after deployment.

By following these steps, you can easily use the BlendQuote template to create and deploy a random quote generator app on the Lazy platform without worrying about the technical details of deployment and environment setup.



Here are 5 key business benefits for the BlendQuote template:

Template Benefits

  1. Engaging User Experience: The visually appealing design with a pastel color scheme and interactive quote display can increase user engagement and time spent on the application.

  2. Brand Building: The prominent "BlendQuote" branding and unique aesthetic can help establish a memorable identity for the service, potentially leading to increased brand recognition and user loyalty.

  3. Versatile Content Marketing: The diverse quote collection can be leveraged for content marketing across various social media platforms, helping to attract and retain a wider audience.

  4. Easy Customization: The template's modular design allows for quick updates to the quote database and font selection, making it adaptable for different themes or targeted marketing campaigns.

  5. Potential for Monetization: The engaging format could be expanded to include sponsored quotes or affiliate links, creating opportunities for revenue generation while maintaining the core user experience.

Technologies

Similar templates