<?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: tobe </title>
    <description>The latest articles on DEV Community by tobe  (@tobenxe).</description>
    <link>https://dev.to/tobenxe</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%2F190161%2Fa7431468-7cf2-4b6f-850f-327d6042a60c.jpeg</url>
      <title>DEV Community: tobe </title>
      <link>https://dev.to/tobenxe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tobenxe"/>
    <language>en</language>
    <item>
      <title>Tips for Programming with a low end PC.</title>
      <dc:creator>tobe </dc:creator>
      <pubDate>Fri, 17 Jul 2020 15:55:10 +0000</pubDate>
      <link>https://dev.to/tobenxe/tips-for-programming-with-a-low-end-pc-42aa</link>
      <guid>https://dev.to/tobenxe/tips-for-programming-with-a-low-end-pc-42aa</guid>
      <description>&lt;p&gt;DISCLAIMER: The term low-end is subjective, this is intended to help anyone with a less than powerful pc.&lt;/p&gt;

&lt;p&gt;For the past few months I've been using a laptop with 4 GB RAM for working, learning and just about everything. My experience plus this  twitter thread by &lt;a href="https://twitter.com/traversymedia/status/1277348235980484619" rel="noopener noreferrer"&gt;Brad Traversy&lt;/a&gt; (Who is a great teacher btw) sort of inspired me to write this. Turns out that there are LOTS of developers with high end PC's but also lots of developers with arguably low end one's as well.&lt;/p&gt;

&lt;p&gt;If you were just starting out or even a professional programmer, you'd imagine you'd need a lot of stuff. If you ever have to, it's 100% possible to code with a low end PC.&lt;/p&gt;

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



&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Most of this applies to web application development. If you are developing games or training machine learning models locally then idk man, hopefully someone in the comments can help. (although i know google colab works for machine learning)&lt;/p&gt;

&lt;h2&gt;The Editor&lt;/h2&gt;

&lt;p&gt;Programming largely involves typing text and hoping the text makes sense to the computer, preferably with tools that make this easier. Most full on IDE's take up lots of RAM, which is a resource we can't really spare especially when you have other things open like several browser tabs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution: &lt;/strong&gt;A code editor, not an IDE (anti-climactic, I know.)&lt;/p&gt;

&lt;h3&gt;Local Editors's&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Visual Studio Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a very popular code editor that is "IDE like", it's lovely. Although a computer with around 2-4GB of RAM can run it. It isn't exactly known for being conservative with RAM. Here are some things you can  do:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip 1: Disable unnecessary extensions!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used to have some extensions on that weren't exactly relevant to what I was doing. Disabling them will should reduce the memory footprint of VSCode. You can find out how to do this &lt;a href="https://code.visualstudio.com/docs/editor/extension-gallery#_manage-extensions" rel="noopener noreferrer"&gt;here&lt;/a&gt;. After my research, this really is one of the best approaches when using VSCode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Excluding files from  filewatcher&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can stop VSCode from "watching"/tracking certain files for changes. You can do this in your VSCode &lt;a href="https://code.visualstudio.com/docs/getstarted/settings" rel="noopener noreferrer"&gt;settings&lt;/a&gt; . By default it has stuff like  node_modules and git objects excludes but you can use a glob pattern (&lt;a href="https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns" rel="noopener noreferrer"&gt;A useful guide on them&lt;/a&gt;) of file paths to add any thing else there.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;"files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/node_modules/**": true,
//Add in your other glob patterns
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A few people have suggested sublime text so you can give that a try.&lt;/p&gt;

&lt;p&gt;This is all great. However, If you have even lower specs or are working on a somewhat larger project, your PC may start to struggle if you have other things open. So switching to an even lighter editor would help. There are many great ones: some suggestions are Notepad ++ OR VIM.&lt;/p&gt;

&lt;p&gt;Regarding something like VIM, while it is really lightweight, it takes sometime to get really good/efficient. Once you do learn, it is really nice not having to touch your mouse as much. Also when you code it makes you look like every non-programmer's idea of a programmer.&lt;/p&gt;

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

&lt;p&gt;Upside is you don't have to touch your mouse as much, The downside is that you have to learn vim :*&lt;/p&gt;

&lt;h3&gt;Another Solution: Online IDE's&lt;/h3&gt;

&lt;p&gt;Here is another avenue that is great for several purposes. Online IDE's are pretty nice now. This especially true if you develop with many programming languages (Like PHP) and can't be bothered to setup a local dev environment. You also get the freedom to write code on anything with an internet  connection. &lt;/p&gt;

