import requests
from bs4 import BeautifulSoup


def get_first_paragraphs(url):
    """
    Request link `url` (str) and return the first paragraph or so,
    limited to the hard-coded number of characters.
    """
    # Hard-coded:
    max_chars = 500
    
    # Get wikipedia article:
    response = requests.get(url)

    # Get paragraphs:
    soup = BeautifulSoup(response.text, 'lxml')
    paragraphs = soup.find_all('p')
    
    # Concatena parágrafos até o máximo de caracteres:
    intro = ''
    for paragraph in paragraphs:
        intro = intro + paragraph.text
        if len(intro) > max_chars:
            break
    
    return intro