<?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: Sagun Shrestha</title>
    <description>The latest articles on DEV Community by Sagun Shrestha (@sagunsh).</description>
    <link>https://dev.to/sagunsh</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%2F320783%2Fb7c9c2eb-952c-4e52-b942-11d6afbb725d.jpg</url>
      <title>DEV Community: Sagun Shrestha</title>
      <link>https://dev.to/sagunsh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sagunsh"/>
    <language>en</language>
    <item>
      <title>Product Hunt 2020 Analysis</title>
      <dc:creator>Sagun Shrestha</dc:creator>
      <pubDate>Sun, 10 Jan 2021 10:40:39 +0000</pubDate>
      <link>https://dev.to/sagunsh/product-hunt-2020-analysis-4mpf</link>
      <guid>https://dev.to/sagunsh/product-hunt-2020-analysis-4mpf</guid>
      <description>&lt;h4&gt;
  
  
  &lt;strong&gt;Analysis of products launched on Product Hunt in 2020&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Product Hunt provides &lt;a href="https://api.producthunt.com/v1/docs"&gt;an API&lt;/a&gt; to programmatically consume data from their website. If you are not familiar with Product Hunt, it is a website where people share their cool products. A lot of products get submitted to Product Hunt every day. Unfortunately, not all of them will be &lt;a href="https://help.producthunt.com/en/articles/484926-i-submitted-something-and-i-don-t-see-it-on-the-homepage-why"&gt;featured on the home page&lt;/a&gt;. It has become a goto place for indie developers to get traction for their product.&lt;/p&gt;

&lt;p&gt;In this article, I will share a few of my findings about the product that was released in 2020. I have also made a basic &lt;a href="https://ph2020.sagunshrestha.com/"&gt;single page website&lt;/a&gt; where you can browse these products.&lt;/p&gt;

&lt;p&gt;Now let's get started with the analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Featured Products - 9147&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per day average - 24.99 [9147/366 =&amp;gt; 2020 was a leap year]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total Categories - 239&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total Votes - 2730981&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Average Votes per Product - 298.56&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Most voted products&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You can find the most voted products of 2020 by going to the website and sorting by votes or simply click &lt;a href="https://ph2020.sagunshrestha.com/?sort=votes&amp;amp;type=desc"&gt;this link&lt;/a&gt;. You can also view top products for each category by visiting the category page. The top 5 products were:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/easy-bloggers-3"&gt;Easy Bloggers&lt;/a&gt; - 6252&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/moonshot-7"&gt;Moonshotº&lt;/a&gt; - 5441&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/slazzer-2"&gt;SLAZZER&lt;/a&gt; - 5356&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/hey-62dbfc18-c745-4d86-9a5b-a23a1f4d9eb3"&gt;HEY&lt;/a&gt; - 5309&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/fluently-beta"&gt;Fluently Beta&lt;/a&gt; - 5017&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Products by Category&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tyWbJQ-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c3fb1ga1gc6zgbl3ks26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tyWbJQ-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c3fb1ga1gc6zgbl3ks26.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most popular category was Productivity (3316) followed by Tech (2833) and iPhone (1523).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Day of Week&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZL20IfrC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u5axsh0j1wc45saf6wyh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZL20IfrC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u5axsh0j1wc45saf6wyh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tuesday (1613) and Wednesday (1601) are the winners with Sunday (952)and Saturday (939)being the least popular day for product launch. In general, weekdays are more popular than weekends for launch.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Android vs IPhone&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i5BBWJ9j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hmqmw7ecj05r3ror4fmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i5BBWJ9j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hmqmw7ecj05r3ror4fmv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The number of products tagged &lt;a href="https://ph2020.sagunshrestha.com/category/iphone"&gt;iPhone&lt;/a&gt; were about double as compared to &lt;a href="https://ph2020.sagunshrestha.com/category/android"&gt;Android&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Mac vs Windows&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LdoGNif---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ln8trh909vjhxnorlbg5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LdoGNif---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ln8trh909vjhxnorlbg5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;282 products were tagged &lt;a href="https://ph2020.sagunshrestha.com/category/mac"&gt;Mac&lt;/a&gt; while only 54 for &lt;a href="https://ph2020.sagunshrestha.com/category/windows"&gt;Windows&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Browser Extensions - Chrome vs Firefox vs Safari&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gn82ujje--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0dyj79wo24otvtaonzp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gn82ujje--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0dyj79wo24otvtaonzp6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As expected, Chrome is dominating the browser extensions category. I couldn't find a separate category for other browsers like Opera.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Number of Maker(s)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BP2aSkDX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qms5oivrm6ip0fwnsowd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BP2aSkDX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qms5oivrm6ip0fwnsowd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Over half of the products featured in 2020 were made by 1 maker. Surprisingly I found 650 products with no makers. Also there were a few products with a huge number of makers like &lt;a href="https://www.producthunt.com/posts/pitch-8"&gt;Pitch&lt;/a&gt; (52) and &lt;a href="https://www.producthunt.com/posts/framer-for-web"&gt;Framer for Web&lt;/a&gt; (41).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Hunters on Product Hunt&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You can either hunt your own product or ask someone else to do this. In my analysis, I found 5638 hunters who hunted at least 1 product in 2020.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9pzPWbS6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vubk1efs1be8k983eut5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9pzPWbS6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vubk1efs1be8k983eut5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As expected, &lt;a href="https://www.producthunt.com/@chrismessina"&gt;Chris Messina&lt;/a&gt; who is the #1 hunter on Product Hunt hunted the most products in 2020 with 465.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;And Finally!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;That's all for Product Hunt in 2020. If you have more ideas on how to explore the data, do let me know in the comments. And if you need the data, you can fetch it using &lt;a href="https://api.producthunt.com/v1/docs"&gt;Product Hunt's API&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>producthunt</category>
      <category>api</category>
      <category>python</category>
    </item>
    <item>
      <title>Connect Google Sheets with 3rd Party API Using Apps Script</title>
      <dc:creator>Sagun Shrestha</dc:creator>
      <pubDate>Thu, 23 Jul 2020 11:18:13 +0000</pubDate>
      <link>https://dev.to/sagunsh/connect-google-sheets-to-3rd-party-api-using-apps-script-46dj</link>
      <guid>https://dev.to/sagunsh/connect-google-sheets-to-3rd-party-api-using-apps-script-46dj</guid>
      <description>&lt;p&gt;Apps Script, as &lt;a href="https://developers.google.com/apps-script/overview" rel="noopener noreferrer"&gt;defined by Google&lt;/a&gt; is a rapid application development platform that makes it fast and easy to create business applications that integrate with G Suite. Basically it allows you to write codes for Google's services like Gmail, Google Drive, Sheets, Calendar, etc to automate your workflow or interact with external services. The code is written in JavaScript and you can execute it from the browser which runs on Google's server. So you don't need to install anything extra.&lt;/p&gt;

&lt;p&gt;If you want to skip everything and head over to the code, it's on &lt;a href="https://gist.github.com/sagunsh/f882d63a4fe800f5d9b090391239069f" rel="noopener noreferrer"&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we will write scripts using Apps Script to fetch data from an external API and populate it in a Google Sheet. You will need 2 things: a gmail account and an external API. We will be using the API provided by &lt;a href="https://datanews.io/" rel="noopener noreferrer"&gt;Datanews&lt;/a&gt;. Datanews provides news in JSON format via their API and has a free plan. Head over to their site, sign up for the service and get your free API.&lt;/p&gt;

&lt;p&gt;Create a new google sheet and give it a name as you like. Then go to &lt;strong&gt;Tools &amp;gt; Script Editor&lt;/strong&gt; from the menu. An editor will open in a new tab, give the project a name in the top left.&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%2Fi%2Fmaekaez2tek640yfcxm8.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmaekaez2tek640yfcxm8.PNG" alt="Script Editor Interface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's time to start writing some code. Let's start with Hello World.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  var text = "Hello World";
  Logger.log(text);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Logger.log&lt;/code&gt; is equivalent to &lt;code&gt;console.log&lt;/code&gt; from normal JavaScript. Save the project and run the script from the menu. To view the logs, goto &lt;strong&gt;View &amp;gt; Logs&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffppbvtekem9entkupple.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffppbvtekem9entkupple.PNG" alt="Apps Script Log"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Connect API&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Moving on, we will fetch some data from the API. The &lt;a href="https://datanews.io/docs" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; is pretty straightforward. I will be using the headlines endpoint to fetch news headlines. Let's fetch news that contains the word "travel" in it. You API url will look like this&lt;/p&gt;

&lt;p&gt;&lt;a href="http://api.datanews.io/v1/headlines?q=travel&amp;amp;apiKey=your-api-key" rel="noopener noreferrer"&gt;http://api.datanews.io/v1/headlines?q=travel&amp;amp;apiKey=your-api-key&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clear all the codes and replace it with the following. Initialize the &lt;code&gt;API_KEY&lt;/code&gt; variable with your API Key.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  var API_KEY = "your api key";
  var url = "http://api.datanews.io/v1/headlines?q=travel&amp;amp;apiKey=" + API_KEY;
  var response = UrlFetchApp.fetch(url);
  var data = JSON.parse(response.getContentText());
  var results = data.hits;

  results.forEach(function (result) {
    Logger.log(result.title);
  });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;UrlFetchApp.fetch&lt;/code&gt; is used to send requests to the API url. The response is a JSON string which is converted to object. Then we are looping through the &lt;code&gt;hits&lt;/code&gt; array which contains news objects and finally printing the headlines.&lt;/p&gt;

&lt;p&gt;When you run the code for the first time, you will be asked to review some permissions. Don't worry about the warning and allow all the required permissions.&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%2Fi%2Fvh4mpblu827niap9nkdq.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvh4mpblu827niap9nkdq.PNG" alt="Review Permission"&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvnzyoxnycigxj0v5276j.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvnzyoxnycigxj0v5276j.PNG" alt="Confirm Access"&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F281xnxr1xldofscrwnuo.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F281xnxr1xldofscrwnuo.PNG" alt="Allow Access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the script finishes execution, check the logs to see the headlines being printed.&lt;/p&gt;

&lt;p&gt;Let's make a few changes in our code to write the data into google sheets. We will create a nested object containing the news and define a range of rows and columns where the data is written. Modify your code so it looks like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  var API_KEY = "your api key";
  var url = "http://api.datanews.io/v1/headlines?q=travel&amp;amp;apiKey=" + API_KEY;
  var response = UrlFetchApp.fetch(url);
  var data = JSON.parse(response.getContentText());
  var results = data.hits;

  var sheet = SpreadsheetApp.getActiveSheet();

  var header = ["Title", "Description", "URL", "Published Date"]
  var items = [header];

  results.forEach(function (result) {
      items.push([result.title, result.description, result.url, result.pubDate]);
  });
  sheet.getRange(1,1,items.length,items[0].length).setValues(items);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#getActiveSheet()" rel="noopener noreferrer"&gt;SpreadsheetApp.getActiveSheet()&lt;/a&gt; gives us the current active spreadsheet. Then a list of headers is initialized which will be the first row in our sheet. Inside the loop, we are adding a list of title, description, url and published date to our nested array.&lt;/p&gt;

&lt;p&gt;Finally &lt;a href="https://developers.google.com/apps-script/reference/spreadsheet/sheet#getrangerow,-column,-numrows,-numcolumns" rel="noopener noreferrer"&gt;sheet.getRange()&lt;/a&gt; allows us to select the rows and columns to fill in the data. The first 2 parameters are the rows and columns to start with, hence 1. The third parameter is the number of rows to select which is the number of news items in our items array. and the last parameter defines the number of columns which is equal to the size of each array inside our nested array.&lt;/p&gt;

&lt;p&gt;Run the script, allow any permissions if required and on finishing the execution you will see the data printed on the sheet.&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%2Fi%2Fg0kqrr3ivl1duec355po.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg0kqrr3ivl1duec355po.PNG" alt="Date on Google Sheet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how you can connect with any API and populate data into google sheet.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Triggers&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We can also add triggers to run the script at a certain time like a cron job or in response to an event like on opening or editing the spreadsheet.&lt;/p&gt;

&lt;p&gt;To add trigger, goto &lt;strong&gt;Edit &amp;gt; Current project's triggers&lt;/strong&gt;. On the bottom right, click on Add Trigger.&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%2Fi%2Faoaia9iy8ey8ll89e4kw.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faoaia9iy8ey8ll89e4kw.PNG" alt="Add Trigger"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A menu will appear where you can configure when to run the script. To run it at a specific time or periodically, under Select event source select Time-driven and configure the settings as you want. You can run the script every hour, day, week or at a specific time as you want. If you have multiple functions, you can also select which function to run.&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%2Fi%2Fdy0evlpoq7gb27mj2po4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdy0evlpoq7gb27mj2po4.PNG" alt="Create Trigger"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Add Menu&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With apps script, you can also add a menu in your google sheet that will run a certain function. To add menu, goto script editor and right above myFunction add the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function addMenu() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Datanews API')
      .addItem('Get News','myFunction')
      .addToUi();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this function will do is add a menu in your google sheet through which you can run the script. Select addMenu function and run it once to create the menu.&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%2Fi%2F4m91gwbbi32amlfinbs8.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4m91gwbbi32amlfinbs8.PNG" alt="Add Menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running the function, head over to your google sheet and you will see a new menu "Datanews API" under which you will have another sub menu "Get news".&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%2Fi%2F5pgpynee2nnxzu4chwu0.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5pgpynee2nnxzu4chwu0.PNG" alt="Add Menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run the script, simply press on Get News. Similarly you can add multiple menus for different functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Apps Script is a handy tool that allows you to automate various things within Google's App. You can interact with Gmail, Google Drive, Calendar and a lot more using plain JavaScript code without installing anything locally. I hope this tutorial is useful for you to get started with apps script. You can do all kind of fancy stuffs with it.&lt;/p&gt;

&lt;p&gt;Liked this article? Let me know what you think in the comments. You can find me on &lt;a href="https://twitter.com/sagunsh" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>appsscript</category>
      <category>googlesheets</category>
      <category>api</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Remote Letter - Weekly newsletter for remote workers</title>
      <dc:creator>Sagun Shrestha</dc:creator>
      <pubDate>Wed, 24 Jun 2020 12:17:15 +0000</pubDate>
      <link>https://dev.to/sagunsh/remote-letter-weekly-newsletter-for-remote-workers-1i03</link>
      <guid>https://dev.to/sagunsh/remote-letter-weekly-newsletter-for-remote-workers-1i03</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PhF4Xtzn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ubixhe91mfto4pniufi8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PhF4Xtzn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ubixhe91mfto4pniufi8.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I launched &lt;a href="https://remoteletter.com"&gt;Remote Letter&lt;/a&gt; as a way to help and entertain digital nomads, freelancers and employees who have been forced to work for home because of the pandemic.&lt;/p&gt;

&lt;p&gt;Every Tuesday you will receive a email containing useful products, news and information, podcasts, interviews, discussions from Hacker News, Reddit and Twitter. This will help you keep updated with what's going in the Remote work world.&lt;/p&gt;

&lt;p&gt;To read our previous issues, visit &lt;a href="https://remoteletter.com/newsletter/1"&gt;newsletter&lt;/a&gt; section.&lt;/p&gt;

</description>
      <category>remote</category>
      <category>freelancing</category>
      <category>wfh</category>
    </item>
    <item>
      <title>Most used tags in Stack Overflow from 2012 to 2019</title>
      <dc:creator>Sagun Shrestha</dc:creator>
      <pubDate>Sun, 26 Jan 2020 15:37:52 +0000</pubDate>
      <link>https://dev.to/sagunsh/most-used-tags-in-stack-overflow-from-2012-to-2019-2464</link>
      <guid>https://dev.to/sagunsh/most-used-tags-in-stack-overflow-from-2012-to-2019-2464</guid>
      <description>&lt;p&gt;Obsessed with racing bar charts, I decided to create one. Check out my first video on youtube &lt;a href="https://www.youtube.com/watch?v=CnULKIDQbJw"&gt;https://www.youtube.com/watch?v=CnULKIDQbJw&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope you all like it.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>stackoverflow</category>
      <category>visualization</category>
    </item>
  </channel>
</rss>
