<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>glow.li: 2023</title>
        <description>A blog by glow.</description>
        <link>https://glow.li/tags/2023.xml</link>
        <atom:link href="https://glow.li/tags/2023.xml" rel="self" type="application/rss+xml"/>
        <generator>Glow.li Builder</generator>
            <item>
        <title>pkmn.li: Pokémon sprites in your terminal</title>
        <description>&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li" src="https://pkmn.li/gen5/"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;I converted all Pokémon sprites to ANSI, so you can view them in you terminal (or browser).&lt;/p&gt;
&lt;h3 id="Get+a+random+Pok%C3%A9mon+in+your+terminal" name="Get+a+random+Pok%C3%A9mon+in+your+terminal"&gt;&lt;a class="hash-link" href="#Get+a+random+Pok%C3%A9mon+in+your+terminal"&gt;Get a random Pokémon in your terminal&lt;/a&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also view it in the browser: &lt;a href="https://pkmn.li"&gt;pkmn.li&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will need &lt;a href="https://github.com/termstandard/colors#fully-supporting"&gt;true color support&lt;/a&gt; in your terminal.&lt;/p&gt;
&lt;!--more--&gt;
&lt;div id="toc"&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Get+a+random+Pok%C3%A9mon+in+your+terminal"&gt;Get a random Pokémon in your terminal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#Get+a+specific+Pok%C3%A9mon"&gt;Get a specific Pokémon&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#Get+a+random+Pok%C3%A9mon+from+a+specific+generation"&gt;Get a random Pokémon from a specific generation&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#gen1"&gt;gen1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gen2"&gt;gen2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gen3"&gt;gen3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gen4"&gt;gen4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gen5"&gt;gen5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gen6"&gt;gen6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gen7"&gt;gen7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#icons"&gt;icons&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#Other+languages"&gt;Other languages&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#The+following+languages+are+available"&gt;The following languages are available&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#Data"&gt;Data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#Creating+ANSI+from+the+sprites"&gt;Creating ANSI from the sprites&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
&lt;h3 id="Get+a+specific+Pok%C3%A9mon" name="Get+a+specific+Pok%C3%A9mon"&gt;&lt;a class="hash-link" href="#Get+a+specific+Pok%C3%A9mon"&gt;Get a specific Pokémon&lt;/a&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/25/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/25/"&gt;https://pkmn.li/25/&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="Get+a+random+Pok%C3%A9mon+from+a+specific+generation" name="Get+a+random+Pok%C3%A9mon+from+a+specific+generation"&gt;&lt;a class="hash-link" href="#Get+a+random+Pok%C3%A9mon+from+a+specific+generation"&gt;Get a random Pokémon from a specific generation&lt;/a&gt;&lt;/h4&gt;
&lt;h5 id="gen1" name="gen1"&gt;&lt;a class="hash-link" href="#gen1"&gt;gen1&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen1/" src="https://pkmn.li/gen1/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen1/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen1/"&gt;https://pkmn.li/gen1/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="gen2" name="gen2"&gt;&lt;a class="hash-link" href="#gen2"&gt;gen2&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen2/" src="https://pkmn.li/gen2/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen2/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen2/"&gt;https://pkmn.li/gen2/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="gen3" name="gen3"&gt;&lt;a class="hash-link" href="#gen3"&gt;gen3&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen3/" src="https://pkmn.li/gen3/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen3/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen3/"&gt;https://pkmn.li/gen3/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="gen4" name="gen4"&gt;&lt;a class="hash-link" href="#gen4"&gt;gen4&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen4/" src="https://pkmn.li/gen4/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen4/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen4/"&gt;https://pkmn.li/gen4/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="gen5" name="gen5"&gt;&lt;a class="hash-link" href="#gen5"&gt;gen5&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen5/" src="https://pkmn.li/gen5/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen5/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen5/"&gt;https://pkmn.li/gen5/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="gen6" name="gen6"&gt;&lt;a class="hash-link" href="#gen6"&gt;gen6&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen6/" src="https://pkmn.li/gen6/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen6/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen6/"&gt;https://pkmn.li/gen6/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="gen7" name="gen7"&gt;&lt;a class="hash-link" href="#gen7"&gt;gen7&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/gen7/" src="https://pkmn.li/gen7/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/gen7/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/gen7/"&gt;https://pkmn.li/gen7/&lt;/a&gt;&lt;/p&gt;
&lt;h5 id="icons" name="icons"&gt;&lt;a class="hash-link" href="#icons"&gt;icons&lt;/a&gt;&lt;/h5&gt;
&lt;div class="iframe-wrapper ratio-square"&gt;
    &lt;iframe title="https://pkmn.li/icons/" src="https://pkmn.li/icons/25"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/icons/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://pkmn.li/icons/"&gt;https://pkmn.li/icons/&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="Other+languages" name="Other+languages"&gt;&lt;a class="hash-link" href="#Other+languages"&gt;Other languages&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If you want to have the names and flavor text in another language you can use the &lt;code&gt;lang&lt;/code&gt; parameter.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl pkmn.li/?lang=de
curl pkmn.li/25/?lang=es&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pkmn.li/?lang=de"&gt;pkmn.li/?lang=de&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pkmn.li/25/?lang=es"&gt;pkmn.li/25/?lang=es&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="The+following+languages+are+available" name="The+following+languages+are+available"&gt;&lt;a class="hash-link" href="#The+following+languages+are+available"&gt;The following languages are available&lt;/a&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ja-Hrkt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;roomaji&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ko&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;zh-Hant&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fr&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;de&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;es&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;it&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;en&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ja&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;zh-Hans&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pt-BR&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="Data" name="Data"&gt;&lt;a class="hash-link" href="#Data"&gt;Data&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I am using the &lt;a href="https://github.com/PokeAPI/sprites"&gt;PokeAPI sprites&lt;/a&gt; for the images and the &lt;a href="https://github.com/PokeAPI/api-data"&gt;PokeAPI api-data&lt;/a&gt; for the flavor text (Pokédex entries). I am generating all Pokémon from the static data in the repositories. I am not actually using the PokeAPI.&lt;/p&gt;
&lt;h3 id="Creating+ANSI+from+the+sprites" name="Creating+ANSI+from+the+sprites"&gt;&lt;a class="hash-link" href="#Creating+ANSI+from+the+sprites"&gt;Creating ANSI from the sprites&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To create the ANSI from the sprites I am using the Rust program &lt;a href="https://github.com/atanunq/viu"&gt;viu&lt;/a&gt;.
Generating html from ANSI is actually rather difficult. Unlike with &lt;a href="https://glow.li/posts/aare.li/"&gt;aare.li&lt;/a&gt;, where I am using &lt;a href="https://github.com/neilime/ansi-escapes-to-html"&gt;ansi-escape-to-html&lt;/a&gt; directly in the PHP script, this doesn't work with the Pokémon sprites as they are true color (24 million colors). I haven't found a php package that supports true color ANSI. But the Python package &lt;a href="https://github.com/pycontribs/ansi2html"&gt;ansi2html&lt;/a&gt; does, so I am using that.&lt;/p&gt;</description>
    <pubDate>Thu, 25 May 2023 00:00:00 +0000</pubDate>
    <link>https://glow.li/posts/pkmn/</link>
    <guid isPermaLink="false">1684972800</guid>
</item>

    </channel>
</rss>

