<?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: Hamza</title>
    <description>The latest articles on DEV Community by Hamza (@oihamza).</description>
    <link>https://dev.to/oihamza</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%2F158410%2Fccfeafaa-082d-435c-bd54-028664d4f3e8.jpg</url>
      <title>DEV Community: Hamza</title>
      <link>https://dev.to/oihamza</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oihamza"/>
    <language>en</language>
    <item>
      <title>Toggle Dark Mode with Touch Bar</title>
      <dc:creator>Hamza</dc:creator>
      <pubDate>Mon, 09 Sep 2019 18:22:07 +0000</pubDate>
      <link>https://dev.to/oihamza/toggle-dark-mode-with-touch-bar-3o8n</link>
      <guid>https://dev.to/oihamza/toggle-dark-mode-with-touch-bar-3o8n</guid>
      <description>&lt;p&gt;If you’re anything like me, you enjoy changing between dark mode and light mode based on what vibe you’re feeling.  &lt;/p&gt;

&lt;p&gt;Here’s a quick and to-the-point tutorial where I'll show you how to add a shortcut to your MacBook's Touch Bar that makes switching all that much easier. &lt;/p&gt;

&lt;p&gt;🌞🌚 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fls2otyqir0wlr4gahnur.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fls2otyqir0wlr4gahnur.gif" alt="cat saying are you ready"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What we'll be doing
&lt;/h1&gt;

&lt;p&gt;Very simply, we’ll be creating an Automator script that allows us to create a shortcut for dark/light mode. Once we have the script set up, we will add a Touch Bar shortcut to make switching between the two modes easier. &lt;/p&gt;

&lt;p&gt;If you're not familiar with any of these things, don't worry as I've listed each step with helpful screenshots to guide you. We've got this!&lt;/p&gt;

&lt;h1&gt;
  
  
  What you’ll need:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;MacBook w/Touch Bar 👆🏽💻&lt;/li&gt;
&lt;li&gt;macOS &lt;a href="https://www.apple.com/macos/mojave/" rel="noopener noreferrer"&gt;Mojave&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1)
&lt;/h2&gt;

&lt;p&gt;&lt;sup&gt;Create the script that automates the light → dark mode process&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;→ Open Automater&lt;br&gt;
→ Create a New document&lt;br&gt;
→ Create a quick action, and then click "Choose"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy9tfj26coyaci5erppof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy9tfj26coyaci5erppof.png" alt="Create a new document and then quick action"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2)
&lt;/h2&gt;

&lt;p&gt;&lt;sup&gt;Implementing the script &lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Change the workflow selection to "no input"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fe8gkxmb7dqy6ulyqlb4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fe8gkxmb7dqy6ulyqlb4g.png" alt="change to no input"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Change the image to your desired icon. This will appear on the Touch Bar. I selected the color wheel. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdd3j2n5smx7ifq16yfl2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdd3j2n5smx7ifq16yfl2.png" alt="change the image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Actions search bar type "Run AppleScript"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkmtyn55qm364sk0xfmqq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkmtyn55qm364sk0xfmqq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Double click "Run AppleScript" and you’ll see this page&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdb0t33krwu2gqq9k08q9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdb0t33krwu2gqq9k08q9.png" alt="Run AppleScript page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delete the existing code, and replace it with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tell application "System Events"&lt;br&gt;
tell appearance preferences &lt;br&gt;
set dark mode to not dark mode &lt;br&gt;
end tell&lt;br&gt;
end tell&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;It should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fp6z03n4vr7r0fej38sa6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fp6z03n4vr7r0fej38sa6.png" alt="Updated code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's test out the script by clicking the "Run" button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9uo887xwl50lzohdn64b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9uo887xwl50lzohdn64b.png" alt="Test the script"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Switch back to the ​light mode by clicking "Run" again. &lt;/p&gt;

