Placeholder Image

Subtitles section Play video

  • (bell dinging) - Hello this is a first video

  • in a new series about making a Mastodon bot.

  • And you might be asking yourself,

  • okay, why are you making, what is Mastodon,

  • why are you making a Mastodon bot

  • and why should I care?

  • (laughing) I'm not really sure why you should care

  • but I'm going to try to answer those other questions

  • and you yourself can decide.

  • So this playlist is essentially a replacement

  • for Session 4:Twitter API and Bots with Node.js.

  • So I'm going to not redo 15.1 and 15.2

  • if you have never used Node before

  • or don't know what NPM is, you can go back

  • and watch those two videos,

  • but I'm going to start here basically with setting up,

  • setting up a Twitter, setting up a Mastodon.

  • And so what is Mastodon, why are we here?

  • So the Twitter API, which I used to create

  • these set of tutorials, recently changed quite a bit.

  • So it is much harder to signup for a new account

  • authorized for automation, making a bot

  • that posts in an automatic way to Twitter.

  • They also changed something about the API

  • called the streaming API, the way that you could

  • connect to Twitter and listen for certain events.

  • They changed the API and that is no longer available.

  • So while I encourage you to still experiment

  • with Twitter as a platform if you so like.

  • If today is your first day wanting to like

  • learn some stuff about node and social networking

  • and making up social networks and making a bot that posts,

  • Mastodon is going to be a more pleasurable,

  • easy-going experience for you that's going to allow you

  • to express your creativity in a much more immediate way.

  • And then there's another reason.

  • It has to do with this idea called decentralization.

  • So Twitter, I don't know if you've noticed,

  • it's kind of an awful place to be for the most part,

  • I don't want to get too far down that discussion,

  • but is there, is there another way?

  • Is there another way that we can communicate

  • with each other in a less centralized governed

  • and owned by large corporations kind of way.

  • And one way to do that

  • is with a concept called decentralization.

  • And Mastodon is an open-source, I don't know

  • maybe I should go somewhere where it actually says

  • what it is, well you can read it,

  • Follow friends and discover new ones.

  • Publish anything you want link, pictures, text, video.

  • All on a platform that is community-owned and ad free.

  • You know this is not like some sort of sponsored video

  • I'm experimenting with this platform

  • because it interests me and maybe it'll interest you.

  • It is open-source project.

  • You can see it's on GitHub here

  • and the decentralization runs

  • with a protocol called ActivityPub.

  • So let me try to give you an understanding

  • of what I mean by all this stuff.

  • What is Twitter, I don't know if anyone

  • should really answer that question but (laughing)

  • I will give you a little framework.

  • So Twitter is a company, they run probably a lot of servers.

  • You can be sitting on your laptop or your, you know,

  • phone, that's a phone apparently,

  • and you could sign up for an account on Twitter.

  • You could give yourself a Twitter user name

  • like @shiffman and then you could post messages

  • like the heart emoji and you can read other messages

  • that other people are sending into Twitter.

  • This is what you would refer to as a centralized platform.

  • The software that runs Twitter

  • is on a particular server, it's proprietary.

  • The way Twitter is governed in how, where,

  • what certain posts are allowed and aren't allowed

  • are all run by this same company.

  • And all of your data, all of the tweets

  • you've ever posted, all of your user information,

  • your password stuff, all of that is stored

  • on this centralized server.

  • The web didn't start with this idea

  • of a centralized platform, the idea was

  • many different nodes all interconnected,

  • being able to share and publish with each other.

  • And so there is, slowly entering the Zite guys now,

  • this idea of decentralized platforms.

  • Probably if you're not familiar with that

  • you're probably familiar with something

  • called Bitcoin, right, which runs on something

  • called blockchain which is a protocol

  • for decentralized financial transactions

  • which I am not going to make any videos about

  • at least anytime soon.

  • But, Mastodon is an open-source,

  • decentralized social network and it probably resembles

  • Twitter the most but there's some nuance to that.

  • So how is it different?

  • How does it work?

  • Well number one is there is no single server.

  • For example I have actually set up my own server

  • known as an instance.

  • And I'm not going to show you in this series

  • how to set up your own Mastodon instance,

  • but if that's of interest I certainly can provide

  • some resources to do that and I could do a video

  • about setting one up.

  • My instance is at a particular domain, choochoo.space,

  • this is my Mastodon instance,

  • so we'll call it Choo Choo.

  • There are other Mastodon instances.

  • For example mastodon.social, there is also,

  • let me erase some of this stuff here.

  • choochoo, mastodon.social, there are some other ones

  • that I have seen, for example, there is vis.social

  • which is an instance for people interested

  • in data visualization I presume.

  • There is another instance called botsin.space

  • which I am going to use in this series

  • to make a bot that runs on this botsin.space.

  • So the idea here is I've set up this instance.

  • Let's say you want to sign up for an account

  • with this particular instance.

  • You would go, I'll show you to in a second,

  • you would go there and you would sign up.

  • And so my user name, I'm a client, my like picture

  • of my like laptop over here which is strangely,

  • it's a weird bizarre angle, I am shiffman@choochoo.space.

  • So this is my local, this is my local Mastodon instance.

  • When I want to sign on, when I want to post something,

  • I post it, a sign on through this server,

  • I post it through this server,

  • my account is with this server.

  • But there is this concept called federation,

  • sounds like something out of Star Trek,

  • and it kind of is, which federation,

  • and I know I'm kind of getting close

  • to writing off the top,

  • is a way for all of these instances

  • to communicate with each other

  • in a decentralized fashion.

  • So if I post something saying like, hello,

  • I ate oatmeal for breakfast this morning,

  • this post that I make through here

  • will get propagated throughout

  • the entire network of Mastodon instances.

  • So there is both, when you're browsing Mastodon

  • there's both this idea of a local timeline

  • as well as a federated, or you could think of it

  • as global timeline.

  • And I'll show you this in a second.

  • I could browse and just look at all the posts,

  • I think they're called toots, all the toots,

  • for people who are at this instance

  • or all the toots from people all throughout

  • the federated universe of instances.

  • By the way the protocol that is used

  • for all of this, for all the communication

  • to propagate throughout the network,

  • did I mention this already?

  • It's called ActivityPub.

  • So the software that runs a particular server

  • is completely open-source.

  • It took me awhile to get it up and running

  • but I have it up and running here.

  • So what I'm going to do is I'm going to show you

  • my account here, I'm going to show you botsin.space,

  • which is an instance designed for people

  • who want to make bots.

  • I'm going to sign up and create a bot on botsin.space

  • and interact with it here and then just show you

  • how the global network of stuff works.

  • So, the only prerequisites really for you

  • going to the next video is to have node installed

  • on your computer and you can go back

  • and watch my two sort of intro to node

  • for Twitter bots videos

  • and the same concepts there will apply

  • although I'm going to use different node packages.

  • Okay, so now we're over here.

  • This is the joinmastodon.org website.

  • You can find out a lot of information.

  • I would encourage you to click on this,

  • How it works, what is mastodon video

  • which is on YouTube which will explain all that

  • much better then I did, get started.

  • You could find an instance that you might like to join.

  • This is the GitHub open-source repository

  • with the software that's running.

  • Now, and now, dadadadadadada, here is my instance.

  • (whistle tooting)

  • The choochoo, people are notifying me

  • and saying hi and look, K. Wichmann

  • says, Look ma, I'm on the live stream.

  • Okay, excellent, please use caution when posting now.

  • So this is what it looks like.

  • You can see it looks like some other

  • social network service that you might sigh up for.

  • The difference is I am actually running the software

  • for it on my own server.

  • This is a server I happened to sign up

  • through DigitalOcean, which is a web hosting company,

  • that is not a sponsor but could be a sponsor,

  • hello DigitalOcean, but and you could set up your own.

  • And so what, but here's what I'm going to do.

  • You can look other instances like botsin.space,

  • this is the instance and you could sign up.

  • In the next video I'm actually going to sign up

  • for an account here so I can make a bot

  • that posts on it.

  • You can see here's some bots already

  • that are posting things.

  • The Cyberpainting biedermeier in the North Pole

  • inspired by Hubert Robert.

  • Ah, okay, the sequel is here, get ready

  • for guards 2: define.

  • I don't know what, please, have a tree picture.

  • This is a tree bot, come on, oh, let's make a tree bot

  • it's going to be so nice.

  • So again, these are things that you can do

  • on other services but Mastodon being open-source,

  • it's a really friendly and easy place

  • to get started with in terms of the API

  • which I'm sure will rapidly change,

  • and who knows how quickly this video

  • will go out of date, but that's the current spot.

  • So if you want to sign for a Mastodon account

  • not on choochoo.space or botsin.space,

  • a new one for yourself, you can come,

  • you can go to joinmastodon.org

  • and you can go look here.

  • You can look for something like, oh, you're an artist,

  • yes, and you speak English.

  • Oh, this dots social, there we go,

  • a social space for anyone

  • in data visualization, creative coding, etc.,

  • and now you can see this is vis.social

  • and you could sign up here.

  • Now once again even if you sign up at a certain instance,

  • that's just your name and address and your local instance,

  • but through federation, through ActivityPub,

  • through decentralization, you are still participating

  • in the broader world that is a Mastodon.

  • Okay, so what's going to happen next?

  • In the next video I am going to sign up

  • for a botsin.space account,

  • I'm going to show you how to get your API keys,

  • I'm going to write a little node program

  • that posts, that toots to it automatically

  • and then I'm going to show you lots more ways

  • and things and how the API works and different ways

  • to post images and replies and favorite things

  • and all that kind of stuff, okay?

  • So hope you enjoyed this exploration

  • of the open-source project Mastodon,

  • and I look forward to hearing what you think

  • in the comments.

  • (upbeat music)

(bell dinging) - Hello this is a first video

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it