&lt;p&gt;They also happen to be pretty great for sharing code and working with other people quickly. Most computers have some browser and that's all you need.&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%2Ftobenxe.com%2Fwp-content%2Fuploads%2F2020%2F07%2FonlineIDES.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%2Ftobenxe.com%2Fwp-content%2Fuploads%2F2020%2F07%2FonlineIDES.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a few options: &lt;a href="https://repl.it/" rel="noopener noreferrer"&gt;Repl.it&lt;/a&gt; from my personal experience is pretty amazing, they support so many  languages and allow you to run code and use a custom domain for your work. Plus &lt;a href="https://repl.it/site/multiplayer" rel="noopener noreferrer"&gt;multiplayer&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/" rel="noopener noreferrer"&gt;Codepen&lt;/a&gt; is another option which is pretty popular for sharing HTML./CSS/JS code, I used it a lot when I first started out with web dev about 3-ish years ago. There is also  &lt;a href="https://codesandbox.io/" rel="noopener noreferrer"&gt;Codesandbox&lt;/a&gt;, which looks good, it appears to be a VSCode editor in the browser. &lt;/p&gt;

&lt;p&gt;(I may be missing a few other good online editors but these one's are top of mind)&lt;/p&gt;

&lt;h2&gt;Extra Tools/Tips&lt;/h2&gt;

&lt;h3&gt;Storage&lt;/h3&gt;

&lt;p&gt;Many low end PCs are at times plagued with low storage space. The best advice I have here is to only store projects you work on 24/7 on your machine, instead just commit the files to git and push to a hosted or self-hosted repository.&lt;/p&gt;

&lt;h3&gt;Chrome Extensions&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Great Suspender&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While I did mention keeping extension/plugins to the absolute minimum. Because programming often involves a lot of open browser tabs (Which you will most likely hoard or forget to close). I recommend this extension.&lt;/p&gt;

&lt;p&gt; Like the name suggests, it suspends idle tabs (you can configure how it works and exclude certain tabs based on some features).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An adblocker (ublock Origin)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think most people who work anywhere near tech already have this. If you don't many sites loading trackers can have an impact on browsing speed. So this comes in handy.&lt;/p&gt;

&lt;h3&gt;Browsers &amp;amp; Browser Windows&lt;/h3&gt;

&lt;p&gt;Although I can't really give you the textbook explanation. One thing I do is work in a window where I am not  logged in to anything. Not only does this help productivity but generally it makes my browser run faster, even searching stuff gets faster as well (my guess is that over-personalization can make things sluggish). &lt;/p&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;When you think about it most people who actually use what you make may not be on the best computers in the world so I guess you get to live their experience and avoid unnecessary fluff. &lt;/p&gt;

&lt;p&gt;Whenever you are able to, upgrade your computer! it'll probably be a decent investment. From my experience the most important specs are RAM and SSD.&lt;/p&gt;

&lt;p&gt;There are probably a million more little things you can do to make your computer more efficient. If you have any other tips, please leave a comment . I can edit the post and cite you :)&lt;/p&gt;

&lt;p&gt;Original Blog: &lt;a href="https://tobenxe.com/tips-for-programming-with-a-low-end-pc/" rel="noopener noreferrer"&gt;https://tobenxe.com/tips-for-programming-with-a-low-end-pc/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you enjoyed the post you can follow me on twitter:  &lt;a href="https://twitter.com/tobenxe/" rel="noopener noreferrer"&gt;https://twitter.com/tobenxe/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>vscode</category>
      <category>tutorial</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Building a netlify lambda function to turn twitter lists into email digests.</title>
      <dc:creator>tobe </dc:creator>
      <pubDate>Tue, 07 Apr 2020 15:06:19 +0000</pubDate>
      <link>https://dev.to/tobenxe/building-a-netlify-lambda-function-to-turn-twitter-lists-into-email-digests-3ock</link>
      <guid>https://dev.to/tobenxe/building-a-netlify-lambda-function-to-turn-twitter-lists-into-email-digests-3ock</guid>
      <description>&lt;p&gt;I'm probably not the only one who feels overwhelmed by the overall panic on social media right now.&lt;/p&gt;

&lt;blockquote class="wp-block-quote"&gt;&lt;p&gt;I've decided to code some sanity back into my life by creating a netlify lambda function that emails me tweets once a day.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://github.com/tobenxe/twitter-digest"&gt;Github Link&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Tutorial: Setting Up&lt;/h2&gt;