&lt;p&gt;Let's go ahead and save the script. I named mine  “Dark Mode Toggle”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Futqekyfsjy09vfh2wka2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Futqekyfsjy09vfh2wka2.png" alt="Save your script"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3)
&lt;/h2&gt;

&lt;p&gt;&lt;sup&gt;Creating the Touch Bar shortcut. We’re almost there!&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;On &lt;strong&gt;System Preferences&lt;/strong&gt; → &lt;strong&gt;Extensions&lt;/strong&gt;, make sure the Dark Mode Toggle is checked&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ft1b28k86wszx9o53ircs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ft1b28k86wszx9o53ircs.png" alt="system preferences → extensions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Customize Control Strip&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fo01a3c1fh339ni7ngcm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fo01a3c1fh339ni7ngcm0.png" alt="customize control strip"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will take you to this page, where you can drag your quick action to your desired location on the keyboard. I chose to put mine on the far right. &lt;/p&gt;

&lt;p&gt;Note: you'll have to drag it towards the desired place on your Touch Bar. &lt;a href="https://support.apple.com/guide/mac-help/touch-bar-mchlbfd5b039/mac" rel="noopener noreferrer"&gt;See more here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fyksx618ds4n3imfxkaec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fyksx618ds4n3imfxkaec.png" alt="Touch Bar icons"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdxjwra4svarpowwzb9xc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdxjwra4svarpowwzb9xc.jpeg" alt="Drag the icon to your desired Touch Bar location"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations, you did it! 😎&lt;/p&gt;

&lt;p&gt;Connect with me on Twitter &lt;a href="https://twitter.com/oihamza" rel="noopener noreferrer"&gt;@oiHamza&lt;/a&gt;. 👨🏽‍🚀&lt;/p&gt;

</description>
      <category>touchbar</category>
      <category>shortcut</category>
      <category>darkmode</category>
    </item>
    <item>
      <title>Build a Twitter NASA app 🚀</title>
      <dc:creator>Hamza</dc:creator>
      <pubDate>Tue, 20 Aug 2019 17:54:04 +0000</pubDate>
      <link>https://dev.to/xdevs/build-a-twitter-nasa-app-57kb</link>
      <guid>https://dev.to/xdevs/build-a-twitter-nasa-app-57kb</guid>
      <description>&lt;h6&gt;
  
  
  This project is hosted on Glitch: &lt;a href="https://glitch.com/%7Edailynasa" rel="noopener noreferrer"&gt;https://glitch.com/~dailynasa&lt;/a&gt;
&lt;/h6&gt;

&lt;p&gt;Once a day, NASA features an astronomy or space science related image through their public API. The images are pretty cool and teach you about the incredible solar system we live in!  &lt;/p&gt;

&lt;p&gt;As an astronomy enthusiast, I wondered how I could easily view these images and even get them to appear on my Twitter timeline. I got to work on this, and ended up putting together this fully automated Daily NASA app that Tweets images released each day by NASA.&lt;/p&gt;

&lt;p&gt;Our node.js app will connect to the NASA API, temporarily store media provided and post a Tweet with the title + image/video via the Twitter API. Here is an &lt;a href="https://twitter.com/DailyNASA/status/1161986403653292035" rel="noopener noreferrer"&gt;example&lt;/a&gt;. Pretty simple!&lt;/p&gt;

&lt;p&gt;In this tutorial, I'll also show you how to build this app using the Twitter and NASA APIs. To see the app in action, check out the Twitter page &lt;a href="https://twitter.com/dailynasa" rel="noopener noreferrer"&gt;@DailyNASA&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  What will we be doing today?
&lt;/h2&gt;

&lt;p&gt;Our app is going to be hosted on &lt;a href="https://glitch.com/~dailynasa" rel="noopener noreferrer"&gt;Glitch&lt;/a&gt;, so we won't be doing much except making sure our app is properly configured.&lt;/p&gt;

