<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - Automation</title>
    <link>https://emresahin.net/categories/automation/</link>
    <description>Posts in the Automation category</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 15 Sep 2026 19:46:32 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/categories/automation/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>More features for my Telegram bot</title>
      <published>2024-12-13T16:52:45+00:00</published>
      <updated>2024-12-13T16:52:45+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Fri, 13 Dec 2024 16:52:45 +0000</pubDate>
      <link>https://emresahin.net/more-features-for-my-telegram-bot/</link>
      <guid isPermaLink="true">https://emresahin.net/more-features-for-my-telegram-bot/</guid>
      <description>I have a Telegram bot to save files to my zettelkasten. It’s always there, waiting for my muses to visit. Currently, it only supports text. When I send a message, the bot adds it to a new file or appends it to a file modified within the last 30 minutes, which simplifies multi-paragraph inputs. I ...</description>
      <category>Automation</category>
      <category>Development</category>
      <category>Inboxbot</category>
      <category>Xvc</category>
      <category>Telegram</category>
      <category>Mime-types</category>
      <category>Zettelkasten</category>
      <category>Bots</category>
      <content:encoded><![CDATA[<p>I have a <a href="https://github.com/iesahin/inboxbot">Telegram bot</a> to save files to my zettelkasten. It’s always there, waiting for my muses to visit.</p>
<p>Currently, it only supports text. When I send a message, the bot adds it to a new file or appends it to a file modified within the last 30 minutes, which simplifies multi-paragraph inputs.</p>
<p>I need some more features to make it more useful.</p>
<p>I want it to save audio and image files to my inbox as well. I plan to run <a href="https://github.com/iesahin/xvc">Xvc</a> pipelines on these files to convert audio notes to text and make images searchable via OCR or tagging.</p>
<p>The first step to achieve this is to understand what kind of files Telegram can upload and download. I want to track these files with Xvc to avoid bloating the Git repository. I have a script that processes these files, but currently, it only commits changes to Git. I want to determine whether a file should be tracked by Xvc or Git.</p>
<p>I skimmed the <a href="https://core.telegram.org/bots/api#sending-files">Telegram API documentation</a> and found that it supports a wide range of file types. This led me to change my approach: I will track only <code>.txt</code> and <code>.md</code> files with Git and use Xvc for everything else.</p>
<p>In the future, I plan to add a <code>--binary-only</code> option to <code>xvc file track</code> to track binary files only. This will help me to track only non-text files when using globs as targets. I might also extend this to a general predicate to decide which files to track based on their size, modification time, or other properties.</p>]]></content:encoded>
    </item>
    <item>
      <title>Regular and Recurring Tasks in todo.txt</title>
      <published>2018-02-06T10:23:22+00:00</published>
      <updated>2018-02-06T10:23:22+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Tue, 06 Feb 2018 10:23:22 +0000</pubDate>
      <link>https://emresahin.net/recurrent-todo-txt-14085-74577/</link>
      <guid isPermaLink="true">https://emresahin.net/recurrent-todo-txt-14085-74577/</guid>
      <description>I use the todo.txt format to manage some of my daily tasks. It’s a plain-text format, and both iOS and Android have apps, such as SimpleTasks . Emacs and Vim also support the format. Actually, you don’t need a special editor for it; the format is so simple that even Notepad is sufficient. I have ...</description>
      <category>Productivity</category>
      <category>Automation</category>
      <category>todo.txt</category>
      <category>zsh</category>
      <category>productivity</category>
      <category>cron</category>
      <category>linux</category>
      <content:encoded><![CDATA[<p>I use the <a href="http://todotxt.org/">todo.txt format</a> to manage some of my daily tasks. It’s a
plain-text format, and both iOS and Android have apps, such as
<a href="https://play.google.com/store/apps/details?id=nl.mpcjanssen.todotxtholo">SimpleTasks</a>. <a href="https://github.com/avillafiorita/todotxt-mode">Emacs</a> and <a href="https://github.com/freitass/todo.txt-vim">Vim</a> also support
the format. Actually, you don’t need a special editor for it; the format
is so simple that even Notepad is sufficient.</p>
<p>I have a shell script to add daily recurring tasks, such as “Drink Water” or
“Pray Maghreb,” to this file. SimpleTasks expects the file to be at
<code>$HOME/Dropbox/todo/todo.txt</code>, and I use a template file, such as <code>template.txt</code>,
to populate it. However, as anyone who has used TODO files knows, there are
always unfinished tasks; for instance, I don’t always drink my daily allotted
amount of water.</p>
<p>So, my evening script moves completed tasks (marked as DONE) to their own file,
removes recurring tasks from <code>todo.txt</code>, and repopulates them for a new day.
(Note: The code below is not usable as-is; you must define the <code>TODO</code>, <code>DONE</code>,
and <code>TEMPLATE</code> file paths correctly.)</p>
<pre><code class="language-zsh">
TODO=.../todo.txt
DONE=.../$(date +%F)-done.txt
TEMPLATE=.../template.txt

#Move Done to $DONE
grep -wE '^x ' $TODO &gt;&gt; $DONE
sed -i '/^x /d' $TODO

#Delete lines with @Evening, @Morning or @Regular tags from todo
sed -i "/\b\(@Morning|@Evening|@Regular\)\b/d" $TODO
cat $TODO_TEMPLATE &gt;&gt; $TODO
</code></pre>
<p>I have configured <code>cron</code> to run this every day at 6 PM. (My “evening” starts
earlier than my morning.)</p>]]></content:encoded>
    </item>
  </channel>
</rss>
