<?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>Forem: Guido Pereira</title>
    <description>The latest articles on Forem by Guido Pereira (@stereopt).</description>
    <link>https://forem.com/stereopt</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%2F74281%2F8a8dccc3-a48d-4aeb-b904-32e7c46fb553.jpg</url>
      <title>Forem: Guido Pereira</title>
      <link>https://forem.com/stereopt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/stereopt"/>
    <language>en</language>
    <item>
      <title>Automating University Schedule #1</title>
      <dc:creator>Guido Pereira</dc:creator>
      <pubDate>Mon, 21 Oct 2019 21:48:06 +0000</pubDate>
      <link>https://forem.com/stereopt/automating-my-school-schedule-1-5688</link>
      <guid>https://forem.com/stereopt/automating-my-school-schedule-1-5688</guid>
      <description>&lt;h1&gt;
  
  
  Index
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;🤔 Why?&lt;/li&gt;
&lt;li&gt;🤨 How?

&lt;ul&gt;
&lt;li&gt;How did I do it?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Code Showcase&lt;/li&gt;
&lt;li&gt;Final Results&lt;/li&gt;
&lt;li&gt;🤗 Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🤔 Why?
&lt;/h3&gt;

&lt;p&gt;Around 1 month ago I started university, and one of the things I found myself doing all the time was looking at my schedule looking for what classes I had and in what classroom it was. I found that really annoying, mostly because the only way to check it was in a online page. 😣&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qOkXhQkP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ttcjsotk5g0swp66zvbp.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qOkXhQkP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ttcjsotk5g0swp66zvbp.JPG" alt="schedule"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the things I like to do is to automate things I do more than once. And this type of project is why I got into programming in the first place.&lt;/p&gt;

&lt;p&gt;So, I have to use my programming skills to solve / automate this scenario which will save my screen time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/26tn33aiTi1jkl6H6/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/26tn33aiTi1jkl6H6/giphy.gif" alt="coding"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🤨 How?
&lt;/h3&gt;

&lt;h4&gt;
  
  
  How I did it?
&lt;/h4&gt;

&lt;p&gt;First, I learned how to use the &lt;a href="https://developers.google.com/calendar/quickstart/nodejs"&gt;Google Calendar in Node.js&lt;/a&gt;. Then, I realized that I had to do everything because there isn't any tool already created to do what I want. So I decided to roll up my sleeves and get down to business. 💪&lt;/p&gt;

&lt;p&gt;In this first version it was a lot more manual than I had hoped for, but it gave me a foundation that I could build upon and improve in future versions. 😤&lt;br&gt;
Well, by manual I mean I had to do this steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open google chrome developer console&lt;/li&gt;
&lt;li&gt;Navigate into the schedule page&lt;/li&gt;
&lt;li&gt;Login with my credentials&lt;/li&gt;
&lt;li&gt;Check the network (in the console) for the response that contained the schedule .json&lt;/li&gt;
&lt;li&gt;Save that file to my desktop&lt;/li&gt;
&lt;li&gt;Run my application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And after all that is done I have my schedule in my calendar, which then synchronizes in all my devices, including my smartphone.&lt;/p&gt;
&lt;h3&gt;
  
  
  Code Showcase
&lt;/h3&gt;

&lt;p&gt;Here are the overall steps and gist.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First I save the .json in the app folder&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FfqaE8zf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/pgtar5y5i06fg4976ns0.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FfqaE8zf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/pgtar5y5i06fg4976ns0.JPG" alt="jsonResponse"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then I had to authenticate into google calendar, for that I used this npm package for node.js:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qF2jUiUG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-6a5bca60a4ebf959a6df7f08217acd07ac2bc285164fae041eacb8a148b1bab9.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/googleapis"&gt;
        googleapis
      &lt;/a&gt; / &lt;a href="https://github.com/googleapis/google-api-nodejs-client"&gt;
        google-api-nodejs-client
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included. 
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It wasn't that difficult as long as you follow the quick guide that google provides:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Next, I looped through all the Classes and Created a Event for each to add to Google Calendar
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Final Results
&lt;/h3&gt;

&lt;p&gt;In this first version I had the functionality working, even though it's not really automated it does what I need to.&lt;br&gt;
And this is what I got:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C4yWaSYY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5xb0veyotuz2kdpkj1np.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C4yWaSYY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5xb0veyotuz2kdpkj1np.JPG" alt="Horario Helper"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1uB5bKmP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cwqe3vmlp4hc8rj17m6w.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1uB5bKmP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cwqe3vmlp4hc8rj17m6w.JPG" alt="Google Calendar"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🤗 Conclusion
&lt;/h3&gt;

&lt;p&gt;This is what technology is all about. Identify the problem and come up with a solution, even if the solution takes some versions to be good.&lt;br&gt;
There are so many possibilities with the combination of the tools like GoogleApi and Node.js. And with those we can increase our productivity.&lt;/p&gt;

&lt;p&gt;!!! Be sure to Comment 🌟 ... You guys all Rock !!!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S: This is my first post. Feel free to point out any mistakes so I can improve&lt;/em&gt;&lt;br&gt;
&lt;em&gt;P.S&lt;sup&gt;2:&lt;/sup&gt; When I have the time I will post the second part where I really automate it&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>googlecalendar</category>
      <category>javascript</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