&lt;p&gt;Once our project has been remixed and the &lt;code&gt;.env&lt;/code&gt; file's keys and tokens properly configured, we'll schedule a cron-job to make our app Tweet. A cron-job is essentially an automated wake-up call.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does the code work exactly?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The app will be activated via a webhook. The webhook will be pinged by our cron-job at a specified time of day ⏰&lt;/li&gt;
&lt;li&gt;Our app will connect to the NASA API 🚀&lt;/li&gt;
&lt;li&gt;The app will check if the media provided by the NASA API is an image URL or video URL. If it’s a photo, our app will download the image and Tweet it. If it’s a video, the app will just Tweet the video URL:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Video&lt;/strong&gt; 📹 - the app will save the video URL + title and Tweet this via the Twitter &lt;a href="https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update" rel="noopener noreferrer"&gt;statuses/update&lt;/a&gt; endpoint.  Here’s an &lt;a href="https://twitter.com/DailyNASA/status/1151477103306649604" rel="noopener noreferrer"&gt;example&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image&lt;/strong&gt; 📷 - the app will save the image to a temporary directory and Tweet this via the Twitter &lt;a href="https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update" rel="noopener noreferrer"&gt;statuses/update&lt;/a&gt; endpoint. Here’s an &lt;a href="https://twitter.com/DailyNASA/status/1161986403653292035" rel="noopener noreferrer"&gt;example&lt;/a&gt;. Because it's a temporary directory, we don't have to worry about filling up space (pun intended) 🥁&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we get started, you'll need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A Twitter developer account - &lt;a href="https://t.co/developeraccount" rel="noopener noreferrer"&gt;click here&lt;/a&gt; to apply&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A registered &lt;a href="https://developer.twitter.com/en/apps" rel="noopener noreferrer"&gt;Twitter app&lt;/a&gt; - &lt;a href="https://cdn.glitch.com/40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%2FScreen%20Shot%202019-08-08%20at%205.20.15%20PM%20copy.png?v=1565299668056" rel="noopener noreferrer"&gt;click here&lt;/a&gt; to see how&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A copy of your &lt;a href="https://developer.twitter.com/en/apps" rel="noopener noreferrer"&gt;Twitter API&lt;/a&gt; keys and tokens - &lt;a href="https://cdn.glitch.com/40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%2FScreen%20Shot%202019-08-08%20at%205.20.35%20PM%20copy.png?v=1565300041251" rel="noopener noreferrer"&gt;click here&lt;/a&gt; to see how&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A NASA API key 🔑 - &lt;a href="https://api.nasa.gov/#apply-for-an-api-key" rel="noopener noreferrer"&gt;click here&lt;/a&gt; to get one&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A cron-job account - &lt;a href="https://cron-job.org/en/signup/" rel="noopener noreferrer"&gt;click here&lt;/a&gt; to register&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have all of these, you're ready to launch 🚀!&lt;/p&gt;

&lt;h2&gt;
  
  
  Recipe
&lt;/h2&gt;

&lt;p&gt;Step 1 - 💿&lt;/p&gt;

&lt;p&gt;a) On our &lt;a href="https://glitch.com/~dailynasa" rel="noopener noreferrer"&gt;Glitch project page&lt;/a&gt;, remix this project! Click on the "Remix Project" button on the top left of this page.&lt;/p&gt;

&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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen%2520Shot%25202019-08-08%2520at%25203.54.26%2520PM.png%3Fv%3D1565294080315" 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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen%2520Shot%25202019-08-08%2520at%25203.54.26%2520PM.png%3Fv%3D1565294080315" alt="Remix" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b) Name your app.&lt;/p&gt;

&lt;p&gt;I called mine  &lt;code&gt;dailynasa&lt;/code&gt;&lt;/p&gt;

&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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen%2520Shot%25202019-08-08%2520at%25203.57.37%2520PM.png%3Fv%3D1565294269445" 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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen%2520Shot%25202019-08-08%2520at%25203.57.37%2520PM.png%3Fv%3D1565294269445" alt="Name" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2 - 🔑&lt;/p&gt;

