<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>fun &amp;mdash; Jeko</title>
    <link>https://write.as/jeko/tag:fun</link>
    <description>Crafting happiness with Free Software &amp; Hardware</description>
    <pubDate>Mon, 31 Aug 2026 01:12:43 +0000</pubDate>
    <item>
      <title>Send an SMS with Guile and Twilio API</title>
      <link>https://write.as/jeko/send-an-sms-with-guile-and-twilio-api?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Guile Logo&#xA;&#xA;These last days, I tried to send an SMS with a Guile script.&#xA;TL;DR: I succeeded!&#xA;!--more--&#xA;Since the code is just a simple HTTP POST request, the longest part should have been the creation of the Twilio account (with a Regulatory Bundle and a phone number).&#xA;&#xA;But in the end, it took me about one evening[1] to set up a development environment with the right dependencies, and then two more evenings to figure out which HTTP headers were needed.&#xA;&#xA;Anyway, here is the script:&#xA;(use-modules (web client)&#xA;             (web http)&#xA;             (ice-9 receive)&#xA;             (ice-9 iconv)&#xA;             (gcrypt base64))&#xA;&#xA;(define TWILIOACCOUNTSID &#34;your-account-sid&#34;)&#xA;(define TWILIOACCOUNTTOKEN &#34;your-account-token&#34;)&#xA;(define TWILIOPHONENUMBER &#34;your-twilio-phone-number&#34;)&#xA;&#xA;(define TWILIOCREDENTIALS&#xA;  (base64-encode&#xA;   (string-  bytevector&#xA;    (simple-format #f &#34;~A:~A&#34; TWILIOACCOUNTSID TWILIOACCOUNTTOKEN) &#34;utf-8&#34;))&#xA;&#xA;(define RECIPIENTPHONENUMBER &#34;a-phone-number&#34;)&#xA;(define TEXTMESSAGE &#34;Wish you so much happyness !&#34;)&#xA;&#xA;(http-post&#xA; (simple-format&#xA;  #f &#xA;  &#34;https://api.twilio.com/2010-04-01/Accounts/~A/Messages&#34;&#xA;  TWILIOACCOUNTSID)&#xA; #:headers `((content-type . (application/x-www-form-urlencoded (charset . &#34;utf-8&#34;))&#xA;             (authorization . (basic . ,TWILIOCREDENTIALS)))&#xA; #:body (simple-format #f &#34;Body=~A&amp;To=~A&amp;From=~A&#34;&#xA;                       TEXTMESSAGE&#xA;                       RECIPIENTPHONENUMBER&#xA;                       TWILIOPHONENUMBER))&#xA;And how to execute it : &#xA;$ guix shell guile gnutls guile-gcrypt -- guile my-first-app.scm&#xA;&#xA;All phone numbers must start with the country indicator. For example +33 for a French number.&#xA;&#xA;[1] the time unit of my Guile tinkering&#xA;&#xA;Thank you very much for reading this article!&#xA;&#xA;Don&#39;t hesitate to give me your opinion, suggest an idea for improvement, or ask a question! To do so : contact me.&#xA;&#xA;Don&#39;t miss out on the next ones...&#xA;&#xA;articles via Mastodon @jeko@write.as and RSS&#xA;screencasts via Peertube jeko@video.tedomum.net and RSS&#xA;&#xA;And more importantly, share this blog and tell your friends it&#39;s the best blog in the history of Free Software! No kidding!&#xA;&#xA;#fun #guile #english]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/GNU-Guile-logo.svg/220px-GNU-Guile-logo.svg.png" alt="Guile Logo"/></p>

<p>These last days, I tried to send an SMS with a Guile script.
TL;DR: I succeeded!

Since the code is just a simple HTTP POST request, the longest part should have been the creation of the Twilio account (with a Regulatory Bundle and a phone number).</p>

