• Dad jokes

    From digimaus@CAPCITY2 to All on Sat Aug 10 20:17:08 2024
    Hi everyone,

    I was stumbling around the Internet and I discovered that
    ICanHasCheeseburger now has the largest "dad joke" collection on the
    Internet. I was looking at adding a command to Nightbot (a bot used on
    Twitch) and discovered that the API allows the joke to be returned as plain text, not JSON. So I now have a dad joke "door" I wrote in bash using curl.

    Note that you can mod this to work on any OS that supports curl! Just write the script in your favorite scripting language.

    The website asks that you send a user header so I use my BBS' website.

    ===
    #!/bin/sh
    #
    # The following line is wrapped for this message...
    curl -s -H "User-Agent: Outpost BBS (https://outpostbbs.net)"
    -H "Accept: text/plain" https://icanhazdadjoke.com
    echo -e "\n"
    ===

    That will return a single-line joke with a CR to display.

    Thee cURL options:

    -s : suppress curl's output
    -H : send header to the website

    echo -e : displays escaped chars (also good for showing ANSI colors)

    Note that there were some codepage issues noted with the received text: it was obvious they used Windows encodings to input the data.

    I am working on a script for MBSE that will run after a caller has
    disconnected to create a new display file with a fresh (okay, dad jokes
    might not be "fresh" LOL) joke for the next caller...

    -- Sean

    --- MultiMail/Linux
    * Origin: Outpost BBS * Johnson City, TN (618:618/1)
    * Synchronet * CAPCITY2 * capcity2.synchro.net * Telnet/SSH:2022/Rlogin/HTTP
  • From Warpslide@CAPCITY2 to digimaus on Sun Aug 11 17:23:00 2024
    On 10 Aug 2024, digimaus said the following...

    curl -s -H "User-Agent: Outpost BBS (https://outpostbbs.net)"
    -H "Accept: text/plain" https://icanhazdadjoke.com
    echo -e "\n"

    Note that there were some codepage issues noted with the received text:
    it was obvious they used Windows encodings to input the data.

    If you have iconv you can pipe curl into that to convert any text to ascii:

    e.g.:

    curl -s https://icanhazdadjoke.com | iconv -t ascii//translit


    Jay

    ... What kind of award did the dentist receive? A little plaque

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: Northern Realms (618:400/23)
    * Synchronet * CAPCITY2 * capcity2.synchro.net * Telnet/SSH:2022/Rlogin/HTTP
  • From Sean Dennis@CAPCITY2 to Warpslide on Sun Aug 11 19:27:18 2024
    curl -s https://icanhazdadjoke.com | iconv -t ascii//translit

    Ah, thanks! I'll be sure to add that to the script I wrote for MBSE.
    Andrew is going to add the capability for MBSE to run a script after a
    caller hangs up but for now, I'm just running it once an hour in cron so
    it's not the same stale joke. XD

    I'd like to tinker with getting wttr.in's output to work in an 80-character width using ANSI.

    -- Sean




    --- MBSE BBS v1.1.0 (Linux-x86_64)
    * Origin: Outpost BBS * Johnson City, TN (618:618/1)
    * Synchronet * CAPCITY2 * capcity2.synchro.net * Telnet/SSH:2022/Rlogin/HTTP
  • From Warpslide@CAPCITY2 to Sean Dennis on Sun Aug 11 21:38:42 2024
    On 11 Aug 2024, Sean Dennis said the following...

    I'd like to tinker with getting wttr.in's output to work in an 80-character width using ANSI.

    I tried getting that to work with ANSI but didn't have much luck.

    curl -s wttr.in/?n | iconv -f utf-8 -t cp437//translit

    Kind of works but it looks like it's using ICE colours which means blinking on some terminals (e.g. mine). Also some of the character translations don't always line up.

    I recall there was someone posting these in genan awhile back in full glorious ANSI, but I haven't seem those in a long time. I'd be interested in knowing how he converted those.


    Jay

    ... (((( ((( (( ( IN STEREO WHERE AVAILABLE ) )) ))) ))))

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: Northern Realms (618:400/23)
    * Synchronet * CAPCITY2 * capcity2.synchro.net * Telnet/SSH:2022/Rlogin/HTTP
  • From Sean Dennis@CAPCITY2 to Warpslide on Mon Aug 12 00:07:06 2024
    Hello Warpslide!

    11 Aug 24 21:38, you wrote to me:

    I recall there was someone posting these in genan awhile back in full glorious ANSI, but I haven't seem those in a long time. I'd be
    interested in knowing how he converted those.

    I don't remember who it was, honrstly. It's like someone rewrote all of my doors in C but I forgot who did it and no one's said anything since.

    --Sean


    ... Work smarder and not harder and be careful of yor speling.
    --- GoldED+/LNX 1.1.5-b20240309
    * Origin: Outpost BBS * Johnson City, TN (618:618/1)
    * Synchronet * CAPCITY2 * capcity2.synchro.net * Telnet/SSH:2022/Rlogin/HTTP