DEV Community

dev.to staff
dev.to staff

Posted on

Twilio Hackathon Help Thread

The awesome Twilio team will be making themselves available to help people who runs into issues or have questions related to their products as part of the Twilio Community Hackathon.

You are encouraged to comment in this thread for asynchronous assistance. We've also set up a dedicated DEV Connect group channel for more synchronous help. To join the Connect group, just leave a comment in this thread asking to be added.

Twilio will be hosting office hours in Connect during the following times:

  • Mondays: 3-6pm EDT
  • Tuesdays: 3-6pm UTC
  • Wednesdays: 3-6pm AEDT
  • Thursdays: 3-6pm PDT
  • Fridays: 3-6pm EDT

Additionally, Twilio will be hosting a weekly office hours session on https://twitch.tv/twilio, starting on April 2 at 4-6pm PDT.

If you'd like to share more general progress that you're making on your project, you can do so in the community update thread!

Oldest comments (136)

Collapse
 
peter profile image
Peter Kim Frank

πŸ‘‹ Can I be added to the help channel onDEV Connect?

(just leaving this comment as an example)

Collapse
 
michaeltharrington profile image
Michael Tharrington

If it's taking a bit for us to add you, please feel free to @mention me and I'll help as quickly as I can!

Collapse
 
louy2 profile image
Yufan Lou

πŸ‘‹ Can I be added to the help channel on DEV Connect?

Collapse
 
bywaleed profile image
Waleed

πŸ‘‹ Can I be added to the help channel onDEV Connect?

Collapse
 
thomasbnt profile image
Thomas Bnt β˜• • Edited

Hello πŸ‘‹πŸΌπŸ˜Š
Can be added to the help channel onDEV Connect?

Collapse
 
bernardbaker profile image
Bernard Baker

Can I be added to the help channel on DEV Connect?

Collapse
 
rogers9798 profile image
Sachin

Can I be added to the help channel on DEV Connect?

Collapse
 
xuanxw profile image
Xuan

πŸ‘‹ Can I be added to the help channel onDEV Connect?

Collapse
 
abreezasaleem profile image
Abreeza Saleem

Can I be added to the help channel onDEV Connect?

Collapse
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

Can I be added to the help channel on DEV Connect?

Collapse
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

Request for async assistance:

Can someone help me out here?

I'm using this library to download a video: github.com/fent/node-ytdl-core

I need to save the video to a file in order to make some modifications. I'm having trouble saving the response of the call to download a video without using the piping operator.

I think the read call is returning a byte array, but can't tell from the method signature. Could someone point me in the right direction here?

  const readable = ytdl(shortVideoUrl);

  await new Promise(res => {
    readable.addListener("readable", () => {
      console.log(`index::20: entering`);
      const foo = readable.read();
      if (!foo) {
        console.log(`index::23: no here`);
      }
      console.log("index::21: foo.length:", foo.length);
      const file = fs.createWriteStream("shortvid.flv");
      file.write(foo);
    });
  });

Alternately, if there is a way to get information about the progress of the write when using the pipe operator, that would be great too. Thanks!

Collapse
 
philnash profile image
Phil Nash

To get info about the progress it looks like you can listen to the progress event on the readable. Something like:

readable.addEventListener('progress', (chunkByteLength, totalBytesDownloaded, totalBytes) => {
  console.log(`Downloaded ${totalBytesDownloaded} out of ${totalBytes}`);
})

I haven't used this library though, so I might be wrong. Hope it helps!

Collapse
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

Hey Phil thanks a lot for the reply. That definitely works if I wasn't using the pipe operator, but without doing so, I don't know how to create the file from the array of bytes.

At any rate, I actually switched to Python and it's made my life a little easier.

Thread Thread
 
philnash profile image
Phil Nash

Ah! Because it's a readable stream it will emit the data event with chunks of the data which you can write into your writable stream. Something like this should work:

const file = fs.createWriteStream("shortvid.flv");
const readable = ytdl(shortVideoUrl);
readable.addEventListener('data', chunk => {
  file.write(chunk);
});
readable.addEventListener('progress', (chunkByteLength, totalBytesDownloaded, totalBytes) => {
  console.log(`Downloaded ${totalBytesDownloaded} out of ${totalBytes}`);
})
readable.addEventListener('end', () => {
  file.end();
});

But, if you've switched to Python and you're happy with that, then that's cool too!

Thread Thread
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

If only the Twilio dev evang team could answer all of my Javascript queries 🀣

So just for my learning opportunity here - when you call file.write(chunk), it's appending those bytes to the file, and calling file.end() will close that file write stream and result in the video file automagically?

Side note about python: It's been awesome to stand up my hack. The last step of adding a message queue (which I thought would be the hardest) has been the easiest. Gotta love learning!

Thread Thread
 
philnash profile image
Phil Nash

Yes, that is the gist of it! Using the data and end events of the readable and calling write and end of the writeable is actually the equivalent of using readable.pipe(writeable). But, the documentation suggests you don't want to mix pipe and event based operations and using the progress event would mess that up.

I'm happy to answer JS questions if I can! I just happened to work with other readables/writeables a couple of weeks ago, so it was sort of fresh.

It's good to hear that the Python version has come on nicely for you. I love hackathons for the learning potential!

Thread Thread
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

Brilliant! Well I followed you so be expecting some in the future.

Python for whatever reason (or perhaps the competitive nature of the Hackathon) has me more excited about developing than I’ve been in a while, so thanks for that!

And thanks again for your assistance.

Collapse
 
ajaystxus profile image
ajaystxus

Could you please add me to the Connect group?

Collapse
 
farazpatankar profile image
Faraz Patankar

πŸ‘‹ Can I be added to the help channel on DEV Connect?

Collapse
 
sergix profile image
Peyton McGinnis

Hey! Can I be added to the help channel on DEV Connect? Much appreciated! πŸ˜„

Collapse
 
ssimontis profile image
Scott Simontis

Please add me to the help channel on DEV Connect, thanks!

Collapse
 
suraj_pillai profile image
Suraj Pillai

Can I be added to the help channel onDEV Connect?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.