Coding Challenge 118: Mastodon Fractal Tree Bot Part 1

preview_player
Показать описание


Other Parts of this Challenge:

References:

Related Coding Challenges:

Timestamps:
0:00 Introduction
0:52 Inspiration for the challenge
1:06 Generate a random fractal tree image with Processing
3:50 Calling a Processing sketch from the command line
9:00 Async with promises
11:57 Reading stdout value
13:50 Use `mastodon-api` to POST the image
21:40 Refactor promises chain to async/await
25:20 Reference the image in a new status
30:07 Extract the angle value from stdout
33:00 Make the bot post at a predetermined interval
36:30 Hosting and Part 2 tutorial teaser

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

#mastodon #bots #fractals #processing #javascript #java #nodejs #commandlineinterfacecli
=====================================================
Комментарии
Автор

Hey David! Love your videos =) This mastodon series is really interesting

Just to be a nitpick here: setInterval does not execute your function after the specified amount of milliseconds. Rather it puts your callback into the event queue after that amount of time (over and over again). Now, this doesn't seem like it really matters, but it totally does and it is a perfect example of JavaScript's asynchronous nature. For example, if you were to do something like this:

const someFunc = () => {
console.log('Start')
setInterval(() => {
console.log('Right in the middle of it')
}, 3000)

console.log (''Done)
}
someFunc()

the output would be
'Start'
'Something'
'Done'
'Right in the middle of it' (around every three seconds)

This caused me a lot of cunfusion in my early JS days when I was using setTimeout (which works similarly). So I hope this helps somebody out there.

UweEichel
Автор

*6th like and shared and I've seen the 40 sec of mfine ad completely*

kvnagendra
Автор

I love your Videos ist filled with so much humor ♡

bastianroling
Автор

Sir, I had some basic knowledge about java from my school studies. I started seeing your videos and I have learnt many a things by your codes but Sir I know almost nothing except java coding. I had bought my first laptop last month and I don't know how to install java, which version to install, I just want that setup with which you work, I had gone through many videos in youtube about how to install java but I could not do that path set up and all. Can you help me by letting me know how to do and what to do to get exactly that entire set up of java with which you work.
I am excited to start coding but... guide me please

ranchieducation
Автор

With pretty much perfect timing; at 25:09 the video buffered... lol.

dnnyrn
Автор

Can someone tell me on which IDE he's programming ? I tried tout search, in vain

gregoirepelegrin
Автор

is this the best channel of the whole world? certainly yes

vmnog
Автор

Holy shit, are they actually using sequential numbers for uploaded media reference id:s? I hope those media are tightly locked behind user credentials because otherwise they are awfully easy to mine.

Draugo
Автор

How to write img src for others to access it?

ma
Автор

My bot starts but I get an ETIMEDOUT error, and it doesn't post to Mastodon. I'm on Ubuntu 18.04 if it matters. Can't figure out what's gone wrong.

hafizthephony