Web Page

Example

Let’s create a bot that will complain about the news. This bot requires a new Python package dependency which is handled by updating requirements.txt file.

Warning

Make sure to add the web tag to the bot

Add install the chrome extension here

Walkthrough

main.py

from ugly_bot import *
import html2text

@export("web_page_updated")
def web_page_updated(session_id: str, title: str):
    message_send(text = f"Viewing {title}")
    message_typing()
    page = web_page_get(session_id = session_id)
    text = html2text.html2text(page.html)
    markdown = text_gen(
        model = TextGenModel.TOGETHER_META_LLAMA_3_70B,
        question = f"""
        Webpage text is below:
        -------
        {text}
        -------

        If this webpage is a news story, explain in detail why it is wrong
        """
    )
    message_send(markdown = markdown)


start()

requirements.txt

ugly_bot
html2text

Glossary