<?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 Juan Cruz Martino on Medium]]></title>
        <description><![CDATA[Stories by Juan Cruz Martino on Medium]]></description>
        <link>https://medium.com/@juancruzmartino?source=rss-1dae2813197e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e3KnBqiH98K7rhfHxXwpOg.png</url>
            <title>Stories by Juan Cruz Martino on Medium</title>
            <link>https://medium.com/@juancruzmartino?source=rss-1dae2813197e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:29:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@juancruzmartino/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[How to get a room in Berlin using Firestore + Google Functions + Google Scheduler]]></title>
            <link>https://medium.com/@juancruzmartino/how-to-get-a-room-in-berlin-using-firestore-google-functions-google-scheduler-639c92e7ae08?source=rss-1dae2813197e------2</link>
            <guid isPermaLink="false">https://medium.com/p/639c92e7ae08</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[scraping]]></category>
            <dc:creator><![CDATA[Juan Cruz Martino]]></dc:creator>
            <pubDate>Sat, 19 Oct 2019 14:06:39 GMT</pubDate>
            <atom:updated>2019-10-19T14:06:39.805Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*93HWIfUnO-Dw-2nu" /><figcaption>Photo by <a href="https://unsplash.com/@purzlbaum?utm_source=medium&amp;utm_medium=referral">🇨🇭 Claudio Schwarz | @purzlbaum</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The<a href="https://medium.com/@juancruzmartino/how-to-get-a-room-in-berlin-scrapping-wg-gesucht-with-nodejs-97345496d58e"> <strong>first part</strong> </a>of this series of posts was about creating a scraper tool in NodeJS that allowed us to send a message to the owner from a template.</p><p>The main problem that arises with that approach is to have the script running 24 hours a day. A possibility is to deploy it into a free tier VM or having a dedicated raspberry pi but both alternatives imply monitoring, configuration, deployment, etc.</p><p>In this case, I’m using an alternative:</p><ul><li>Firestore for data storage</li><li>Cloud functions for the script</li><li>Cloud scheduler for the repetition</li></ul><p>The objective is to have a free alternative as well so I will keep it simple.</p><p><strong>Prerequisites</strong></p><ul><li>Have a Google Cloud account. <a href="https://console.cloud.google.com/">https://console.cloud.google.com</a></li><li>Have the Firebase CLI installed and set up: <a href="https://github.com/firebase/firebase-tools">https://github.com/firebase/firebase-tools</a></li></ul><h3>Let&#39;s get started</h3><p><strong>Create and configure the Firebase Project</strong></p><ol><li>Go to <a href="https://console.firebase.google.com/">https://console.firebase.google.com</a> and create a project</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BbU6CrWW4jsV9sy8wcMBtw.png" /></figure><p>2. Give your project a representative name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKjiF3UK2v9_z2CIfK_HLw.png" /></figure><p>3. In this case, Google Analytics its not mandatory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlOfcW3xVWzLIcuDYa_mZA.png" /></figure><p>4. Once the project is created its time to create a database to store the data. We will use Firestore for this.</p><p>5. Go to the Database section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfJpF1rvVsdjzdmmcYsoAA.png" /></figure><p>6. Start in test mode to enable quick writing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*qSAg9d7kDIq6y4cTspby1Q.png" /></figure><p>7. Set the proper location. For Wg-gesucht the best is to have it placed in Europe:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*O2-rsNDpvGxv1JZIGDFybA.png" /></figure><p>8. Once the Firestore database has been created its time to create a Collection to store the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aOMzTZfLv-Q2msa90wI5oQ.png" /></figure><p><strong>Clone and deploy the function</strong></p><p>Now we need to deploy the Functions to start scrapping and posting messages to the owners. The functions are in <a href="https://github.com/juancruzmartino/wg-gesucht-scrapper-firebase">this repo</a>. In order to deploy it to the project you can:</p><pre>git clone <a href="https://github.com/juancruzmartino/wg-gesucht-scrapper-firebase">https://github.com/juancruzmartino/wg-gesucht-scrapper-firebase</a></pre><p>Change the <strong>FILTER_URL</strong> and the <strong>credentials</strong> inside the index.js before proceeding.</p><pre>cd functions</pre><pre>npm install</pre><pre>cd ..</pre><pre>firebase deploy —YOUR-PROJECT-ID</pre><p><strong>Configuring the Google Scheduler</strong></p><ol><li>Go to <a href="https://cloud.google.com/scheduler/">https://cloud.google.com/scheduler/</a> and create a Job</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*cLwycaxvgSJO_k2XuwodwA.png" /></figure><p>2. Setup the scrapper:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*9JpGQApqLLa9KjA4mUmDBg.png" /></figure><p>3. Replace the URL so it matches your project ID.</p><p>4. Do the same for the autoreserve function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*wJysTERQ0z7COZRB7Y3vjg.png" /></figure><p>From now on, the scripts should execute every 5 minutes getting all the new rooms that match your filter and sending the message to the owner using the specified templates.</p><p>You can change the execution frequency or disable the functions as need it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=639c92e7ae08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get a room in Berlin scrapping Wg Gesucht with NodeJS]]></title>
            <link>https://medium.com/@juancruzmartino/how-to-get-a-room-in-berlin-scrapping-wg-gesucht-with-nodejs-97345496d58e?source=rss-1dae2813197e------2</link>
            <guid isPermaLink="false">https://medium.com/p/97345496d58e</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[berlin]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Juan Cruz Martino]]></dc:creator>
            <pubDate>Fri, 11 Oct 2019 15:06:57 GMT</pubDate>
            <atom:updated>2019-10-21T13:07:20.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1PCMj2tf1AgphBc2C80J9g.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@flo_karr">Flo Karr</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>You can check the serverless script alternative <a href="https://medium.com/@juancruzmartino/how-to-get-a-room-in-berlin-using-firestore-google-functions-google-scheduler-639c92e7ae08">here</a>.</p><p>Berlin is a great city to live in if you are a software developer. It has an immense amount of tech startups and it’s quickly becoming one of the most important tech hubs in Europe.</p><p>But it also has a great problem. It’s almost impossible to find a place to live. Depending on who you speak with the average time spent in finding a room or a flat is about 3 months.</p><p>There are several alternatives and websites to find a place to live in Berlin, such as:</p><ul><li>Nestpick</li><li>ImmobilienScout24</li><li>Immowelt</li><li>eBay Kleinanzeigen</li><li>Wg-gesucht</li><li>Wg-suche</li></ul><p>Each of them has a specific target and flat profile. In my case, I was focusing on Wg-gesucht since I found it to be the most valuable for the shared apartment alternative.</p><p><strong>Automating the process!</strong></p><p>I decided to create a NodeJS app to automate the whole process. The app was initially running from my computer but later on, it was deployed into a free tier VM of google cloud: <a href="https://cloud.google.com/free/">https://cloud.google.com/free/</a></p><p><strong>How does it work</strong></p><ol><li>List the rooms</li></ol><p>After configuring the app, every 5 minutes a search is performed using the provided filters. The list is processed using <strong>cheerio</strong> for filtering and crawling purposes.</p><p>2. Get the language of the Ads</p><p>The chance of getting the room increases by writing a message to the owner in the correct language. The app uses the <strong>franc</strong> module in order to determine which language was used.</p><p>The rooms are then stored in a db.json file. Since the scope of the project is small, a json db will do the trick.</p><p>3. Send a message to the owner</p><p>Every 5 minutes the db.json file is processed and the messages are sent to the owners. If the message is delivered successfully then the db is updated.</p><p><strong>Results</strong></p><p>The week after starting the script I was invited to see at least 20 rooms. In less than two weeks I have already rented the room I wanted.</p><p><strong>The app</strong></p><p>The script can be found here: <a href="https://github.com/juancruzmartino/wg-gesucht-scrapper">https://github.com/juancruzmartino/wg-gesucht-scrapper</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97345496d58e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>