&lt;p&gt;Things we need&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A free sendgrid account and API key&lt;/li&gt;
&lt;li&gt;A netlify account&lt;/li&gt;
&lt;li&gt;A twitter API key and API secret&lt;/li&gt;
&lt;li&gt;A public twitter list&lt;/li&gt;
&lt;li&gt;A cron job service that allows you to set headers (what I found: &lt;a href="http://cron-job.org"&gt;cron-job.org&lt;/a&gt; — free, &lt;a href="http://easycron.com"&gt;easycron.com&lt;/a&gt; - free trial) or if you have a server you should be able to set this up yourself.&lt;/li&gt;
&lt;li&gt;Some understanding of Javascript &amp;amp; HTTP.&lt;/li&gt;
&lt;li&gt;An email&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We need to create a node project and install dependencies. Run the following commands in your project directory. You should have a package.json/package-lock.json file and a node_modules folder afterwards.&lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;npm init -y
npm i netlify-lambda @sendgrid/mail encoding twitter-lite dotenv-webpack
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;netlify-lambda - helps with  bundling and local development.&lt;/p&gt;

&lt;p&gt;@sendgrid/mail -  helps us use  sendgrid's mail API&lt;/p&gt;

&lt;p&gt;twitter-lite - a wrapper for twitter's API&lt;/p&gt;

&lt;p&gt;dotenv-webpack -  setting local development environment variables (not covered in this post check out the github repo)&lt;/p&gt;

&lt;p&gt;encoding -  was installed to solve a deployment error I encountered (&lt;a href="https://github.com/netlify/netlify-lambda/issues/142#issuecomment-483880089"&gt;issue&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;Project folder structure&lt;/h3&gt;

&lt;p&gt;Create the following files according to the structure below. (node modules, package-lock.json and package.json should already be there)&lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;node_modules/ 
src/
  lambda/
    digest.js 
  utils/
    twitter.js 
    sendgrid.js 
    email.js 
netlify.toml 
.gitignore 
package.json 
package-lock.json 
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Creating the digest&lt;/h2&gt;

&lt;p&gt;We have to do 3 things (Only 2 of which require writing code):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get tweets from a twitter list.&lt;/li&gt;
&lt;li&gt;Send out an email containing those tweets.&lt;/li&gt;
&lt;li&gt;Schedule emails to be sent every day (or whenever) with &lt;a href="http://cron-job.org"&gt;cron-job.org&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Below is our lambda function (digest.js) which brings together the different components of the function.&lt;/p&gt;

&lt;p&gt;The first thing we do is add some basic authorization and validation of the request. A valid request to the function needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have a request method of POST&lt;/li&gt;
&lt;li&gt;Have an authorization header&lt;/li&gt;
&lt;li&gt;Have the proper value in its authorization header&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NOTE: I will be using process.env to refer to variables that would be set later on when deployed.&lt;/p&gt;

&lt;p&gt;I am returning the status code of 404 in order to avoid revealing whether the endpoint exists. My rationale is that 404 - Not Found is more likely to deter some bored spammer/attacker than 401 - Unauthorized. &lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;//digest.js
const twitter = require('../utils/twitter');
const sendGrid = require('../utils/sendgrid');

exports.handler = async (event, context)=&amp;gt;{
         try{
             //Validate the request method and the authorization header
             if(event.httpMethod != 'POST') return {statusCode: 404}
             if(!event.headers.authorization)  return {statusCode: 404};

             //check for valid authorization value
             const basicAuth = (new Buffer(`${process.env.AUTH_USER}:${process.env.AUTH_PASS}`)).toString('base64')
             if(event.headers.authorization.split(' ')[1] !== basicAuth) return {statusCode: 404};

             //Get tweets
             const tweets = await twitter();

             //Send email if there are tweets available
             if(tweets.length &amp;gt; 0) await sendGrid(tweets);

             // success
             return {statusCode: 200}
             
         }catch(err){
             console.log(err)
             //error
             return {statusCode: 500}
         }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The rest of the function involves calling the modules we imported at the top. One is a function that authenticates with twitter and gets tweets from our list (twitter.js). The other sends out our email (sendgrid.js).&lt;/p&gt;

&lt;h3&gt;1) Getting tweets from our twitter list&lt;/h3&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;//File - twitter.js
const Twitter = require('twitter-lite')
module.exports = async () =&amp;gt; { 
    //a) authenticate with twitter
    const user = new Twitter({
      consumer_key: process.env.TWITTER_KEY,
      consumer_secret: process.env.TWITTER_SECRET
    });
    const response = await user.getBearerToken();
    const app = new Twitter({
      bearer_token: response.access_token
    });

     //b) get tweets from list
    const data = await app.get('lists/statuses', {
                                list_id: process.env.TWITTER_LIST_ID,
                                tweet_mode: 'extended'
                            })

     //c) get only the necessary data &amp;amp; return tweets
    const tweets = data.map(tweet=&amp;gt;{
        return {
            text: tweet.full_text, 
            user:tweet.user.screen_name,
            url: `https://twitter.com/${tweet.user.screen_name}/status/${tweet.id_str}`
        }
    })

    return tweets;
     
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;a) We installed a package called twitter-lite which is a wrapper for the twitter api. To authenticate we just need our twitter api key (TWITTER_KEY) and twitter api secret (TWITTER_SECRET) passed into the packages Twitter function. &lt;/p&gt;

&lt;p&gt;Twitter's API has user authentication and app authentication. We are using app authentication we just need a bearer token to start making requests to twitter's api. The package takes care of basically everything, you can see the full documentation for twitter-lite &lt;a href="https://github.com/draftbit/twitter-lite"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b) We can use twitter-lite to get tweets from a list by calling the get method on "app". The object being passed into app.get( ) contains the query parameters needed for &lt;a href="https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses"&gt;twitter's lists/statuses endpoint&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This includes the id of the twitter list(list_id) and whether we'd like to get the full tweet versus a truncated version of the tweet (tweet_mode). It returns an array of tweet objects when done.&lt;/p&gt;

