MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / get_startup_note

Function get_startup_note

src/pyspector/cli.py:35–51  ·  view source on GitHub ↗

Fetches a tech joke or returns a fallback if offline.

()

Source from the content-addressed store, hash-verified

33
34import random
35
36def get_startup_note():
37 """Fetches a tech joke or returns a fallback if offline."""
38 fallbacks = [
39 "💡 'To err is human, to complain is even more human.'",
40 "💡 There are 10 types of people: those who understand binary and those who don't.",
41 "💡 A SQL query walks into a bar, walks up to two tables, and asks... 'Can I join you?'",
42 "💡 Cybersecurity is the only industry where the 'bad guys' have a better R&D budget.",
43 "💡 Hardware: The parts of a computer system that can be kicked."
44 ]
45 try:
46 url = "https://v2.jokeapi.dev/joke/Programming?safe-mode&type=single"
47 response = requests.get(url, timeout=1.5)
48 if response.status_code == 200:
49 return f"💡 {response.json()['joke']}"
50 except Exception:
51 pass
52 return random.choice(fallbacks)
53
54def _dbg(debug: bool, msg: str = "", **style_kwargs) -> None:

Callers 1

_print_bannerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected