<?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 Rwand on Medium]]></title>
        <description><![CDATA[Stories by Rwand on Medium]]></description>
        <link>https://medium.com/@rwand?source=rss-fc0909112e8d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-HQHzElIQHyozl_S.jpg</url>
            <title>Stories by Rwand on Medium</title>
            <link>https://medium.com/@rwand?source=rss-fc0909112e8d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 06:26:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rwand/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[Infinite Scroll using React Query in React Native]]></title>
            <link>https://medium.com/@rwand/infinite-scroll-using-react-query-in-react-native-3db1eade31b0?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3db1eade31b0</guid>
            <category><![CDATA[react-native-app]]></category>
            <category><![CDATA[infinite-scroll]]></category>
            <category><![CDATA[react-query]]></category>
            <category><![CDATA[pagination]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 00:13:30 GMT</pubDate>
            <atom:updated>2025-01-08T00:13:30.277Z</atom:updated>
            <content:encoded><![CDATA[<p>Pagination in mobile apps is popular using Infinite Scroll because it is easier than clicking pagination numbers like we do on websites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JkVuX6UvxClYx6ap" /><figcaption>Photo by <a href="https://unsplash.com/@lautaroandreani?utm_source=medium&amp;utm_medium=referral">Lautaro Andreani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here we go!!!</p><ol><li>Look at your backend response. This an example response from the backend</li></ol><pre>// e.g. page 1<br>{<br>    &quot;data&quot;: [<br>        {<br>            &quot;id&quot;: 1,<br>            &quot;name&quot;: &quot;Jhoni&quot;<br>        }<br>    ],<br>    &quot;count&quot;: 16,<br>    &quot;next&quot;: &quot;http://example.com/transactions?page=1&quot;,<br>    &quot;previous&quot;: null,<br>}<br><br>// e.g. last page<br>{<br>    &quot;data&quot;: [<br>        {<br>            &quot;id&quot;: 1,<br>            &quot;name&quot;: &quot;Jhoni&quot;<br>        }<br>    ],<br>    &quot;count&quot;: 16,<br>    &quot;next&quot;: null,<br>    &quot;previous&quot;: &quot;http://example.com/transactions?page=1&quot;,<br>}</pre><p>2. Create useGetTransactionHistory hooks for fetching transaction history</p><pre>// src/scenes/TransactionHistoryList/hooks/useGetTransactionHistory.ts<br><br>function buildResponseData(data: InfiniteData&lt;ITransactionHistoryResponse&gt; | undefined) {<br>    if (!data?.pages) {<br>        return [];<br>    }<br>    return data?.pages.reduce&lt;TransactionHistoryModel[]&gt;((acc, page) =&gt; {<br>        return page.data ? [...acc, ...page.data] : acc;<br>    }, []);<br>}<br><br>export function useGetTransactionHistory() {<br>    const { data, ...result } = useInfiniteQuery({<br>        queryKey: [&#39;transaction-history&#39;],<br>        queryFn: ({pageParam}) =&gt; get&lt;ITransactionHistoryResponse&gt;(pageParam),<br>        initialPageParam: `${BASE_URL}/transactions?page=1`,<br>        initialData: undefined,<br>        getNextPageParam: (lastPage) =&gt; {<br>            const page = lastPage?.next?.split(&#39;=&#39;)?.[1]; // get next page, e.g. 1, 2 or null when reach last page<br>            return page ? `${BASE_URL}/transactions/?page=${page}` : undefined;<br>        },<br>    });<br><br>    const mergedData = useMemo(() =&gt; buildResponseData(data), [data]);<br><br>    return {<br>        data: mergedData,<br>        next: data?.pages?.[data?.pages?.length - 1]?.next,<br>        previous: data?.pages?.[data?.pages?.length - 1]?.previous,<br>        count: data?.pages?.[data?.pages?.length - 1]?.count,<br>        pageParams: data?.pageParams,<br>        ...result,<br>    };<br>}</pre><p>There are two important things here</p><ol><li>How to getNextPageParam, the different response types will be different handling to get next page param</li><li>Merge data from all pages into one array, when using useInfiniteQuery the response will included in `data.pages: TData[]` Array containing all pages. So, we need to merge all data using function `buildResponseData`.</li></ol><p>See here <a href="https://tanstack.com/query/v5/docs/framework/react/reference/useInfiniteQuery">https://tanstack.com/query/v5/docs/framework/react/reference/useInfiniteQuery</a></p><p>The object from `data` will be</p><pre>{<br>    data: {<br>        pages: [<br>            {<br>                &quot;data&quot;: [...],<br>                &quot;count&quot;: 16,<br>                &quot;next&quot;: &quot;http://example.com/transactions?page=1&quot;,<br>                &quot;previous&quot;: null,<br>            },<br>            {<br>                &quot;data&quot;: [...],<br>                &quot;count&quot;: 16,<br>                &quot;next&quot;: &quot;http://example.com/transactions?page=2&quot;,<br>                &quot;previous&quot;: null,<br>            },<br>            ...<br>        ]<br>    }<br>}</pre><p>3. Create hooks useTransactionHistoryList to handle the logic in transaction list screen</p><pre>// src/scenes/TransactionHistoryList/hooks/useTransactionHistoryList.ts<br><br>export function useTransactionHistoryList() {<br>    const [isRefreshing, setIsRefreshing] = useState(false);<br><br>    const {<br>        data,<br>        isLoading,<br>        isFetchingNextPage,<br>        hasNextPage,<br><br>        fetchNextPage,<br>        refetch,<br>    } = useGetTransactionHistory();<br><br>    function goToHome() {<br>        Navigation.homeScene();<br>    }<br><br>    async function onRefresh() {<br>        setIsRefreshing(true);<br>        await refetch();<br>        setIsRefreshing(false);<br>    }<br><br>    function onEndReached() {<br>        const isDataExist = data.length;<br><br>        if (<br>          !isLoading &amp;&amp;<br>          !isRefreshing &amp;&amp;<br>          isDataExist &amp;&amp;<br>          hasNextPage<br>        ) {<br>            fetchNextPage();<br>        }<br>      }<br><br>    return {<br>        state: {<br>            data,<br>            isRefreshing,<br>            isFetchingNextPage,<br>        },<br><br>        method: {<br>            goToHome,<br>            onRefresh,<br>            onEndReached,<br>        },<br>    };<br>}</pre><p>4. Create TransactionHistoryList to show the transaction list and do infinite scroll</p><pre>// src/scenes/TransactionHistoryList/index.tsx<br><br>const TransactionHistoryList = () =&gt; {<br>    const {state, method} = useTransactionHistoryList();<br><br>    const { data, isRefreshing, isFetchingNextPage } = state;<br>    const { goToHome, onRefresh, onEndReached } = method;<br><br>    const renderItem = useCallback(({item}: {item: TransactionHistoryModel}) =&gt; {<br>        const transactionItem = getTransactionItem(item);<br>        return (<br>            &lt;TransactionItem item={transactionItem} /&gt;<br>        );<br>    }, []);<br><br>    return (<br>        &lt;SafeAreaView style={styles.container}&gt;<br>            &lt;FlatList<br>                data={data}<br>                renderItem={renderItem}<br>                contentContainerStyle={styles.content}<br>                refreshing={isRefreshing}<br>                onRefresh={onRefresh}<br>                ListEmptyComponent={&lt;ListEmptyComponent /&gt;}<br>                ListFooterComponent={<br>                  &lt;ListFooterComponent isLoadingNextPage={isFetchingNextPage} /&gt;<br>                }<br>                onEndReachedThreshold={0.5}<br>                onEndReached={onEndReached}<br>            /&gt;<br>        &lt;/SafeAreaView&gt;<br>    );<br>};<br><br>export default TransactionHistoryList;</pre><p>When using useInfiniteQuery after fetching the next page, all pages that have been fetched will fetch all when we call refetch method. E.g. page 1, and page 2 has been fetched so when calling refetch method it will make two API calls one is fetching page 1 and other is fetching page 2</p><p>This example is using React Native 0.76.0 and React Query 5.59.19, so in another release version maybe it will be different.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3db1eade31b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Easy Way to Patch React Native Package]]></title>
            <link>https://medium.com/@rwand/an-easy-way-to-patch-react-native-package-dfc83153c352?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfc83153c352</guid>
            <category><![CDATA[node-modules]]></category>
            <category><![CDATA[patch-package]]></category>
            <category><![CDATA[patch]]></category>
            <category><![CDATA[patching]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Thu, 20 Jun 2024 10:31:40 GMT</pubDate>
            <atom:updated>2024-06-20T10:31:40.527Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever had to modify the code of a library that you’re using in your project?</p><p>Whether it’s because there’s an unresolved issue in the library that was recently discovered, or the issue has been resolved but hasn’t made it into the latest release, or there’s something you need to adjust in the library to fit your project’s requirements.</p><p>One of the easy ways to address the mentioned issues above is by patching the package or library.</p><h3><strong>Steps</strong></h3><ol><li>Install <em>patch-package </em>library on your machineyarn add patch-package postinstall-postinstall</li><li>Add &quot;postinstall&quot;: &quot;npx patch-package&quot; under scripts to your package.json</li></ol><pre>&quot;scripts&quot;: {<br>    ...,<br>    &quot;postinstall&quot;: &quot;npx patch-package&quot;<br>}</pre><p>3. Edit your package in <em>node_modules</em> don&#39;t forget to save it. e.g. I added a command in react-native-mmkv</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLuT2Oy1Hj5ibRSIeOlE1g.png" /><figcaption>Edit node_modules</figcaption></figure><p>4. Run npx patch-package react-native-mmkv</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7VbYEigQ4i92R5nFzbD5A.png" /><figcaption>patch the package</figcaption></figure><p>5. It will make a new file inside patches dir with .patch extension</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*1EKXWAHFk2X9GMg80LaE9Q.png" /><figcaption>patching file result</figcaption></figure><p>6. The file react-native-mmkv+2.10.2.patch will add the change we made in node_modules to this file. The line with + sign is the change that we made</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jbc2UsF1GiSE_Sqpfyo6jg.png" /></figure><p>7. When we do yarn install it will automatically apply the patches</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*ASI4HO0_GvtTlQSE6JCPsw.png" /></figure><h4>Added new changes in the same file that already patch before</h4><ul><li>Delete react-native-mmkv+2.10.2.patch file</li><li>Edit node_modules and then save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_jXUkXekT3pyqI8qYAEPoA.png" /></figure><ul><li>Then follow <strong>step 4–7</strong></li><li>Done</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ug3gPdFqn6PDJD4OhCTovw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfc83153c352" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Request with Ajax or Axios return Error Code 500 with no message]]></title>
            <link>https://medium.com/@rwand/request-with-ajax-or-axios-return-error-code-500-with-no-message-396cfec35245?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/396cfec35245</guid>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[ajax]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[http-error-500]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Wed, 30 Sep 2020 02:08:14 GMT</pubDate>
            <atom:updated>2020-09-30T02:08:14.048Z</atom:updated>
            <content:encoded><![CDATA[<p>When you got error code 500 on your website without an error message, and on the console, you see this message:</p><h3>Error: Request failed with status code 500 at e.exports (spread.js:25) at e.exports (spread.js:25) at XMLHttpRequest.l.onreadystatechange (spread.js:25)</h3><p>or this message:</p><h3><strong>TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter (&lt;anonymous&gt;:1:142)</strong></h3><p>The issue is on your backend or your controller. In my case, I have an issue with my controller. The issue happens in storing the <em>session.</em></p><p>I am using the Laravel framework on my website, I am using the session to store user data after I got a response from API. The problem happens when I use a session with a session driver is a <em>cookie. </em>I got this error when storing the data to the session, because my data size is very long, so I can’t store it to cookie.</p><p>The solution I change the session driver into the file and it’s working and I don’t get 500 error code anymore.</p><p>I hope this article helps you, I wasting my time for 4 hours to fix this issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=396cfec35245" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Scrap API Using Python]]></title>
            <link>https://medium.com/@rwand/how-to-scrap-api-using-python-458416c23301?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/458416c23301</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[scraping]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 04:59:16 GMT</pubDate>
            <atom:updated>2020-07-14T04:59:16.537Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0YH6QZiqlyaFB3t3UYW2hQ.png" /></figure><p>Let’s scrap API using Python, we will scrap <a href="http://www.floatrates.com/">Float Rates</a> website for Indonesia Rate Currency.</p><p>What we will use:</p><ul><li>Python Language</li><li>Flask</li><li>Jinja Templates</li><li>Bootstrap Templates</li></ul><blockquote>Project Structure</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*SoiBoe-jpv31h2AInQKezg.png" /></figure><blockquote>idr_rate_scraper.py</blockquote><p>In this file, we create a module to get JSON data from <a href="http://www.floatrates.com/">Float Rates</a> website.</p><pre>import requests</pre><pre>def getRates(url):</pre><pre>  json_data = requests.get(url)</pre><pre>  return json_data.json().values()</pre><p>Here we use <em>request </em>python library and we use <em>get </em>method to fetch the URL. After we get the response, we return the JSON value.</p><blockquote>run.py</blockquote><p>In this file, we create a route to render the HTML.</p><pre>from flask import Flask, render_template</pre><pre>from idr_rate_scraper import getRates<br></pre><pre>app = Flask(__name__)</pre><pre>@app.route(&#39;/&#39;)</pre><pre>def home():</pre><pre>  return render_template(&#39;index.html&#39;)</pre><pre>@app.route(&#39;/idr-rates&#39;)</pre><pre>def idr_rates():</pre><pre>  url = &#39;http://www.floatrates.com/daily/idr.json&#39;</pre><pre>  data_json = getRates(url)</pre><pre>  return render_template(&#39;index.html&#39;, data=data_json)</pre><pre>if __name__ == &quot;__main__&quot;:</pre><pre>  app.run(debug=True)</pre><p>Here we import <em>getRates </em>module from <em>idr_rate_scraper </em>file that we have created before. And run the module on route <em>idr-rates.</em></p><blockquote>index.html</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9fb6777e78d77c28781b252e6919d83a/href">https://medium.com/media/9fb6777e78d77c28781b252e6919d83a/href</a></iframe><p>Here we create an Html table to show the result what we got before.</p><blockquote>Result</blockquote><p>And this the result of what we have done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAK8-NWZvukDxmzWNqZBbg.png" /></figure><p>The complete code you can find in this repository</p><p><a href="https://github.com/w4ndry/scraping-json-api/">w4ndry/scraping-json-api</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=458416c23301" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Scrap a Website Using Flask and Beautiful Soup]]></title>
            <link>https://medium.com/@rwand/how-to-scrap-a-website-using-flask-and-beautiful-soup-9a9e9c286315?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a9e9c286315</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[scraper]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[scraping-with-python]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Fri, 10 Jul 2020 10:58:40 GMT</pubDate>
            <atom:updated>2020-07-10T13:01:23.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*7C4FGUp2fuX3deiP2S6P7A.png" /></figure><p>Let’s begin…</p><p>Here we will be scraping <a href="https://www.detik.com/">detik</a> website for our target at this time :).</p><p>Here are our weapons:</p><ul><li>Requests python HTTP library</li><li>BS4 or Beautiful Soup 4 for pulling data from HTML or XML files</li><li>Flask python mini framework</li><li>Jinja engine template</li></ul><blockquote>Project Structure</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*76U2QHtesbeaJ4owO9fpgw.png" /><figcaption>Project Structure</figcaption></figure><blockquote>Scraper Module</blockquote><p>Create a file name <em>detik_scrapper.py. </em>Here, we create a python module for scraping the website</p><pre>import requests</pre><pre>from bs4 import BeautifulSoup</pre><pre>def popular(**kwargs):</pre><pre>  html_doc = requests.get(kwargs[&#39;url&#39;], params={&quot; + kwargs[&#39;param&#39;][&#39;key&#39;] +&quot;:&quot;+ kwargs[&#39;param&#39;][&#39;value&#39;] + &quot;})</pre><pre>  soup = BeautifulSoup(html_doc.text, &#39;html.parser&#39;)</pre><pre>  popular_area = soup.find(attrs={&#39;class&#39;: &#39;grid-row list-content&#39;})</pre><pre>  titles = popular_area.findAll(attrs={&#39;class&#39;: &#39;media__title&#39;})</pre><pre>  images = popular_area.findAll(attrs={&#39;class&#39;: &#39;media__image&#39;})</pre><pre>  return images</pre><blockquote><em>App Runner</em></blockquote><p>Create a file name <em>run.py. </em>Here, we create the route for the website. One route for home and the second is detik-popular, in this route we will scrap <a href="https://www.detik.com/">detik</a> website for popular news.</p><pre>from flask import Flask, render_template</pre><pre>from detik_scrapper import popular</pre><pre>app = Flask(__name__)</pre><pre>@app.route(&#39;/&#39;)</pre><pre>def home():</pre><pre>  return render_template(&#39;index.html&#39;)</pre><pre>@app.route(&#39;/detik-popular&#39;)</pre><pre>def detik_popular():</pre><pre>  url = &#39;https://www.detik.com/terpopuler&#39;</pre><pre>  param = {</pre><pre>    &#39;key&#39;: &#39;tag_from&#39;,</pre><pre>    &#39;value&#39;: &#39;wp_cb_mostPopular_more&#39;</pre><pre>  }</pre><pre>  popularNews = popular(param = param, url = url)</pre><pre>  return render_template(&#39;index.html&#39;, popular=popularNews)</pre><pre>if __name__ == &quot;__main__&quot;:</pre><pre>  app.run(debug=True)</pre><blockquote><em>Html Template</em></blockquote><p>Create a file name index.html under the folder templates. Here, we show the result of popular news from <a href="https://www.detik.com/">detik</a> website.</p><pre>&lt;!DOCTYPE html&gt;</pre><pre>&lt;html lang=&quot;en&quot;&gt;</pre><pre>&lt;head&gt;</pre><pre>  &lt;title&gt;Bootstrap Example&lt;/title&gt;</pre><pre>  &lt;meta charset=&quot;utf-8&quot;&gt;</pre><pre>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;</pre><pre>  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css&quot;&gt;</pre><pre>  &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js&quot;&gt;&lt;/script&gt;</pre><pre>  &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js&quot;&gt;&lt;/script&gt;</pre><pre>  &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;</pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>  &lt;nav class=&quot;navbar navbar-expand-sm bg-dark navbar-dark&quot;&gt;</pre><pre>    &lt;!-- Brand/logo --&gt;</pre><pre>    &lt;a class=&quot;navbar-brand&quot; href=&quot;/&quot;&gt;Scraper&lt;/a&gt;</pre><pre>    &lt;!-- Links --&gt;</pre><pre>    &lt;ul class=&quot;navbar-nav&quot;&gt;</pre><pre>      &lt;li class=&quot;nav-item&quot;&gt;</pre><pre>        &lt;a class=&quot;nav-link&quot; href=&quot;/detik-popular&quot;&gt;Detik Popular&lt;/a&gt;</pre><pre>      &lt;/li&gt;</pre><pre>    &lt;/ul&gt;</pre><pre>  &lt;/nav&gt;</pre><pre>    &lt;div class=&quot;container-fluid&quot; style=&quot;margin-top: 30px;text-align: center;&quot;&gt;</pre><pre>      &lt;div&gt;</pre><pre>       {% for image in popular %}</pre><pre>         {{ image|safe }}</pre><pre>         &lt;a href=&quot;{{ image.find(&#39;a&#39;)[&#39;href&#39;]|safe }}&quot;&gt;{{       image.find(&#39;a&#39;).find(&#39;img&#39;)[&#39;title&#39;]|safe }}&lt;/a&gt;</pre><pre>       {% endfor %}</pre><pre>       &lt;/div&gt;<br>    &lt;/div&gt;</pre><pre>  &lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>We use a simple bootstrap template here, on our template.</p><p>Here is the result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*me873h9Q1a9Px-6BY-B9MA.png" /></figure><p>You can find complete source code in the below repository.</p><p><a href="https://github.com/w4ndry/scraping-detik-dot-com">w4ndry/scraping-detik-dot-com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a9e9c286315" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Web Scraping Using Python and Beautiful Soup]]></title>
            <link>https://medium.com/@rwand/simple-web-scraping-using-python-and-beautiful-soup-97c367e6d0c?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/97c367e6d0c</guid>
            <category><![CDATA[beautifulsoup]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jadwal-sholat-digital]]></category>
            <category><![CDATA[scraping]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Wed, 08 Jul 2020 05:02:36 GMT</pubDate>
            <atom:updated>2020-07-08T05:02:36.692Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*hDoLova2Rq1FFolQd4irOg.png" /></figure><p>Here we will scrape the website <a href="https://jadwalsholat.pkpu.or.id/">jadwal sholat pkpu</a>. We will use Python and it’s a library call Beautiful Soup. We will get today&#39;s time prayer from subuh to isya prayer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*g8dwG1YfxVTZYa8U2CVrOg.png" /><figcaption>Jadwal Sholat PKPU Jakarta</figcaption></figure><p>Look at the picture above, today’s time prayer is different from another. It is highlighted. So that time what we will get in this scraping.</p><p>Let’s make folder call <em>scrapping-jadwal-sholat-pkpu</em></p><blockquote>mkdir <em>scrapping-jadwal-sholat-pkpu &amp;&amp; cd scrapping-jadwal-sholat-pkpu &amp;&amp; touch app.py</em></blockquote><p>Open file <em>app.py </em>and import</p><pre>import bs4</pre><pre>import requests</pre><p>Add variable call <em>url</em></p><pre>url = &quot;https://jadwalsholat.pkpu.or.id/&quot;</pre><p>We fetch <em>url</em> using method GET and insert into variable call <em>contents</em></p><pre>contents = requests.get(url)</pre><p>Parse the <em>contents</em> using <em>beautiful soup 4 </em>and put in variable call <em>response</em></p><pre>response = bs4.BeautifulSoup(contents.text, &quot;html.parser&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*NVDARQ7Wh3Pffjrph1aoCg.png" /></figure><p>If we inspect the website, we see that today’s time prayer is inside tag tr and class name is <em>table_highlight. </em>We will use this tag and class to find the time.</p><p>Find the highlighted row, because the response is in the array so we get the first result.</p><pre>data = response.find_all(&#39;tr&#39;, &#39;table_highlight&#39;)[0]</pre><p>And last we put the time into dictionary call <em>sholat</em></p><pre>sholat = {}</pre><pre>i = 0</pre><pre>for val in data:</pre><pre>  if i == 1:</pre><pre>    sholat[&#39;subuh&#39;] = val.get_text()</pre><pre>  elif i == 2:</pre><pre>    sholat[&#39;zuhur&#39;] = val.get_text()</pre><pre>  elif i == 3:</pre><pre>    sholat[&#39;ashar&#39;] = val.get_text()</pre><pre>  elif i == 4:</pre><pre>    sholat[&#39;magrib&#39;] = val.get_text()</pre><pre>  elif i == 5:</pre><pre>    sholat[&#39;isya&#39;] = val.get_text()</pre><pre>  i += 1</pre><p>And now we can print the result</p><pre>print(sholat)</pre><p>Open your terminal and type <em>python app.py</em> and this the result</p><blockquote>{‘subuh’: ‘04:44’, ‘zuhur’: ‘12:00’, ‘ashar’: ‘15:22’, ‘magrib’: ‘17:54’, ‘isya’: ‘19:08’}</blockquote><p>You can see the full sourcecode <a href="https://github.com/w4ndry/scraping-jadwal-sholat-pkpu">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97c367e6d0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Upload React Native App]]></title>
            <link>https://medium.com/@rwand/how-to-upload-react-native-app-35c1cbbd7137?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/35c1cbbd7137</guid>
            <category><![CDATA[play-store]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[publish]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Tue, 28 Apr 2020 01:53:23 GMT</pubDate>
            <atom:updated>2020-04-28T01:53:23.443Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*lpHxOQJ8Q8v6KE7So2vujA.png" /></figure><p>Have you done your React Native project? If yes, let’s upload it to Play Store. Here the steps.</p><ol><li>Create your account here <a href="https://play.google.com/apps/publish/">https://play.google.com/apps/publish/</a></li><li>From home click button CREATE APPLICATION</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uzMMnTyR3Tm5h0EIH6sq-Q.png" /></figure><p>3. Select your language and Fill your app title and then click the button Create</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*HwZqlRVvauRU1YRjb3o3Zw.png" /></figure><p>4. Fill your product details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*AZpEbQVyJG-WJG1MX9WrDw.png" /></figure><p>5. Enter your app icon for play store</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*Vmutm6FoQyuw3zC01Z_srQ.png" /></figure><p>6. Enter your app screenshots</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*M3H6lpV55Tw2902ha_9YDw.png" /></figure><p>7. Enter your app Categorisation and click button DRAFT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*z9LipglKlE6kbyWtwV7yvA.png" /></figure><p>8. From home click application you created before</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*xoih_uOOBvZawMITK8D2ZQ.png" /></figure><p>9. In the left menu click App Release</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*eo3q4aFb223tZ8OUWlI2bg.png" /></figure><p>10. Click MANAGE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*uOdFH1wcIuIXmMuiP0enJQ.png" /></figure><p>11. Click RELEASE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*nh67775GSwqFxDdx0CYOKw.png" /></figure><p>12. Browse your app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*O6rSBRcKioDqHD3AWIxwuw.png" /></figure><p>13. Enter release name and description</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*gOSn2O1LQyOr-mVOZVepgA.png" /></figure><p>14. The last step to publish it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*kkxvNv234YsacJVfZ_ihrg.png" /></figure><p>That’s all, sometimes you need to wait a few hour for seeing the App on Play Store.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35c1cbbd7137" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malam dengan resiko kehidupan]]></title>
            <link>https://medium.com/@rwand/malam-dengan-resiko-kehidupan-367b1e9dddbf?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/367b1e9dddbf</guid>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Mon, 24 Apr 2017 17:04:40 GMT</pubDate>
            <atom:updated>2017-04-24T17:09:37.021Z</atom:updated>
            <content:encoded><![CDATA[<p>Tepat pukul 23.22, hari Senin, 24 April 2017 || 27 Rajab 1438</p><p>Seperti biasa ketika di penghujung bulan, aku selalu merasa kelaparan. Ini bukan sebuah perasaan semata, akan tetapi sebuah kenyataan. Hanya menyisakan 300 rupiah dari hasil kerja di bulan lalu. Dengan uang segitu aku tidak bisa membeli apa-apa di zaman ini. Perut yang lapar dan minta diisi, dan yang ada hanya 3 batang djarum coklat dan stengah aqua yang ku isi dari kamar mandi. Rasanya menyedihkan, sudah 2 tahun lebih aku menyelesaikan study s1 ku dan setiap bulan harus merasakan hal yang sama.</p><p>Di saat-saat seperti ini aku selalu kepikiran tentang hidup yang ku jalani ini. Akankah seperti ini terus? aku memang tidak terlalu memikirkan tentang uang, akan tetapi jika tidak ada lagi uang yang ku miliki aku akan bingung sendiri. Inilah kehidupan kawan, aku tidak akan menyerah hanya karena uang. Aku sudah biasa kelaparan di tengah malam, tidak makan nasi untuk beberapa hari, meminum air dari kamar mandi. Itu semua sudah sangat sering ku lakukan sejak aku tamat SD.</p><p>Perjalanan kehidupanku dan kehidupanmu mungkin berbeda, aku tidak menganggap perjalananmu menyenangkan. Setiap dari kita pasti mengalami kesulitan dalam menjani kehidupan ini.</p><p>Aku tidak pernah berfikir panjang tentang resiko yang akan aku hadapi ketika mengambil sebuah keputusan. Dahulu ketika aku menamatkan study sekolah dasarku, aku ke pesantren untuk melanjutkan study sekolah menengah pertama. Aku tidak berfikir betapa sulitnya hidup di pesantren, akan tetapi setelah aku memasuki pesantren itu semua bukan apa-apa. Resiko yang tersulit adalah ada saat dimana aku kangen dengan rumah, kangen dengan orang tua, adek-adek. Ketika aku mengalamai rasa kangen aku meneteskan air mata. Rasanya tidak kuat jauh dari orang tua dan keluarga. Yang kedua aku lemah di pelajaran eksakta, khususnya matematika. Akan tetapi dua resiko tersebut tidak membuatku lemah, pada akhirnya aku berhasil menamatkan studyku di pesantren selama 6 tahun, Walaupun setiap tahun aku selalu merasakan dua resiko tersebut. Dari dua resiko yang dapat ku taklukan, aku mendapatkan sesuatau yang tidak akan pernah ku dapatkan jika aku masuk sekolah biasa, baik itu negri maupun swasta. Pertama pengetahuanku terhadap agamaku yaitu Islam, kedua keyakinan ku terhadap agama ini meskipun sampai saat ini kelakuanku belum sebaik seorang ulama islam ataupun mereka yang menjalankan perintah agamanya dengan baik. Kedua aku menjadi bagian dari keluarga besar yang akan selalu menerimaku kapan saja, yaitu keluarga besar Ummul Quro Al-islami.</p><p>Kelaparan adalah sebuah kata yang selalu ku temui setiap bulan di perjalanan hidupku. Resiko ini ku dapat semenjak aku melanjutkan perjalanan studyku untuk mendapatkan gelar sarjana muda 2010 silam. Setiap bulan aku pasti merasakan yang namanya kelaparan dan minum air dari kamar mandi. Resiko ini terus berlanjut hingga sekarang, aku tidak tahu akan berakhir hingga kapan. Akan tetapi sudah ku tetapkan ini akan berakhir di awal bulan 2018.</p><p>Salam perjalanan hidup @rwand</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=367b1e9dddbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Makhluk Baru Bernama React Native]]></title>
            <link>https://medium.com/@rwand/makhluk-baru-bernama-react-native-e4b22fa1fafc?source=rss-fc0909112e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4b22fa1fafc</guid>
            <dc:creator><![CDATA[Rwand]]></dc:creator>
            <pubDate>Sun, 23 Apr 2017 16:24:18 GMT</pubDate>
            <atom:updated>2017-04-23T16:38:12.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cyKalueKTUyGFWupDgIFDA.png" /></figure><p>Perjalananku di dunia programming baru saja dimulai. Hari ini aku ingin mengenalkan teman baruku di dunia programming, khususnya di dunia mobile app. Teman baruku ini bernama React Native.</p><p>Ok, mari ku perkenalkan dengannya.</p><p>React Native adalah framework buatan facebook, yang memudahkan para mobile developer dalam membangun sebuah mobile app yang dapat berjalan di android dan ios.</p><p>React Native dibangun menggunakan bahasa pemrograman javascript. Sebuah bahasa yang saat ini sangat populer di dunia programming.</p><p>Berdasarkan paradigma yang dianut “Learn Once, Write Anywhere. Hanya dengan menulis sebuah kode menggunakan react native, kita dapat membuat aplikasi yang dapat berjalan di android dan ios.</p><p>Dengan react native kita membuat aplikasi mobile yang nyata, artinya aplikasi kita benar-benar seperti aplikasi yang dibuat menggunakan bahasa pemrograman java untuk android dan swift ataupun objective-c untuk ios. Aplikasi akan berjalan smooth seperti layaknya aplikasi yang dibuat seperti java dan swift maupun objective-c.</p><p>Dengan react native kita tidak perlu mengcompile, kita hanya perlu mereload dan hasilnya langsung bisa kita nikmati. Dan react native tidak membatasi kita untuk menulis native code untuk aplikasi yang kita buat. jadi, walaupun kita membuat aplikasi menggunakan react native kita tetap bisa menambahkan native code kedalamnya jika kita ingin lebih mengoptimasi aplikasi yang kita buat.</p><p>Tunggu apalagi mari kita mulai membuat aplikasi mobile. dengan mengunjungi website resminya <a href="https://facebook.github.io/react-native/">https://facebook.github.io/react-native/</a>.</p><p>Salam programming <a href="https://medium.com/u/fc0909112e8d">RWand</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4b22fa1fafc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>