{"id":10150,"date":"2017-05-17T10:16:47","date_gmt":"2017-05-17T10:16:47","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=10150"},"modified":"2019-04-02T10:23:28","modified_gmt":"2019-04-02T10:23:28","slug":"posting-a-tweet-with-the-esp8266","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/posting-a-tweet-with-the-esp8266\/","title":{"rendered":"Posting a Tweet with the ESP8266"},"content":{"rendered":"<p>In this project\u00a0you\u2019re going to post a Tweet with\u00a0an ESP8266. The goal of this project is\u00a0to show the endless possibilities that this\u00a0$4 WiFi module offers when integrates with a free\u00a0platform that I&#8217;m about to show you.<!--more--><\/p>\n<p><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-10205\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/featured-image.png?resize=699%2C525&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"699\" height=\"525\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/featured-image.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/featured-image.png?resize=300%2C225&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/p>\n<p>In order to accomplish this task you have to sign up for one free service called IFTTT which stands for \u201cIf This Then That\u201d.<\/p>\n<p>IFTTT is a platform that gives you creative control over dozens of products and apps.<\/p>\n<p>You can make apps work together. For example when you send a request to IFTTT, it triggers a recipe that sends you an email alert.<\/p>\n<p>Before continue reading this project, please complete\u00a0the following tutorials:<\/p>\n<ul>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-esp8266-wifi-transceiver-review\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to get started with the ESP8266<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/flashing-nodemcu-firmware-on-the-esp8266-using-windows\/\" target=\"_blank\" rel=\"noopener noreferrer\">Flashing your ESP8266 with NodeMCU<\/a><\/li>\n<\/ul>\n<p>If you like the ESP and you want to do more projects\u00a0you can read my eBook <a href=\"https:\/\/randomnerdtutorials.com\/home-automation-using-esp8266\/\" target=\"_blank\" rel=\"noopener noreferrer\">Home Automation using ESP8266 here<\/a>.\u00a0<strong>Let&#8217;s get started!<\/strong><\/p>\n<h3>Creating Your IFTTT Account<\/h3>\n<p>Creating an account on IFTTT is free!<\/p>\n<p>Go the official site: <a href=\"https:\/\/ifttt.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ifttt.com\/<\/a> and click the \u201cSign Up\u201d button in the top of the page.<\/p>\n<p>Complete the form with your personal information (see Figure below) and create your account.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter size-full wp-image-10156\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/signup.png?resize=640%2C561&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"signup\" width=\"640\" height=\"561\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/signup.png?w=640&amp;quality=100&amp;strip=all&amp;ssl=1 640w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/signup.png?resize=300%2C263&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>After creating your account, follow their getting started tutorial.<\/p>\n<h2>Open the\u00a0Applet<\/h2>\n<p>I\u2019ve created an Applet that integrates perfectly in this project and you can also use it.<\/p>\n<p>If you\u2019re logged in at IFTTT and you open this URL below to use my Applet instantly:<\/p>\n<ul>\n<li><a href=\"https:\/\/ifttt.com\/applets\/316941p-post-a-tweet-with-the-esp8266\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ifttt.com\/applets\/316941p-post-a-tweet-with-the-esp8266<\/a><\/li>\n<\/ul>\n<p>Press the \u201cTurn on\u201d button:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter wp-image-39333\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/turn_applet_on.png?resize=320%2C525&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"320\" height=\"525\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/turn_applet_on.png?w=341&amp;quality=100&amp;strip=all&amp;ssl=1 341w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/turn_applet_on.png?resize=183%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 183w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/p>\n<p>Next, you need to grant access permissions to Maker Webhooks and Twitter.\u00a0Let your IFTTT account connect to your Twitter account. A new page loads when you finish connecting your Twitter.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-39332\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/configure.png?resize=346%2C659&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"346\" height=\"659\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/configure.png?w=346&amp;quality=100&amp;strip=all&amp;ssl=1 346w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/configure.png?resize=158%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 158w\" sizes=\"(max-width: 346px) 100vw, 346px\" \/><\/p>\n<h2>Complete the\u00a0Applet<\/h2>\n<p>Fill the Applet with your own information. Follow these instructions:<\/p>\n<ol>\n<li>Type \u201cpost_tweet\u201d in your event name<\/li>\n<li>Edit the text that you want to your ESP8266 to send out as a Tweet<\/li>\n<li>Press the \u201cSave\u201d button<\/li>\n<\/ol>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-39331\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/configure-2.png?resize=345%2C607&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"345\" height=\"607\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/configure-2.png?w=345&amp;quality=100&amp;strip=all&amp;ssl=1 345w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/configure-2.png?resize=171%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 171w\" sizes=\"(max-width: 345px) 100vw, 345px\" \/><\/p>\n<p>Now, go to this URL: <a href=\"https:\/\/ifttt.com\/maker_webhooks\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ifttt.com\/maker_webhooks<\/a>\u00a0and open the \u201c<strong>Settings<\/strong>\u201d tab.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-39182 size-full\" src=\"https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=826%2C320\" sizes=\"(max-width: 826px) 100vw, 826px\" srcset=\"https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?w=826 826w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=150%2C58 150w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=300%2C116 300w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=768%2C298 768w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=80%2C31 80w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=220%2C85 220w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=250%2C97 250w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=280%2C108 280w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=510%2C198 510w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/settings-tab.png?resize=750%2C291 750w\" alt=\"\" width=\"750\" height=\"290\" \/><\/p>\n<p>Copy you secret key to a safe place (you\u2019ll need them later in this project). In my example my secret key is: <span style=\"color: #ff0000;\"><strong><em>b6eDdHYblEv2Sy32qLwe<\/em><\/strong><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-39183\" src=\"https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/copy-ifttt-api-key.png?resize=525%2C406\" sizes=\"(max-width: 525px) 100vw, 525px\" srcset=\"https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/copy-ifttt-api-key.png?w=525 525w, https:\/\/i1.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2016\/02\/copy-ifttt-api-key.png?resize=300%2C232 300w\" alt=\"\" width=\"525\" height=\"406\" \/><\/p>\n<h2>Test Your\u00a0Applet<\/h2>\n<p>Let\u2019s test if your request is working properly. Replace YOUR_API_KEY from the following URL:<\/p>\n<p>https:\/\/maker.ifttt.com\/trigger\/post_tweet\/with\/key\/<span style=\"color: #ff0000;\"><strong>YOUR_API_KEY<\/strong><\/span><\/p>\n<p>With your API KEY:<\/p>\n<p>https:\/\/maker.ifttt.com\/trigger\/post_tweet\/with\/key\/<span style=\"color: #ff0000;\"><strong>b6eDdHYblEv2Sy32qLwe<\/strong><\/span><\/p>\n<p>Open your URL with your API KEY in your browser.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10155\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/browser.png?resize=671%2C382&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"browser\" width=\"671\" height=\"382\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/browser.png?w=671&amp;quality=100&amp;strip=all&amp;ssl=1 671w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/browser.png?resize=300%2C171&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 671px) 100vw, 671px\" \/><\/p>\n<p>You should see something similar to the preceding Figure. Then go to your Twitter\u00a0and a new Tweet\u00a0should be there!<\/p>\n<p>If you like Twitter, you can follow me there <a href=\"https:\/\/twitter.com\/RuiSantosdotme\" target=\"_blank\" rel=\"noopener noreferrer\">@RuiSantosdotme<\/a>\u00a0for news related to electronics.<\/p>\n<p><a href=\"https:\/\/twitter.com\/RuiSantosdotme\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10158\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/tweet_with_esp8266.png?resize=563%2C80&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"tweet_with_esp8266\" width=\"563\" height=\"80\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/tweet_with_esp8266.png?w=563&amp;quality=100&amp;strip=all&amp;ssl=1 563w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/tweet_with_esp8266.png?resize=300%2C43&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/a><\/p>\n<h2>Parts List<\/h2>\n<p>Here&#8217;s the hardware that you need to complete\u00a0this project:<\/p>\n<ul>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/esp-01-wi-fi-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">ESP8266<\/a>\u00a0&#8211; read <a href=\"https:\/\/makeradvisor.com\/best-esp8266-wi-fi-development-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">Best ESP8266 Wi-Fi Development Boards<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/ftdi-programmer-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">FTDI programmer<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/makeradvisor.com\/tools\/esp-01-wi-fi-board\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4815\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?resize=224%2C224&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"224\" height=\"224\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?resize=300%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 224px) 100vw, 224px\" \/><p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p><\/a><\/p>\n<h2>Schematics (3.3V FTDI\u00a0Programmer)<\/h2>\n<p>The schematics for this project are very straight forward. You only need to establish a serial communication between your FTDI programmer and your ESP8266 to upload some code.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5193\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/03\/ESP-Bitcoin-price_bb.png?resize=588%2C216&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-Bitcoin-price_bb\" width=\"588\" height=\"216\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/03\/ESP-Bitcoin-price_bb.png?w=759&amp;quality=100&amp;strip=all&amp;ssl=1 759w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/03\/ESP-Bitcoin-price_bb.png?resize=300%2C110&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/p>\n<h2>Downloading ESPlorer<\/h2>\n<p>I recommend using the ESPlorer program created by 4refr0nt\u00a0to create and save Lua files into your\u00a0ESP8266.<\/p>\n<p>Follow these instructions to download and install ESPlorer:<\/p>\n<ol>\n<li><a href=\"http:\/\/esp8266.ru\/esplorer\/#tutorials\" target=\"_blank\" rel=\"noopener noreferrer\">Click here to download\u00a0ESPlorer<\/a><\/li>\n<li>Unzip that folder<\/li>\n<li>Go to the <strong>main\u00a0<\/strong>folder<\/li>\n<li>Run\u00a0<strong>ESPlorer.jar<\/strong>.\u00a0It&#8217;s a JAVA program, so you need JAVA installed on\u00a0your computer<\/li>\n<li>Open the ESPlorer<\/li>\n<\/ol>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5125\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/02\/esplorer-start.png?resize=424%2C316&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esplorer start\" width=\"424\" height=\"316\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/02\/esplorer-start.png?w=802&amp;quality=100&amp;strip=all&amp;ssl=1 802w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/02\/esplorer-start.png?resize=300%2C224&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/p>\n<h2>Writing Your Lua Script<\/h2>\n<p>Don&#8217;t forget that first you need to <a href=\"https:\/\/randomnerdtutorials.com\/flashing-nodemcu-firmware-on-the-esp8266-using-windows\/\" target=\"_blank\" rel=\"noopener noreferrer\">flash your ESP with NodeMCU firmare<\/a>. Copy and paste the code below into ESPlorer. Then edit line 5 with your network credentials and line 13 with your API KEY.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">-- Rui Santos\n-- Complete project details at http:\/\/randomnerdtutorials.com\n\nwifi.setmode(wifi.STATION)\nwifi.sta.config(&quot;YOUR_NETWORK_NAME&quot;,&quot;YOUR_NETWORK_PASSWORD&quot;)\n\n-- A simple http client\nconn = nil\nconn=net.createConnection(net.TCP, 0)\nconn:on(&quot;receive&quot;, function(conn, payload) end)\nconn:connect(80,&quot;maker.ifttt.com&quot;)\nconn:on(&quot;connection&quot;, function(conn, payload)\nconn:send(&quot;POST \/trigger\/post_tweet\/with\/key\/YOUR_API_KEY HTTP\/1.1\\r\\nHost: maker.ifttt.com\\r\\nConnection: keep-alive\\r\\nAccept: *\/*\\r\\n\\r\\n&quot;) end)\nconn:close()\nprint('Posted Tweet')\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Post_Tweet_ESP8266.lua\" target=\"_blank\">View raw code<\/a><\/p>\n<h2>Uploading Your Lua Script<\/h2>\n<p>When you open the ESPlorer you should see a window similar to the preceding Figure, follow these instructions to send commands to your ESP8266: Connect your FTDI programmer to your computer<\/p>\n<ol>\n<li>Set bad raute as 9600<\/li>\n<li>Select your FTDI programmer <strong>port <\/strong>(COM3, for example)<\/li>\n<li>Press\u00a0<strong>Open\/Close<\/strong><\/li>\n<li>Select <strong>NodeMCU+MicroPtyhon tab<\/strong><\/li>\n<li>Copy the your Lua\u00a0script into\u00a0ESPlorer<\/li>\n<\/ol>\n<p>Then you simply click the button\u00a0<strong>Send to ESP. <\/strong>And you should see a\u00a0a print saying &#8220;Posted Tweet&#8221; in the ESPlorer window<strong>.\u00a0<\/strong>Everything that you need to worry about or change is highlighted in red box in the following Figure.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-10175 \" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/esplorer_IDE.png?resize=872%2C502&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esplorer_IDE\" width=\"872\" height=\"502\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/esplorer_IDE.png?w=1375&amp;quality=100&amp;strip=all&amp;ssl=1 1375w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/esplorer_IDE.png?resize=300%2C173&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/esplorer_IDE.png?resize=1024%2C590&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 872px) 100vw, 872px\" \/><\/p>\n<h2>Limitations and Taking it Further<\/h2>\n<p>Twitter doesn&#8217;t allow you to post the same tweet over and over again. So you can use the following script (by changing line 5 with your network credentials and line 13 with your API KEY) to add parameters to your POST request.<\/p>\n<p>In my example below I&#8217;m using the parameter &#8220;value1&#8221; and sending the value &#8220;True&#8221;. IFTTT supports three parameters called &#8220;value1&#8221;, &#8220;value2&#8221; and &#8220;value3&#8221; to customize your Tweets and make them unique.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">-- Rui Santos\n-- Complete project details at http:\/\/randomnerdtutorials.com\n\nwifi.setmode(wifi.STATION)\nwifi.sta.config(&quot;YOUR_NETWORK_NAME&quot;,&quot;YOUR_NETWORK_PASSWORD&quot;)\n\n-- A simple http client\nconn = nil\nconn=net.createConnection(net.TCP, 0)\nconn:on(&quot;receive&quot;, function(conn, payload) end)\nconn:connect(80,&quot;maker.ifttt.com&quot;)\nconn:on(&quot;connection&quot;, function(conn, payload)\nconn:send(&quot;POST \/trigger\/post_tweet\/with\/key\/YOUR_API_KEY HTTP\/1.1\\r\\n&quot;..\n  &quot;Host: maker.ifttt.com\\r\\nConnection: close\\r\\nAccept: *\/*\\r\\nContent-Type: application\/json\\r\\n&quot; ..\n  &quot;Content-Length: 17\\r\\n\\r\\n{\\&quot;value1\\&quot;:true}\\r\\n&quot;) end)\nconn:close()\nprint('Posted Tweet')\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Post_Tweet_ESP8266_Contains_Data.lua\" target=\"_blank\">View raw code<\/a><\/p>\n<p>In your POST request make sure you set the right &#8220;Content-Length&#8221; in my case it&#8217;s &#8220;17&#8221;, but if you change the &#8220;value1&#8221; or you add more parameters to your body request the &#8220;Content-Length&#8221; also changes. If you make a request with the wrong Content-Length it will fail.<\/p>\n<p>With this concept\u00a0in mind you can post data from your sensors (like temperature, humidity, etc) directly to Twitter using the ESP.<\/p>\n<p><strong>Here&#8217;s the end result:<\/strong><\/p>\n<p><a href=\"https:\/\/twitter.com\/RuiSantosdotme\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10178\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/twitter_ifttt_value1.png?resize=565%2C81&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"twitter_ifttt_value1\" width=\"565\" height=\"81\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/twitter_ifttt_value1.png?w=565&amp;quality=100&amp;strip=all&amp;ssl=1 565w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/twitter_ifttt_value1.png?resize=300%2C43&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/a><\/p>\n<h4>Do you have any questions?\u00a0Leave a comment down below!<\/h4>\n<p>Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my <a href=\"https:\/\/randomnerdtutorials.com\/download\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a> and my\u00a0Facebook Page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this project\u00a0you\u2019re going to post a Tweet with\u00a0an ESP8266. The goal of this project is\u00a0to show the endless possibilities that this\u00a0$4 WiFi module offers when integrates with a free\u00a0platform &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Posting a Tweet with the ESP8266\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/posting-a-tweet-with-the-esp8266\/#more-10150\" aria-label=\"Read more about Posting a Tweet with the ESP8266\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":10205,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[214,265,240,300,220,264],"tags":[],"class_list":["post-10150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp8266","category-esp8266-project","category-esp8266-projects","category-0-esp8266","category-http-client","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/08\/featured-image.png?fit=700%2C525&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/10150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=10150"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/10150\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/10205"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=10150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=10150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=10150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}