<p>But in the end, it took me about one evening[1] to set up a development environment with the right dependencies, and then two more evenings to figure out which HTTP headers were needed.</p>

<p>Anyway, here is the script:</p>

<pre><code class="language-scheme">(use-modules (web client)
             (web http)
             (ice-9 receive)
             (ice-9 iconv)
             (gcrypt base64))

(define TWILIO_ACCOUNT_SID &#34;your-account-sid&#34;)
(define TWILIO_ACCOUNT_TOKEN &#34;your-account-token&#34;)
(define TWILIO_PHONE_NUMBER &#34;your-twilio-phone-number&#34;)

(define TWILIO_CREDENTIALS
  (base64-encode
   (string-&gt;bytevector
    (simple-format #f &#34;~A:~A&#34; TWILIO_ACCOUNT_SID TWILIO_ACCOUNT_TOKEN) &#34;utf-8&#34;))

(define RECIPIENT_PHONE_NUMBER &#34;a-phone-number&#34;)
(define TEXT_MESSAGE &#34;Wish you so much happyness !&#34;)

(http-post
 (simple-format
  #f 
  &#34;https://api.twilio.com/2010-04-01/Accounts/~A/Messages&#34;
  TWILIO_ACCOUNT_SID)
 #:headers `((content-type . (application/x-www-form-urlencoded (charset . &#34;utf-8&#34;))
             (authorization . (basic . ,TWILIO_CREDENTIALS)))
 #:body (simple-format #f &#34;Body=~A&amp;To=~A&amp;From=~A&#34;
                       TEXT_MESSAGE
                       RECIPIENT_PHONE_NUMBER
                       TWILIO_PHONE_NUMBER))
</code></pre>

<p>And how to execute it :</p>

<pre><code class="language-bash">$ guix shell guile gnutls guile-gcrypt -- guile my-first-app.scm
</code></pre>

<p>All phone numbers must start with the country indicator. For example +33 for a French number.</p>

<p>[1] the time unit of my Guile tinkering</p>

<p><em>Thank you very much for reading this article!</em></p>

<p><em>Don&#39;t hesitate to give me your opinion, suggest an idea for improvement, or ask a question! To do so : <a href="https://linktr.ee/jeko" rel="nofollow">contact me</a>.</em></p>

<p><em>Don&#39;t miss out on the next ones...</em></p>
<ol><li><em>articles via Mastodon <a href="https://write.as/@/jeko@write.as" rel="nofollow"><a href="/@/jeko@write.as" class="u-url mention" rel="nofollow">@<span>jeko@write.as</span></a></a> and <a href="https://rednosehacker.com/feed/" rel="nofollow">RSS</a></em></li>
<li><em>screencasts via Peertube <a href="https://write.as/@/jeko@write.as" rel="nofollow">jeko@video.tedomum.net</a> and <a href="https://video.tedomum.net/feeds/videos.xml?accountId=17488" rel="nofollow">RSS</a></em></li></ol>

<p><em>And more importantly, share this blog and tell your friends it&#39;s the best blog in the history of Free Software! No kidding!</em></p>

<p><a href="https://write.as/jeko/tag:fun" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">fun</span></a> <a href="https://write.as/jeko/tag:guile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guile</span></a> <a href="https://write.as/jeko/tag:english" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">english</span></a></p>
]]></content:encoded>
      <guid>https://write.as/jeko/send-an-sms-with-guile-and-twilio-api</guid>
      <pubDate>Sun, 12 Dec 2021 20:44:51 +0000</pubDate>
    </item>
    <item>
      <title>Envoyer un SMS avec Guile et l&#39;API de Twilio</title>
      <link>https://write.as/jeko/envoyer-un-sms-avec-guile-et-lapi-de-twilio?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Guile Logo&#xA;&#xA;Ces derniers jours, je me suis mis en tête d&#39;essayer d&#39;envoyer un SMS avec un script Guile.&#xA;TL;DR : J&#39;ai réussi !&#xA;!--more--&#xA;Étant donné que le code se résume à une simple requête HTTP de type POST, le plus long aurait dû être la création du compte Twilio (avec un Regulatory Bundle et un numéro de téléphone).&#xA;&#xA;Mais finalement, j&#39;ai mis environ une soirée[1] à mettre en place un environnement de développement avec les dépendances qui vont bien, puis deux autres soirées à cerner quelles en-têtes HTTP étaient nécessaires.&#xA;&#xA;Bref, voici le script :&#xA;&#xA;$ guix shell guile gnutls guile-gcrypt&#xA;&#xA;Le script&#xA;&#xA;(use-modules (web client)&#xA;             (web http)&#xA;             (ice-9 receive)&#xA;             (ice-9 iconv)&#xA;             (gcrypt base64))&#xA;&#xA;(define TWILIOACCOUNTSID &#34;your-account-sid&#34;)&#xA;(define TWILIOACCOUNTTOKEN &#34;your-account-token&#34;)&#xA;(define TWILIOPHONENUMBER &#34;your-twilio-phone-number&#34;)&#xA;&#xA;(define TWILIOCREDENTIALS&#xA;  (base64-encode&#xA;   (string-  bytevector&#xA;    (simple-format #f &#34;~A:~A&#34; TWILIOACCOUNTSID TWILIOACCOUNTTOKEN) &#34;utf-8&#34;)))&#xA;&#xA;(define RECIPIENTPHONENUMBER &#34;a-phone-number&#34;)&#xA;(define TEXTMESSAGE &#34;Wish you so much happyness !&#34;)&#xA;&#xA;(http-post&#xA; (simple-format&#xA;  #f &#xA;  &#34;https://api.twilio.com/2010-04-01/Accounts/~A/Messages&#34;&#xA;  TWILIOACCOUNTSID)&#xA; #:headers `((content-type . (application/x-www-form-urlencoded (charset . &#34;utf-8&#34;)))&#xA;             (authorization . (basic . ,TWILIOCREDENTIALS)))&#xA; #:body (simple-format #f &#34;Body=~A&amp;To=~A&amp;From=~A&#34;&#xA;                       TEXTMESSAGE&#xA;                       RECIPIENTPHONENUMBER&#xA;                       TWILIOPHONENUMBER))&#xA;Et comment l&#39;executer : &#xA;$ guix shell guile gnutls guile-gcrypt -- guile my-first-app.scm&#xA;&#xA;Tous les numéros de téléphone doivent commencer par l&#39;indicateur de pays. Par exemple +33 pour un numéro français.&#xA;&#xA;[1] l’unité de temps de mes bidouillages avec Guile&#xA;&#xA;Merci beaucoup d&#39;avoir lu cet article !&#xA;&#xA;N&#39;hésite pas à me contacter pour me donner ton avis, proposer une idée d&#39;amélioration, ou poser une question !&#xA;&#xA;Abonnes-toi pour ne pas manquer les prochains : &#xA;&#xA;articles via Mastodon @jeko@write.as et RSS&#xA;screencasts via Peertube jeko@video.tedomum.net et RSS&#xA;&#xA;Et encore plus important, partages ce blog et dis à tes amis que c&#39;est le meilleur blog de l&#39;histoire du logiciel libre ! Sans dec&#39;&#xA;&#xA;#fun #guile #français]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/GNU-Guile-logo.svg/220px-GNU-Guile-logo.svg.png" alt="Guile Logo"/></p>

<p>Ces derniers jours, je me suis mis en tête d&#39;essayer d&#39;envoyer un SMS avec un script Guile.
TL;DR : J&#39;ai réussi !

Étant donné que le code se résume à une simple requête HTTP de type POST, le plus long aurait dû être la création du compte Twilio (avec un Regulatory Bundle et un numéro de téléphone).</p>

<p>Mais finalement, j&#39;ai mis environ une soirée[1] à mettre en place un environnement de développement avec les dépendances qui vont bien, puis deux autres soirées à cerner quelles en-têtes HTTP étaient nécessaires.</p>

<p>Bref, voici le script :</p>

<pre><code class="language-bash">$ guix shell guile gnutls guile-gcrypt
</code></pre>

<h2 id="le-script">Le script</h2>

<pre><code class="language-scheme">(use-modules (web client)
             (web http)
             (ice-9 receive)
             (ice-9 iconv)
             (gcrypt base64))

(define TWILIO_ACCOUNT_SID &#34;your-account-sid&#34;)
(define TWILIO_ACCOUNT_TOKEN &#34;your-account-token&#34;)
(define TWILIO_PHONE_NUMBER &#34;your-twilio-phone-number&#34;)

(define TWILIO_CREDENTIALS
  (base64-encode
   (string-&gt;bytevector
    (simple-format #f &#34;~A:~A&#34; TWILIO_ACCOUNT_SID TWILIO_ACCOUNT_TOKEN) &#34;utf-8&#34;)))

(define RECIPIENT_PHONE_NUMBER &#34;a-phone-number&#34;)
(define TEXT_MESSAGE &#34;Wish you so much happyness !&#34;)

(http-post
 (simple-format
  #f 
  &#34;https://api.twilio.com/2010-04-01/Accounts/~A/Messages&#34;
  TWILIO_ACCOUNT_SID)
 #:headers `((content-type . (application/x-www-form-urlencoded (charset . &#34;utf-8&#34;)))
             (authorization . (basic . ,TWILIO_CREDENTIALS)))
 #:body (simple-format #f &#34;Body=~A&amp;To=~A&amp;From=~A&#34;
                       TEXT_MESSAGE
                       RECIPIENT_PHONE_NUMBER
                       TWILIO_PHONE_NUMBER))
</code></pre>

<p>Et comment l&#39;executer :</p>

<pre><code class="language-bash">$ guix shell guile gnutls guile-gcrypt -- guile my-first-app.scm
</code></pre>

<p>Tous les numéros de téléphone doivent commencer par l&#39;indicateur de pays. Par exemple +33 pour un numéro français.</p>

<p>[1] l’unité de temps de mes bidouillages avec Guile</p>

<p><em>Merci beaucoup d&#39;avoir lu cet article !</em></p>

<p><em>N&#39;hésite pas à <a href="https://linktr.ee/jeko" rel="nofollow">me contacter</a> pour me donner ton avis, proposer une idée d&#39;amélioration, ou poser une question !</em></p>

<p><em>Abonnes-toi pour ne pas manquer les prochains :</em></p>
<ol><li><em>articles via Mastodon <a href="/@/jeko@write.as" class="u-url mention" rel="nofollow">@<span>jeko@write.as</span></a> et <a href="https://rednosehacker.com/feed/" rel="nofollow">RSS</a></em></li>
<li><em>screencasts via Peertube jeko@video.tedomum.net et <a href="https://video.tedomum.net/feeds/videos.xml?accountId=17488" rel="nofollow">RSS</a></em></li></ol>

<p><em>Et encore plus important, partages ce blog et dis à tes amis que c&#39;est le meilleur blog de l&#39;histoire du logiciel libre ! Sans dec&#39;</em></p>

<p><a href="https://write.as/jeko/tag:fun" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">fun</span></a> <a href="https://write.as/jeko/tag:guile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guile</span></a> <a href="https://write.as/jeko/tag:fran%C3%A7ais" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">français</span></a></p>
]]></content:encoded>
      <guid>https://write.as/jeko/envoyer-un-sms-avec-guile-et-lapi-de-twilio</guid>
      <pubDate>Sun, 12 Dec 2021 19:37:27 +0000</pubDate>
    </item>
  </channel>
</rss>