57 lines
5.2 KiB
Plaintext
57 lines
5.2 KiB
Plaintext
|
|
Episode: 2854
|
||
|
|
Title: HPR2854: Telling myself something In The Morning
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr2854/hpr2854.mp3
|
||
|
|
Transcribed: 2025-10-24 12:11:34
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
This is HPR Episode 2854 entitled, telling myself something in the morning, and in part of the series, programming 101, it is hosted by Genre, and in about 6 minutes long, and carrying a clean flag.
|
||
|
|
The summary is, now I want a need for some software, so I wrote some.
|
||
|
|
This episode of HPR is brought to you by archive.org.
|
||
|
|
Support universal access to all knowledge, by heading over to archive.org, forward slash, donate.
|
||
|
|
Time Zone appropriate greetings to you all, HPR listeners. My name is Jezrepp, and I'm going to tell you a tale about a little project I call, in the morning.
|
||
|
|
Like most projects, this project exists because it fills a need, specifically a need that I had.
|
||
|
|
While out walking about, I had the need to take notes. However, there was no pen in my pocket, nor was there paper upon which to write.
|
||
|
|
What I did have was my cell phone, which for the most part is a pocket computer.
|
||
|
|
Now, it would have been easy enough for me to open the terminal, and fire up nano, and write notes in the terminal on my pocket computer.
|
||
|
|
But that didn't quite do what I wanted to have done. What I was really looking for was a way to tell myself something in the morning, hence the name of this project.
|
||
|
|
The requirements were fairly simple. The project interface needs to be accessible over my home network, from any device I may have in my pocket, or from my laptop computer.
|
||
|
|
Ideally, the output of what I am told in the morning should be sent to my pocket computer, and it most certainly is. Here's how that happened.
|
||
|
|
For the most part, in the morning is a very simple to do list application. Access the interface, type in a string, hit enter, and it's added to the list of things to do.
|
||
|
|
In order to make a server that can handle input requests, I used the Python programming language, and the bottle web framework, which is incredibly lightweight, single file, works in both Python and Python 2.
|
||
|
|
For the UI, I used basic HTML5, incredibly simple JavaScript, and some very simple CSS. The idea for all of it was to write the least amount of code because I'm lazy, and to do it in a simple way.
|
||
|
|
Just get the job done. The web server has multiple endpoints. There's the index that will load the user interface,
|
||
|
|
add, which adds an item, there's remove, which will remove an item, and process, which will run a command on every single item that the user has entered.
|
||
|
|
So when the user enters Hello World, and then something hits the process API endpoint, then whatever is configured as the command to run will run with Hello World as an argument.
|
||
|
|
The code for all of this is on GitLab, and I will provide a link in the show notes, although that will probably be the only thing in the show notes, because yeah, like I said, I'm lazy.
|
||
|
|
The server itself has only two configuration options, port, which is the port upon which one would serve, and command.
|
||
|
|
The command represents the shell command that will be used to process the items in the list.
|
||
|
|
In my configuration, the command is set to a shell script that I wrote called TextJesera, and what that script does in the end result is it sends a text message to me.
|
||
|
|
The full setup is like this.
|
||
|
|
On a small utility server at my place, I am running in the morning server.
|
||
|
|
In the evening, or any other time of the day, really.
|
||
|
|
At any time of the day, I may be out and about doing stuff, and I think, oh, I should tell myself something in the morning.
|
||
|
|
So I pull my phone out of my pocket. Unlock, click on the in the morning shortcut that just so happens to be on my phone's desktop.
|
||
|
|
That opens up Firefox, which has a bookmark to the running server on my home network.
|
||
|
|
I enter my text, record HR episode, and then I hit submit.
|
||
|
|
Then, some time passes. Oh, hold on, time has to pass.
|
||
|
|
Good Lord, that time didn't pass past enough.
|
||
|
|
All right, picture if you will. It is now 7.45 in the AM.
|
||
|
|
A Krontask on the utility server that is running the in the morning project sends an API request to process.
|
||
|
|
The items in the list of which there is only one that says record HR episode gets processed.
|
||
|
|
That gets run through the command that I've configured text Jezra with record HR episode.
|
||
|
|
And the next thing you know, 7.45 in the morning, I'm getting a text message on my phone that says record HR episode.
|
||
|
|
And what do you know? I've just recorded an HR episode.
|
||
|
|
Proving that the software works as intended.
|
||
|
|
Thanks for listening and time zone appropriate. Farewell to you.
|
||
|
|
You've been listening to Hacker Public Radio at Hacker Public Radio dot org.
|
||
|
|
We are a community podcast network that releases shows every weekday Monday through Friday.
|
||
|
|
Today's show, like all our shows, was contributed by an HPR listener like yourself.
|
||
|
|
If you ever thought of recording a podcast, then click on our contribute link to find out how easy it really is.
|
||
|
|
Hacker Public Radio was founded by the digital dog pound and the Infonomicon Computer Club.
|
||
|
|
And it's part of the binary revolution at binrev.com.
|
||
|
|
If you have comments on today's show, please email the host directly.
|
||
|
|
Leave a comment on the website or record a follow-up episode yourself.
|
||
|
|
Unless otherwise stated, today's show is released on the creative comments,
|
||
|
|
attribution, share a like, 3.0 license.
|