&lt;p&gt;A) Enter your Twitter apps keys and tokens in the projects &lt;code&gt;.env&lt;/code&gt; file&lt;/p&gt;

&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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen1%2520Shot%25202019-08-08%2520at%25205.20.35%2520PM%2520copy.png%3Fv%3D1565300721909" 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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen1%2520Shot%25202019-08-08%2520at%25205.20.35%2520PM%2520copy.png%3Fv%3D1565300721909" alt="Keys" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;B) Enter your NASA API Key on the projects &lt;code&gt;.env&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;C) Give your app endpoint a name &lt;/p&gt;

&lt;p&gt;For example, if I label mine &lt;code&gt;wakeup&lt;/code&gt;, your &lt;code&gt;.env&lt;/code&gt; file should look like this: &lt;code&gt;BOT_ENDPOINT='awaken'&lt;/code&gt;. My final endpoint will look like this: &lt;code&gt;https://dailynasa.glitch.me/wakeup&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🚨 IMPORTANT - keep all access keys, tokens, and endpoint names private 🚨&lt;/p&gt;

&lt;p&gt;Step 3 - TESTING TESTING !!&lt;/p&gt;

&lt;p&gt;Now you've configured our app, let's test it out.&lt;/p&gt;

&lt;p&gt;I usually reccomend viewing the logs in Tools → Logs to verify our app runs when we wake it up. &lt;/p&gt;

&lt;p&gt;In a new browser window, enter your unique endpoint URL and hit enter. (You can also test the URL via your command line using the following command: &lt;code&gt;curl https://dailynasa.glitch.me/wakeup&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Give it a second, and on your Twitter account you should see the daily NASA Tweet posted!&lt;/p&gt;

&lt;p&gt;Now you've verified that it works, let's make sure that it's automated so you don't have to keep doing this every single day.&lt;/p&gt;

&lt;p&gt;Step 4 - ⏰ &lt;/p&gt;

&lt;p&gt;We'll be using &lt;a href="https://cron-job.org/en/" rel="noopener noreferrer"&gt;cron-job.org&lt;/a&gt; to ping our endpoint and make our app post a daily Tweet.&lt;/p&gt;

&lt;p&gt;Create a &lt;a href="https://cron-job.org/en/members/jobs/add/" rel="noopener noreferrer"&gt;new cron-job&lt;/a&gt; and fill out the page to this effect:&lt;/p&gt;

&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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen%2520Shot%25202019-08-08%2520at%25206.13.22%2520PM.png%3Fv%3D1565302473410" 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%2Fcdn.glitch.com%2F40a2e399-2bcb-4c11-b356-fdb1d9baa5e9%252FScreen%2520Shot%25202019-08-08%2520at%25206.13.22%2520PM.png%3Fv%3D1565302473410" alt="cron-job" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚨 IMPORTANT - scheduling your app to run too frequently can seem spammy and lead to violation of Twitters &lt;a href="https://help.twitter.com/en/rules-and-policies/twitter-automation" rel="noopener noreferrer"&gt;automation policy&lt;/a&gt;. 🚨&lt;/p&gt;

&lt;p&gt;Once a job has run, you can view the response on &lt;a href="https://cron-job.org/en/members/jobs/" rel="noopener noreferrer"&gt;this page&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;And just like that, we're done!&lt;/p&gt;

&lt;h2&gt;
  
  
  Congratulations!
&lt;/h2&gt;

&lt;p&gt;You did it! 😎 &lt;/p&gt;

&lt;p&gt;If you enjoy learning from tutorials or have any questions, check out &lt;a href="https://twittercommunity.com/" rel="noopener noreferrer"&gt;Twitter’s Community Forums&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>twitter</category>
      <category>bot</category>
      <category>api</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
