<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Martin Mwangi on Medium]]></title>
        <description><![CDATA[Stories by Martin Mwangi on Medium]]></description>
        <link>https://medium.com/@martwebber?source=rss-858ae2e7874f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NM5FxA8kdJ1gA1tC</url>
            <title>Stories by Martin Mwangi on Medium</title>
            <link>https://medium.com/@martwebber?source=rss-858ae2e7874f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:11:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@martwebber/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Software Engineering at Moringa School: Phase 1 project]]></title>
            <link>https://medium.com/@martwebber/software-engineering-at-moringa-school-phase-1-project-47fc812726de?source=rss-858ae2e7874f------2</link>
            <guid isPermaLink="false">https://medium.com/p/47fc812726de</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[moringaschool]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[fetch-api]]></category>
            <dc:creator><![CDATA[Martin Mwangi]]></dc:creator>
            <pubDate>Fri, 24 Jun 2022 16:55:14 GMT</pubDate>
            <atom:updated>2022-06-24T16:55:14.510Z</atom:updated>
            <content:encoded><![CDATA[<p>The last couple of weeks have been hectic to say the least but I am glad to be part of <a href="https://moringaschool.com/">Moringa School</a> and I believe this is the beginning of something truly magnificent. As phase 1 comes to a close, I can proudly say that I am a step to my dream job as a software engineer. I got to learn and work with HTML,CSS, and JavaScript. I cannot wait to see what phase two has in store for me…</p><p>In my phase 1 project, I worked on a web app that allows users to search for information about their favourite movies/TV shows which is fetched from <a href="http://omdbapi.com/">Open Movie Database</a> and displays the results if the response is not empty. If the movie/tv show is not found in the <a href="http://omdbapi.com/">Open Movie Database</a>, an alert is displayed to tell the user that it is not available. The search form has two input fields, one for the title/IMDB id and another one for date which is an optional field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IbwmWQBwh6YyY9N5" /></figure><h3>Using the Fetch API</h3><p>In the project, I used Fetch API which provides an interface for accessing and manipulating resources. The fetch() method takes one mandatory argument, the path to the resource you want to fetch which in my case is <a href="https://omdbapi.com/searchType=movieInput&amp;y=year&amp;apikey=apikey">https://omdbapi.com/?searchType=movieInput&amp;y=year&amp;apikey=apikey</a>.</p><p>I used template literals to be able to pass variables(movie/tv show name or imdb id and year of release which is optional). Here is an example</p><pre>`https://omdbapi.com/?${searchBy}=${movieInput}&amp;y=${year}&amp;apiKey=${apiKey}`</pre><p>After the request is sent, a promise object is returned with contains a representation of the entire HTTP response. To get the data, json() method is used to parse the response body text into JSON format. The .json() method returns a second promise object which is then passed to another function which adds the data to the DOM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*7bIE7cWKvues7Dhq" /></figure><p>After the data is added to the DOM, the user is able to see the results of the search as shown in the screenshots below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRwUsFhKU8RVqAmrwdK5xw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xw8YSZDRdXpORM4V_grOoA.png" /></figure><p>You can access the project on my github repo <a href="https://github.com/martwebber/phase-1-final-project">here</a> or checkout the live version on <a href="http://martwebber.github.io/phase-1-final-project/">github pages</a>. Give it a try and share your feedback.</p><p>To learn more about Fetch API, visit:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch">https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch</a></li></ul><p>Checkout OMDB api: <a href="http://www.omdbapi.com/">http://www.omdbapi.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47fc812726de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>