<?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: Sukhrob Tech</title>
    <description>The latest articles on DEV Community by Sukhrob Tech (@sukhrobtech).</description>
    <link>https://dev.to/sukhrobtech</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%2F2277431%2Fc4acec8e-1945-4cb5-b016-c9d78fef6676.JPG</url>
      <title>DEV Community: Sukhrob Tech</title>
      <link>https://dev.to/sukhrobtech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sukhrobtech"/>
    <language>en</language>
    <item>
      <title>Big O notation</title>
      <dc:creator>Sukhrob Tech</dc:creator>
      <pubDate>Sat, 26 Oct 2024 08:32:47 +0000</pubDate>
      <link>https://dev.to/sukhrobtech/big-o-notation-3nkl</link>
      <guid>https://dev.to/sukhrobtech/big-o-notation-3nkl</guid>
      <description>&lt;h3&gt;
  
  
  BU koda shunchaki test uchun
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Nimadir ..... &lt;/li&gt;
&lt;li&gt;nimader.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;olim bo'lign &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;console.log('hello world')&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const articles = fetch("&amp;lt;https://dev.to/api/articles/me&amp;gt;", {
    headers: {
      "api-key": process.env.API_KEY,
    },
}).then((res) =&amp;gt; res.json());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that you've configured your application to use the DEV.to API, let's take a look at what else you can do:&lt;/p&gt;

&lt;p&gt;Publish a new article: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the API to create a new article directly from your application, automating the publication process and allowing you to share content more efficiently.&lt;/li&gt;
&lt;li&gt;Retrieve articles from a specific user: With the API, you can get a list of articles published by a particular user. This can be useful for displaying a "recent articles" section on your website or application.&lt;/li&gt;
&lt;li&gt;List your followers: Through the API, you can get a list of users who follow you on DEV.to. This information can be used to personalize the experience of your followers in your own application.&lt;/li&gt;
&lt;li&gt;Send notifications: The API also allows you to send notifications to your followers on DEV.to. For example, you can send a notification to your followers when you publish a new article or perform some other relevant action.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>algorithms</category>
      <category>javascript</category>
      <category>dsa</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Something</title>
      <dc:creator>Sukhrob Tech</dc:creator>
      <pubDate>Sat, 26 Oct 2024 03:47:21 +0000</pubDate>
      <link>https://dev.to/sukhrobtech/something-5b1j</link>
      <guid>https://dev.to/sukhrobtech/something-5b1j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxklct6ufg40f1judnxk0.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxklct6ufg40f1judnxk0.JPG" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function getMediumPosts() {
    try {
        const response = await fetch('https://api.medium.com/v1/users/@sukhrobtech/posts', {
            headers: {
                Authorization: `Bearer 29a6e098e7413bb577279281bb650edd904329dfc1561bfc687600f4ca656609b`,
            },
        });

        if (!response.ok) {
            throw new Error(`Error: ${response.status} ${response.statusText}`);
        }

        const data = await response.json();
        return data.data; // Assuming that posts are in the `data` field of the response
    } catch (error) {
        console.error("Failed to fetch Medium posts:", error);
        return []; // Return an empty array if there's an error
    }
}

const Page = async () =&amp;gt; {
    const posts = await getMediumPosts();

    return (
        &amp;lt;div&amp;gt;
            &amp;lt;h2&amp;gt;My Medium Articles&amp;lt;/h2&amp;gt;
            &amp;lt;ul&amp;gt;
                {posts.length &amp;gt; 0 ? (
                    posts.map((post) =&amp;gt; (
                        &amp;lt;li key={post.id}&amp;gt;
                            &amp;lt;a href={post.url} target="_blank" rel="noopener noreferrer"&amp;gt;
                                {post.title}
                            &amp;lt;/a&amp;gt;
                        &amp;lt;/li&amp;gt;
                    ))
                ) : (
                    &amp;lt;li&amp;gt;No articles found.&amp;lt;/li&amp;gt;
                )}
            &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
    );
};

export default Page;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
