<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luthfi Afriansyah</title>
    <description>The latest articles on DEV Community by Luthfi Afriansyah (@luthpai).</description>
    <link>https://dev.to/luthpai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1174465%2Fa07b694b-bf9c-4cf9-acdd-b3350bfebc24.jpeg</url>
      <title>DEV Community: Luthfi Afriansyah</title>
      <link>https://dev.to/luthpai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luthpai"/>
    <language>en</language>
    <item>
      <title>How to fetch your dev.to posts</title>
      <dc:creator>Luthfi Afriansyah</dc:creator>
      <pubDate>Sat, 14 Oct 2023 09:23:41 +0000</pubDate>
      <link>https://dev.to/luthpai/how-to-fetch-your-devto-posts-1k3i</link>
      <guid>https://dev.to/luthpai/how-to-fetch-your-devto-posts-1k3i</guid>
      <description>&lt;p&gt;Do you want to get the datas of your dev.to posts? Here's a quick tutorial :&lt;/p&gt;

&lt;p&gt;Fetch the api using Javascript built in function &lt;code&gt;fetch&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://dev.to/api/articles?username=luthpai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can apply the codes above by changing the username and change the &lt;code&gt;then(data =&amp;gt; ...)&lt;/code&gt; depend on what Javascript framework you're using.&lt;/p&gt;

</description>
      <category>blog</category>
      <category>api</category>
      <category>fetch</category>
    </item>
  </channel>
</rss>
