Skip to content

Instantly share code, notes, and snippets.

View leandrotoledo's full-sized avatar

Leandro Toledo leandrotoledo

  • Google
  • Reston, VA
View GitHub Profile
@leandrotoledo
leandrotoledo / echobot.py using Cloud Functions.md
Last active March 23, 2024 18:17
Creating a simple Echo Telegram Bot using Google Cloud Functions in 5 minutes
Requirements:
  • Google Cloud Platform with Billing enabled.
  • Bot created using the @BotFather on Telegram.
  • Bot Token issued by the @BotFather.
2) On the Navigation Menu, go to Cloud Functions.
3) Click on Create Function.
@leandrotoledo
leandrotoledo / lcso_report_parser.py
Created February 22, 2025 15:07
This script extracts tables from LCSO Reports (PDFs) and formats them as Markdown for Telegram messages (using <pre> tags for proper rendering).
import pymupdf
def generate_markdown_table(rows):
"""Generates a Markdown table string wrapped in <pre> tags."""
if not rows:
return "No incidents reported"
headers = ["Station", "Date / Time", "Location", "Incident"]