mirror of
https://github.com/tonytins/PublishTimes.git
synced 2025-03-14 20:01:20 +00:00
Wrote a Exporting section in README
- Placeholder if no topic is selected
This commit is contained in:
parent
fa5a5b1b2e
commit
7c61c51ac2
2 changed files with 14 additions and 11 deletions
17
Program.cs
17
Program.cs
|
@ -97,29 +97,24 @@ string SelectTopics(List<string> topics)
|
|||
if (int.TryParse(input, out topicNum) == true)
|
||||
topicChoice = topicDict[topicNum];
|
||||
else
|
||||
NewTopic(topics, false);
|
||||
NewTopic(topics);
|
||||
|
||||
return topicChoice;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selects a new topic either by prompting the user or randomly choosing one from the list.
|
||||
/// Allows the user to choose a new topic from a given list or default to placeholder if no selection is made.
|
||||
/// </summary>
|
||||
/// <param name="topics">A list of available topics.</param>
|
||||
/// <param name="retry">Indicates whether to prompt the user again if no selection was made.</param>
|
||||
/// <returns>The selected topic as a string.</returns>
|
||||
string NewTopic(List<string> topics, bool retry = false)
|
||||
/// <returns>The selected topic or a default placeholder if none is chosen.</returns>
|
||||
string NewTopic(List<string> topics)
|
||||
{
|
||||
var newTopic = "";
|
||||
|
||||
if (UserChoice("Choose a Topic?") || retry)
|
||||
if (UserChoice("Choose a Topic?"))
|
||||
newTopic = SelectTopics(topics);
|
||||
else
|
||||
{
|
||||
var rng = new Random();
|
||||
var chooseTopic = rng.Next(0, topics.ToArray().Length);
|
||||
newTopic = topics[chooseTopic].Trim();
|
||||
}
|
||||
newTopic = "===";
|
||||
|
||||
return newTopic;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,14 @@
|
|||
|
||||
This is a very simple console application that generates a list of times to publish news articles within a randomized 2-3 hour delay while avoiding time conflicts within a 30-minute window.
|
||||
|
||||
## Exporting
|
||||
|
||||
Once it generates a list of times, you can retry or export the times. If you export, you're requested to select from a number of topics or default to none if no selection is made. Upon export, you can start over or exit.
|
||||
|
||||
Choice selection is based on the Y/N keys. ``Enter`` works the same as ``Y`` while pressing any other key is the equivalent of ``N``. You can make mistakes, but it expects failure.
|
||||
|
||||
An optional ``config.toml`` file allows for further customization of file name, directory, and topics.
|
||||
|
||||
## Background
|
||||
|
||||
A while back, I [found a tool](https://schedule.lemmings.world) to schedule articles on Lemmy. I've been posting within a few hours apart at random minutes and I wanted to something decide that for me. I had AI write the base algorithm, everything else is my own touches.
|
||||
|
|
Loading…
Add table
Reference in a new issue