Ejemplo n.º 1
0
async def fetch_tweet_contents(data: StatusUrl):
    try:
        status_id = int(data.status_url.split("/")[-1])
        response = get_content(status_id)
    except Exception as e:
        response = {"error": str(e)}
    return response
Ejemplo n.º 2
0
async def download_contents(*, status_url: str = Form(...), request: Request):
    try:
        status_id = int(status_url.split("/")[-1])
        response = get_content(status_id)
    except Exception as e:
        response = {"error": str(e)}
    return landing.TemplateResponse("download.html", {
        "request": request,
        "response": response
    })
Ejemplo n.º 3
0
async def download_contents_from_extension(status_id: int, request: Request):
    try:
        validate_header(request)
        response = get_content(status_id)
    except Exception as e:
        response = {"error": str(e)}
    return landing.TemplateResponse("download.html", {
        "request": request,
        "response": response
    })
Ejemplo n.º 4
0
async def download_contents_from_extension(status_id: int, request: Request):
    try:
        validate_header(request)
        return get_content(status_id)
    except Exception as e:
        return {"error": str(e)}