<center> <img src="https://tupaginaonline.net/images_blog/17_16_35blg.jpg" class="img-fluid" /> </center> <table> <tr> <td>Hoy aprenderemos a enviar un sms y recibir una respuesta usando los servicios de Twilio a través de Node con su framework Express usando código moderno ES6 (Babel)</td> <td>Today we will learn to send an SMS and receive a response using Twilio services through Node with its Express framework using code Today we will learn to send an SMS and receive a response using Twilio services through Node with its Express framework using code modern ES6 (Babel)</td> </tr> </table> <p><a href="https://www.twilio.com/">Twilio</a> es una compañía que ofrece una plataforma de comunicaciones así como de servicios en la nube, ubicada en San Francisco, California. Twilio permite desarrollar aplicaciones que hagan y reciban llamadas, mensajes de texto, elaboren funciones de comunicación y registro, usando APIs, propias del servicio web.</p> <blockquote> <p><a href="https://www.twilio.com/">Twilio</a> is a company that offers a communications platform as well as cloud services, located in San Francisco, California. Twilio allows you to develop applications that make and receive calls, text messages, develop communication and registration functions, using APIs, typical of the web service.</p> </blockquote> <br/><br/> <table> <tr> <td> Empezaremos instalando todos los modulos necesarios para nuestro ejemplo: </td> <td> We will start by installing all the necessary modules for our example: </td> </tr> </table> <div class="gatsby-highlight"> <pre class="gatsby-code"> <code class="gatsby-code"><b class="token function">npm</b> install express twilio @babel/node @babel/cli @babel/core @babel/preset-env </code> </pre> </div> <table> <tr> <td>Crearemos un archivo nuevo llamado <b>.babelRC </b>que contendrá lo siguiente:</td> <td>We will create a new file called <b>.babelRC</b> that will contain the following:</td> </tr> </table> <div class="gatsby-highlight"> <pre class="gatsby-code"> <code class="gatsby-code">{ "presets":[ "@babel/env" ] }</code> </pre> </div> <table> <tr> <td>Ahora procedemos a navegar hasta <a target="_blank" href="https://www.twilio.com/">twilio.com</a> y crear nuestra cuenta para obtener nuestro número de teléfono y la cuenta SID y el Auth token necesario para este ejemplo</td> <td>Now we proceed to navigate to <a target="_blank" href="https://www.twilio.com/"> twilio.com </a> and create our account to obtain our phone number and SID account and the Auth token required for this example</td> </tr> </table> <div class="gatsby-highlight"> <center> <img src="https://tupaginaonline.net/archivos/arc17_14_06.jpg" class="img-fluid" /> </center> </div> <br/> <table> <tr> <td>En nuestra raíz del proyecto creamos un archivo llamado <b>.env</b> que contendrá dichas claves de autenticación, el contenido del archivo es este:</td> <td>In our project root we create a file called <b> .env </b> that will contain these authentication keys, the content of the file is this</td> </tr> </table> <div class="gatsby-highlight"> <center> <img src="https://tupaginaonline.net/archivos/arc17_14_28.jpg" class="img-fluid" /> </center> </div> <br/> <b>Index.js</b> <table> <tr> <td>Procedemos a copiar el siguiente código </td> <td>We proceed to copy the following code</td> </tr> </table> <div class="gatsby-highlight"> <pre class="gatsby-code"> <code class="gatsby-code">import dotenv from 'dotenv' dotenv.config() const accound_sid = process.env.ACCOUND_SID const auth_token = process.env.AUTH_TOKEN const port = process.env.PORT || 4000 import client from 'twilio' const MessagingResponse = client.twiml.MessagingResponse import express from 'express' const app = express() app.use(express.json()) app.get('/', (req,res)=>{ res.send('Welcome!!') }) app.get('/send', async(req,res) => { try{ const message = await client(accound_sid,auth_token).messages.create({ body: 'Mensaje de prueba - sms from twilio', from: '+xxxxxxxx', to:'+xxxxxxx' }) res.json(message.sid) }catch(err){ console.log(err) } }) app.post('/sms', (req,res) => { const twiml = new MessagingResponse(); twiml.message('He recibido tu mensaje.'); res.writeHead(200,{'Content-Type':'text/xml'}); res.end(twiml.toString()); }) app.listen(port, () => { console.log('Server on port', port) }) </code> </pre> </div> <table> <tr> <td>Antes de ejecutar nuestro ejemplo modificaremos el package.json de la siguiente manera:</td> <td>Before running our example we will modify the package.json as follows:</td> </tr> </table> <b>package.json</b> <div class="gatsby-highlight"> <pre class="gatsby-code"> <code class="gatsby-code">"scripts": { "start": "babel-node index.js" }</code> </pre> </div> <table> <tr> <td>Ahora desde nuestra terminal procedemos a ejecutar el sguiente comando </td> <td>Now from our terminal we proceed to execute the following command</td> </tr> </table> <div class="gatsby-highlight"> <pre class="gatsby-code"> <code class="gatsby-code"><b class="token function">npm</b> start </code> </pre> </div> <table> <tr> <td>Vamos en nuestro navegador y colocamos http://localhost:4000/send</td> <td>We go in our browser and put http://localhost:4000/send</td> </tr> </table> <table> <tr> <td>Y con eso debería de llegar un sms a al numero indicado en el código arriba <b>(to)</b> de parte de <b>(from)</b></td> <td>And with that a sms should arrive at the number indicated in the code above <b>(to)</b> from <b> (from)</b></td> </tr> </table> <table> <tr> <td>Para probar la respuesta automática (endpoint sms/) habría que subirla a un hosting (recomiendo <b>heroku</b> para ello)</b></td> <td>To test the automatic response (endpoint sms /) it would be necessary to upload it to a hosting (I recommend <b> heroku </b> for this)</td> </tr> </table> <p>Adjunto captura de mi teléfono / Attached capture of my phone</p> <div class="gatsby-highlight"> <center> <img src="https://tupaginaonline.net/archivos/arc17_18_38.jpg" class="img-fluid" /> </center> </div> <br/><br/><br/><br/><br/> <p>Y con esa amigos llegamos al final del tutorial, espero que lo hayan disfrutado y hasta la próxima! / And with that friend we come to the end of the tutorial, I hope you enjoyed it and until next time!</p><br/> <p style="color:red">Visite mi sitio web oficial / Visit my official website</p> <center><a href="https://tupaginaonline.net" target="_blank"><b>tupaginaonline.net</b></a></center>
author | jfdesousa7 |
---|---|
permlink | tutorial-aprende-a-como-enviar-mensajes-de-texto-sms-via-twilio-con-node-js-usando-codigo-javascript-moderno-es6-babel-learn-how |
category | hive-148441 |
json_metadata | {"tags":["ocd","cervantes","appreciator","dev","developspanish","spanish","originalcontent"],"image":["https://tupaginaonline.net/images_blog/17_16_35blg.jpg","https://tupaginaonline.net/archivos/arc17_14_06.jpg","https://tupaginaonline.net/archivos/arc17_14_28.jpg","https://tupaginaonline.net/archivos/arc17_18_38.jpg"],"links":["https://www.twilio.com/"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2021-01-31 21:23:27 |
last_update | 2021-01-31 21:23:27 |
depth | 0 |
children | 7 |
last_payout | 2021-02-07 21:23:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 3.188 HBD |
curator_payout_value | 3.114 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 6,639 |
author_reputation | 19,305,981,226,487 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,646,469 |
net_rshares | 24,332,449,490,369 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
anarcist69 | 0 | 3,720,799,491 | 7.5% | ||
netaterra | 0 | 348,920,025,026 | 15% | ||
clayboyn | 0 | 7,487,891,793 | 7.5% | ||
shadowmyst | 0 | 53,894,981,650 | 100% | ||
neuerko | 0 | 274,458,949,588 | 100% | ||
amberyooper | 0 | 25,332,726,501 | 10% | ||
followbtcnews | 0 | 414,219,348,964 | 15% | ||
minnowsupport | 0 | 1,791,902,492,435 | 35% | ||
crimsonclad | 0 | 134,979,077,604 | 15% | ||
tipu | 0 | 4,626,077,449,046 | 14% | ||
fatman | 0 | 6,091,464,504 | 2% | ||
viper160891 | 0 | 3,938,563,187 | 100% | ||
bigdizzle91 | 0 | 18,088,946,862 | 100% | ||
happy-soul | 0 | 741,982,129 | 7% | ||
carlosbp | 0 | 2,124,586,155 | 100% | ||
elvys | 0 | 563,019,170 | 17.5% | ||
zaxan | 0 | 11,462,544,609 | 31.5% | ||
aliento | 0 | 891,077,856,971 | 100% | ||
longer | 0 | 1,166,605,298 | 3.5% | ||
angelica7 | 0 | 6,231,960,722 | 7% | ||
donald.porter | 0 | 9,279,498,094 | 28% | ||
smartvote | 0 | 61,630,795,044 | 2.9% | ||
juancrdrums | 0 | 681,704,741 | 100% | ||
developspanish | 0 | 1,836,175,653 | 100% | ||
voter000 | 0 | 706,024,673 | 2% | ||
blarchive | 0 | 18,022,288,398 | 15% | ||
anarcist | 0 | 765,277,523 | 15% | ||
theycallmedan | 0 | 15,235,601,767,015 | 18% | ||
escuadron201 | 0 | 286,019,189,366 | 100% | ||
mia-cc | 0 | 1,757,470,848 | 14% | ||
kryptogames | 0 | 63,895,367,636 | 14% | ||
therealyme | 0 | 894,241,685 | 15% | ||
sevenoh-fiveoh | 0 | 574,876,904 | 7% | ||
masiosare | 0 | 3,373,436,295 | 50% | ||
cmplxty.pal | 0 | 1,096,693,032 | 35% | ||
guia-mecatronica | 0 | 3,865,381,427 | 100% | ||
glowshine | 0 | 19,139,024,816 | 100% | ||
hectorsanchez18 | 0 | 829,005,514 | 100% | ||
luis96xd | 0 | 0 | 100% |
Excelente tutorial y bien explicado, ya hace mucho deje de trabajar con Twilio, pero es una gran herramienta, sobre todo cuando quieres hacer KYC y confirmar que un número telefónico es dueño.
author | developspanish |
---|---|
permlink | re-jfdesousa7-qntivc |
category | hive-148441 |
json_metadata | {"tags":["hive-148441"],"app":"peakd/2021.01.3"} |
created | 2021-01-31 21:40:27 |
last_update | 2021-01-31 21:40:27 |
depth | 1 |
children | 3 |
last_payout | 2021-02-07 21:40:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 192 |
author_reputation | 4,482,396,340,474 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,646,690 |
net_rshares | 0 |
Gracias, pronto subiré mas contenido, así voy puliendo los tutoriales acá en hive
author | jfdesousa7 |
---|---|
permlink | qntj7i |
category | hive-148441 |
json_metadata | {"app":"hiveblog/0.1"} |
created | 2021-01-31 21:47:48 |
last_update | 2021-01-31 21:47:48 |
depth | 2 |
children | 2 |
last_payout | 2021-02-07 21:47:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 81 |
author_reputation | 19,305,981,226,487 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,646,781 |
net_rshares | 53,803,507,681 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
shadowmyst | 0 | 52,071,944,243 | 100% | ||
developspanish | 0 | 1,731,563,438 | 100% |
Genial, me encantara ver tu contenido dentro de la comunidad de [Develop Spanish](https://peakd.com/c/hive-154226) o desde el tag #developspanish, poco a poco tendremos mas desarroladores hablando de programación :D
author | developspanish |
---|---|
permlink | re-jfdesousa7-qntjve |
category | hive-148441 |
json_metadata | {"tags":["hive-148441"],"app":"peakd/2021.01.3"} |
created | 2021-01-31 22:02:03 |
last_update | 2021-01-31 22:02:03 |
depth | 3 |
children | 1 |
last_payout | 2021-02-07 22:02:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 215 |
author_reputation | 4,482,396,340,474 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,647,046 |
net_rshares | 0 |
Congratulations @jfdesousa7! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) : <table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@jfdesousa7/upvoted.png?202101312222"></td><td>You received more than 800 upvotes. Your next target is to reach 900 upvotes.</td></tr> </table> <sub>_You can view your badges on [your board](https://hivebuzz.me/@jfdesousa7) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> **Check out the last post from @hivebuzz:** <table><tr><td><a href="/hivebuzz/@hivebuzz/pud-202102"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg"></a></td><td><a href="/hivebuzz/@hivebuzz/pud-202102">Next Hive Power Up Day is February 1st 2021</a></td></tr></table>
author | hivebuzz |
---|---|
permlink | hivebuzz-notify-jfdesousa7-20210131t223029000z |
category | hive-148441 |
json_metadata | {"image":["http://hivebuzz.me/notify.t6.png"]} |
created | 2021-01-31 22:30:27 |
last_update | 2021-01-31 22:30:27 |
depth | 1 |
children | 0 |
last_payout | 2021-02-07 22:30:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 926 |
author_reputation | 369,432,312,084,136 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,647,685 |
net_rshares | 0 |
@tipu curate
author | neuerko |
---|---|
permlink | re-jfdesousa7-2021131t15286766z |
category | hive-148441 |
json_metadata | {"tags":["ocd","cervantes","appreciator","dev","developspanish","spanish","originalcontent"],"app":"ecency/3.0.13-mobile","format":"markdown+html"} |
created | 2021-01-31 21:28:06 |
last_update | 2021-01-31 21:28:06 |
depth | 1 |
children | 1 |
last_payout | 2021-02-07 21:28:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 13 |
author_reputation | 189,659,636,099,356 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,646,533 |
net_rshares | 0 |
<a href="https://tipu.online/hive_curator?neuerko" target="_blank">Upvoted 👌</a> (Mana: 98/112) <a href="https://peakd.com/hive/@reward.app/reward-app-quick-guide-updated" target="_blank">Liquid rewards</a>.
author | tipu |
---|---|
permlink | re-re-jfdesousa7-2021131t15286766z-20210131t212813z |
category | hive-148441 |
json_metadata | "{"app": "beem/0.24.20"}" |
created | 2021-01-31 21:28:15 |
last_update | 2021-01-31 21:28:15 |
depth | 2 |
children | 0 |
last_payout | 2021-02-07 21:28:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 216 |
author_reputation | 55,938,768,526,111 |
root_title | "Tutorial - Aprende a como enviar mensajes de texto (sms) via Twilio con Node.js usando codigo javascript moderno ES6 (Babel) / Learn how to send text messages (sms) via Twilio with Node.js using modern javascript code ES6 (Babel)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 101,646,535 |
net_rshares | 0 |