&lt;p&gt;c) Once we have the tweets, we only need a few bits of information (the tweet text, the username of the "tweeter" and the tweet URL). Using the array map method we can create a new array that only contains the necessary data from each tweet.&lt;/p&gt;

&lt;h3&gt;2) Sending the email.&lt;/h3&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;//sendgrid.js
//a) set sendgrid's api key
const sgMail = require('@sendgrid/mail');
const createHtmlEmail = require('./email');
sgMail.setApiKey(process.env.SENDGRID_KEY); 

module.exports = (tweets) =&amp;gt; {
    return sgMail.send({ 
            to: process.env.MY_EMAIL,
            from: process.env.MY_EMAIL,
            subject: 'Your Tweet Digest',
            html: createHtmlEmail(tweets), //b) create html email &amp;amp; send
            });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;a) Here we import &lt;a href="https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/mail"&gt;sendgrid's npm package&lt;/a&gt;, set the api key for sendgrid and import the module that helps us create the HTML email containing the tweets.&lt;/p&gt;

&lt;p&gt;b) sgMail.send( ) takes in an object with some information about the email we need to send. To get the value for the "html" property we call createHtmlEmail and pass in our tweets.&lt;/p&gt;

&lt;p&gt;Here is what goes on inside the createHtmlEmail function. We are essentially inserting our tweet data into html and returning a string of html. This is very easy to do thanks to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals"&gt;template literals&lt;/a&gt;.&lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;//File - email.js
//creates the html email
module.exports = (tweets) =&amp;gt; {
    let tweetElements = '';

    //insert tweet data into elements
    tweets.forEach(tweet=&amp;gt;{
       tweetElements += `
                &amp;lt;div style = "width: 100%; border: 1px solid black; margin-bottom:10px; padding: 10px "&amp;gt;
                &amp;lt;p&amp;gt;@${tweet.user}&amp;lt;/p&amp;gt;
                &amp;lt;p&amp;gt;${tweet.text}&amp;lt;/p&amp;gt;
                &amp;lt;a style="color: white; padding:5px; background: black; text-decoration:none" href="${tweet.url}"&amp;gt;Read Tweet &amp;lt;/a&amp;gt;
                &amp;lt;/div&amp;gt;
               `
    })
    //Wrap tweet elements in a div
    let email = `   
        &amp;lt;div style = "width: 40rem; font-size: 1.2rem; margin: 0 auto"&amp;gt;
            ${tweetElements}
        &amp;lt;/div&amp;gt;
    
    `;
 
    return email;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;sgMail.send() returns a promise which is why we use the await keyword in our lamda function(digest.js).&lt;/p&gt;

&lt;h2&gt;Deploy the function !&lt;/h2&gt;

&lt;p&gt;Before we deploy, we  need to edit a few files&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;package.json - adding a build script &lt;/li&gt;
&lt;li&gt;netlify.toml - adds a build command and lets netlify know what folder our function is in (src/lambda)&lt;/li&gt;
&lt;li&gt;.gitignore - removes our node_modules folder from git tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;//package.json
"scripts": {
    "build:lambda": "netlify-lambda build src/lambda"
}

//netlify.toml
[build]
  Command = "npm run build:lambda"
  Functions = "lambda" 

//.gitignore
node_modules/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we can commit the project to github.&lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;git init
git remote add origin &amp;lt;link to git repository&amp;gt;
git add .
git commit -m "commit message"
git push origin master&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We can now login to netlify. You should see the option to create a new site from git, once you click that you'll go through a 3 step process where you choose your git provider, authorize netlify and pick a repository. The most important is step 3 where we have build options.&lt;/p&gt;

&lt;p&gt;Clicking "Show Advanced" then "new variable" should let you add environment variables (the process.env prefixed stuff throughout the code).&lt;/p&gt;

&lt;p&gt;Here is a list of the variables that need to be set&lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;Name:           Description:
TWITTER_KEY     your twitter API key
TWITTER_SECRET  your twitter API secret
AUTH_USER       a username (does not have to be your twitter username, just come up with something)
AUTH_PASS       a password (does not have to be your twitter password, just come up with something)
YOUR_EMAIL      your email
TWTTER_LIST_ID  id of your twitter list, it is simply the numbers at the end of the URL when you are on your twitter list
Example:  &amp;lt;https://twitter.com/i/lists/1234&amp;gt; will have a TWITTER_LIST_ID of 1234
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;a href="https://github.com/tobenxe/twitter-digest#usage"&gt;github repository&lt;/a&gt; explains some of these environment variables a bit better. After filling in the environment variables the project can be deployed.&lt;/p&gt;



&lt;h2&gt;Scheduling the function to run every day.&lt;/h2&gt;

&lt;p&gt;You should be able to access your function's url like this:&lt;/p&gt;

&lt;pre class="wp-block-code"&gt;&lt;code&gt;https://[DEPLOY_URL]/.netlify/functions/digest.js
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;[DEPLOY_URL] represents the site url shown in netlify's overview dashboard for your deployed site. For example if your site's url is &lt;a href="http://example.netlify.app"&gt;example.netlify.&lt;/a&gt;com then your function url is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://example.netlify.com/.netlify/functions/digest.js"&gt;https://example.netlify.com/.netlify/functions/digest.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'll be using a cron job on &lt;a href="https://cron-job.org"&gt;https://cron-job.org&lt;/a&gt; to call the function's url daily. After signing up on the site you should be brought into a members panel where you can click "Cronjobs" on the upper left navigation bar then click "create cronjob".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wlpbwXBi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Ai7hmMa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wlpbwXBi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Ai7hmMa.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now fill out the form&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Title - Any name you want&lt;/li&gt;
&lt;li&gt;Address - your function url (https://....)&lt;/li&gt;
&lt;li&gt;Check "Requires HTTP authentication"&lt;ul&gt;
&lt;li&gt;User - same as AUTH_USER set previously&lt;/li&gt;
&lt;li&gt;Password - same as AUTH_PASS set previously&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Schedule - set the schedule for any time interval (I'm using every day)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you are done with that, click "create cronjob". You'll be redirected to a page listing your current cronjobs, now find the newly created job and click "edit".  &lt;/p&gt;

&lt;p&gt;In the edit form page you can scroll down to find "Advanced Settings" which allows you to change the request method from GET to POST then save the form.&lt;/p&gt;

&lt;p&gt;and.....&lt;/p&gt;

&lt;p&gt; That's it! &lt;/p&gt;

&lt;h2&gt;Results! :D&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aAFRDrDG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.imgur.com/Px4vvMY.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aAFRDrDG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.imgur.com/Px4vvMY.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks decent.&lt;/p&gt;

&lt;p&gt;There are lots of improvements to be made of course, so if you have some ideas to improve it you can go ahead and contribute to the project on &lt;a href="https://github.com/tobenxe/twitter-digest"&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;: D&lt;/p&gt;



&lt;h2&gt;Resources:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/tobenxe/twitter-digest"&gt;Github Repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tobenxe.com/building-a-netlify-lambda-function-to-turn-twitter-lists-into-email-digests/"&gt;Original Blog Post&lt;/a&gt;&lt;/p&gt;

</description>
      <category>twitter</category>
      <category>javascript</category>
      <category>netlify</category>
      <category>serverless</category>
    </item>
  </channel>
</rss>
