15.7: A Bot That Replies - Twitter Bot Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 2024
  • This video covers how to create a bot that automatically replies to a tweet, using node.js and the "twit" node package.
    Next video: • Video
    All examples: github.com/shiffman/A2Z-F16/t...
    Twit package: github.com/ttezel/twit
    Video explaining JSON: • 10.2: What is JSON? Pa...
    Twitter API documentation: dev.
    Contact: / shiffman
    Learn JavaScript basics:
    • Start learning here!
    Learn Processing basics:
    th-cam.com/users/shiffman...
    More about data and APIs:
    • 10: Working with data ...
    Help us caption & translate this video!
    amara.org/v/dXl9/
    📄 Code of Conduct: github.com/CodingTrain/Code-o...

ความคิดเห็น • 146

  • @Algebrodadio
    @Algebrodadio 6 ปีที่แล้ว +1

    I'm glad you're back Daniel. Another great tutorial.

  • @theawkwarddev5229
    @theawkwarddev5229 6 ปีที่แล้ว +7

    Love The Bots Keep It Up Shiffman!!!

  • @namanmehta5243
    @namanmehta5243 6 ปีที่แล้ว +1

    Ahhh finally, have been waiting for the 15.7 for sometime :)

  • @CarelessMiss
    @CarelessMiss 6 ปีที่แล้ว

    This channel is my fav so far.

  • @TotoPotoRoto
    @TotoPotoRoto 2 ปีที่แล้ว

    This person is so passionate, he makes my heart explode

  • @arshadjaveed7877
    @arshadjaveed7877 6 ปีที่แล้ว +40

    This channel deserves atleast 1M subscribes😊

    • @89elmonster
      @89elmonster 6 ปีที่แล้ว +1

      arshad javeed Anyone who is dedicated to spreading knowledge and not profit from it substantially deserves anything they want.

    • @vincedayanan8742
      @vincedayanan8742 6 ปีที่แล้ว +1

      arshad javeed stop the propaganda boycott Twitter and Facebook

    • @vincedayanan8742
      @vincedayanan8742 6 ปีที่แล้ว

      Can you hear me. Boycott Facebook and Twitter

    • @arshadjaveed7877
      @arshadjaveed7877 6 ปีที่แล้ว

      Jarmahent I know that ...but for a TH-camr making videos might be means of earning...so In TH-cam you start eating good money only when you reach 1M susbs...
      So that is what I meant.....
      So that gets good reward for what he is doing

    • @reidapromo6604
      @reidapromo6604 4 ปีที่แล้ว

      Almost there

  • @arshadjaveed7877
    @arshadjaveed7877 6 ปีที่แล้ว +3

    Awsome work...please keep it up

  • @TheDrunkMunk
    @TheDrunkMunk 6 ปีที่แล้ว

    More bot videos pls, this was great

  • @HasanAlsawadi
    @HasanAlsawadi 3 ปีที่แล้ว

    You have a very interesting, funny and lovely tutoring way.. New Subscriber is here!

  • @sadhanasaha9400
    @sadhanasaha9400 4 ปีที่แล้ว

    Great video man loved loveeed it❤❤❤

  • @mrkstorm1
    @mrkstorm1 6 ปีที่แล้ว +35

    I want to make a tweet bot that sends virtual hugs to anyone who tweets "I need a hug"

    • @SahilP2648
      @SahilP2648 6 ปีที่แล้ว +9

      Marco Conte lol. Then make one.

    • @Mirko_ddd
      @Mirko_ddd 3 ปีที่แล้ว +1

      That is a very nice idea!

    • @fessouy9659
      @fessouy9659 3 ปีที่แล้ว +1

      @@SahilP2648 bruh

    • @SahilP2648
      @SahilP2648 3 ปีที่แล้ว

      @@fessouy9659 why bruh?

    • @SmashingCapital
      @SmashingCapital 2 ปีที่แล้ว

      did you do it?

  • @uwspstar2008
    @uwspstar2008 6 ปีที่แล้ว

    thanks for sharing !

  • @engin_karatas
    @engin_karatas 2 ปีที่แล้ว

    you changed my life!

  • @techmathy5764
    @techmathy5764 3 ปีที่แล้ว

    I love your channel ❤️

  • @drowningin
    @drowningin 6 ปีที่แล้ว

    I've never been good in social situations or known what to say to make good conversations until I got the idea to make myself into a conversation not!
    It wasn't until a few years ago I got a PC in tiny form running a custom micro stripped to the bones BSD kernal.
    It takes input via a microphone, parses the input and delivers to Bluetooth headphone a response.
    Several versions in I got it recognising my voice and ignoring it for input.
    I will be selling this as a full product within a few years.
    Like so I can gauge if this is something you desire to have

  • @klymen
    @klymen 6 ปีที่แล้ว

    This video needs to come with a " With great power comes great responsibility" warning at the beginning.

  • @ARQAlejandroM
    @ARQAlejandroM 6 ปีที่แล้ว

    I love you bro lol so amazing!!!!

  • @OmarAhmed-od9rf
    @OmarAhmed-od9rf 6 ปีที่แล้ว

    I like the writing to a file idea (Y)

  • @amandamate9117
    @amandamate9117 6 ปีที่แล้ว

    not a single dislike. amazing!

  • @Gadespcreparaciones
    @Gadespcreparaciones 2 ปีที่แล้ว

    tnks!!! need play at 0.5 X for understand!!
    💖

  • @flippyflopper2360
    @flippyflopper2360 6 ปีที่แล้ว +140

    You asked me to count how many times you said "tweet". I did one better.
    Tweet=54
    Tweets=11
    Tweeting=4
    Twitter=9
    Yeah 54. i might have missed one or two.

    • @ashab6101
      @ashab6101 6 ปีที่แล้ว +11

      what is wrong with you

    • @flippyflopper2360
      @flippyflopper2360 6 ปีที่แล้ว +2

      nothing, everything is entirely correct with me.

    • @flippyflopper2360
      @flippyflopper2360 6 ปีที่แล้ว +1

      lol

    • @flippyflopper2360
      @flippyflopper2360 6 ปีที่แล้ว +1

      it would be interesting to put this wee little data table against other words with their various forms to see how often verbs are used compared to nouns etc.

    • @semitangent
      @semitangent 6 ปีที่แล้ว +7

      In the spirit of the scientific method, here's my data:
      Tweet: 55
      Tweets: 11
      Tweeting: 4
      Twitter: 9
      Now all we need is some referee for the peer review ;D

  • @nadkine6601
    @nadkine6601 6 ปีที่แล้ว +1

    Probably the Facebook-Api has a lot in common with the Twitter-Api, but could you consider making a video about that basics of that? I dont understand the documentation facebook put on their website

  • @gregfletcher2360
    @gregfletcher2360 5 ปีที่แล้ว +15

    Hi Daniel, this is great content as always! Though, unfortunately twitter has discontinued stream. So do you have any suggestions for content on your channel that makes a bot similar to this? Thanks as always!

    • @CallumAtwal
      @CallumAtwal 3 ปีที่แล้ว +2

      You can use the following
      T.stream('statuses/filter', { track: '@username'});
      They only discontinued the use on "user"

  • @janchan8260
    @janchan8260 6 ปีที่แล้ว

    thx so much!!! If I want to keep streaming and reply to the people who use a specific hangtag, what can i do??? I not sure the conding between "user" and "public " streaming, HOPE DANIEL YOU CAN HELP ME

  • @errrzarrr
    @errrzarrr 5 ปีที่แล้ว +4

    The 'follow' code not working for me

  • @TheCrandel
    @TheCrandel 5 ปีที่แล้ว

    Are you still planning on doing a follow up video for twitter or maybe even facebook or instagram. That would be awesome.

  • @WilliamPeytz
    @WilliamPeytz 6 ปีที่แล้ว +7

    Could you do a coding challenge where you create the chrome dinosaur game in processing?

  • @powpowson
    @powpowson 5 ปีที่แล้ว

    Are you able to set up a stream to track when a specific user tweets?

  • @samwic9372
    @samwic9372 5 ปีที่แล้ว

    you write like a science teacher

  • @umangprakash
    @umangprakash 4 ปีที่แล้ว

    hi,
    do you have any suggestions how we can make the bot reply to any questions asked to him via mention by giving the bot preset replies?

  • @Ignacio.Michel
    @Ignacio.Michel 4 ปีที่แล้ว

    hey! i'm not really into progaming, but i'm making a tweeter bot with node.js and can´t make it reply the tweets that contains a certain hasthtag and either make it select a random response, maybe you have some examples? thanks, you are great!

  • @MrBullet45100
    @MrBullet45100 6 ปีที่แล้ว

    Hey Daniel, I've been following up with your vids. I followed your code for mentioning accounts when they follow me but I can't get my bot to mention a protected account that follows me. How do I go about this?

  • @tcchan14
    @tcchan14 6 ปีที่แล้ว +1

    Could you do a top down shooter with sniper aiming function in coding challenge:D?

  • @incarts8818
    @incarts8818 6 ปีที่แล้ว

    Hey Daniel, I have a question.. Is it possible to connect p5 with android studio?

  • @MartinRatinaud
    @MartinRatinaud ปีที่แล้ว

    Thanks for the video
    Does Twitter really lets you mention as many users as you want through the API?
    It seemed to me that you could be banned for that

  • @GameJoint
    @GameJoint 6 ปีที่แล้ว

    Great video! Is there a download link for the bot?

  • @chachachas
    @chachachas 6 ปีที่แล้ว +1

    How did you get the twitter.json?

  • @bernardwongyeteng3427
    @bernardwongyeteng3427 6 ปีที่แล้ว

    quick question, isn't that all tweet to me has my screenname on it? why do i still need to check if the in_reply_to_screen_name is my screenname?

  • @fabricerichard1166
    @fabricerichard1166 6 ปีที่แล้ว

    yesssssss

  • @smolus0512
    @smolus0512 6 ปีที่แล้ว

    6:22 i knew it from the begining

  • @shamsadanam9923
    @shamsadanam9923 3 ปีที่แล้ว +2

    Unfortunately, user stream and site streams are deprecated. According to twitter, one has to use "The Account Activity API". Link to the documentation -
    developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/subscribe-account-activity/overview

  • @benjaminmoore5537
    @benjaminmoore5537 6 ปีที่แล้ว

    Hey thank you for making these videos. I have kinda hit a wall. I have put together code, but when it run I get nothing back and it seems to do nothing. Please help if you can.

  • @woolfy02
    @woolfy02 2 ปีที่แล้ว

    Is it possible for someone to tweet a bot an image, process it on my end( something similar to deepdream) and reply the photo back? I cant seem to find code examples of what I'm looking for

  • @Robber7
    @Robber7 6 ปีที่แล้ว +1

    Do a perlin noise basic 2d map generator (tile based) with grass, water, sand and mountains? =)

  • @FlamZCS
    @FlamZCS 6 ปีที่แล้ว

    someone of you guys knows how to do Rt's with the bot? I'm just looking for a function like /status/retweet or something like that. Thank you so much

  • @Rofldemo
    @Rofldemo 6 ปีที่แล้ว

    Hey your videos are awesome #FromFrance

  • @chl9741
    @chl9741 5 ปีที่แล้ว +1

    The user and site stream endpoints are now deprecated since August 16, 2018. For those following this video now, check out Twitter's announcement and guide to migrating to the Account Activity API: developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/migration/introduction
    P.S. Daniel you are my favorite.

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +2

      Thank you! I am hoping to revisit these tutorials over the weekend and think about re-doing them.

    • @darcy4487
      @darcy4487 4 ปีที่แล้ว +1

      @@TheCodingTrain yes please

  • @janchan8260
    @janchan8260 6 ปีที่แล้ว

    anyone any help me how to download the image from the tweet and process it?

  • @kronos7267
    @kronos7267 4 ปีที่แล้ว

    3:44 I had to go back and listen again...

  • @lonafernandes1445
    @lonafernandes1445 6 ปีที่แล้ว

    can u make a tutorial on discord bot and i have problem with heruko i use github

  • @anjalijain2860
    @anjalijain2860 6 ปีที่แล้ว

    How to write a function to check if a particular user has tweeted?

  • @urekmazino2083
    @urekmazino2083 6 ปีที่แล้ว

    nice nice nice

  • @kamilbolka
    @kamilbolka 6 ปีที่แล้ว +2

    Why don't you use "let"?

  • @siegeO2
    @siegeO2 6 ปีที่แล้ว

    How can this be done in python? Streaming seems a lot different

  • @rajatjoshi3594
    @rajatjoshi3594 3 ปีที่แล้ว

    I am getting the tweet id of the user who is mentioning #abc in the status or tweet and replying to them using status/update api and in reply to tweet id and getting the msg over my timeline but on the users tweet i am not seeing that reply or the notification why ?

  • @nismo5807
    @nismo5807 6 ปีที่แล้ว

    Hey. I have a problem; so I do everything in one file/one bot. I just copy the tweetIt and rename it, but i don't know how to make it put the status of newTweet, when its not in the same function. Should I put it in the tweetIt function (i called the copy tweetReply fyi)
    Edit: I literally found the error at the second i pressed Send... Ignroe the message :)

  • @MattBidewell
    @MattBidewell 6 ปีที่แล้ว

    How about tweeting emojis?

  • @glebdvinski3237
    @glebdvinski3237 6 ปีที่แล้ว

    I cannot get a search back from twitter... all I get is a CORS problem... I'm not sure what to do. I really need this :'(

  • @afrida1111
    @afrida1111 6 ปีที่แล้ว

    by giving the condition of 'replyto==='a2zi' is not working. when i remove this condition then this bot is working fine but after giving two replies it shows 'something went wrong'. and sometimes, it gives thanks to own twitter owner like @a2zi thanks!

  • @bumblebee0369
    @bumblebee0369 3 ปีที่แล้ว

    Your cute & quirky personality just brightened up my day thank you 😊
    I accidentally clicked on this video....but I have a little theory that nothing just happens without reason. Even if it's something small🤏 .....
    ....my reason was just because I was having a sad moment remembering my loved ones that has passed away including past pets. It just kills me inside sometimes cuz I miss them SO much.
    But I continued to listen to your video, not that I'm some computer programmer cuz nope I'm NOT, but because your quirky uplifting personality made me smile. It's as simple as that.
    ....and I just wanted to say thank you. 😊
    & I hope you & everyone that happens to read this has a wonderful day. 💜

  • @Nola1222Piano
    @Nola1222Piano 6 ปีที่แล้ว +16

    Wut, is this a reupload?

    • @TheCodingTrain
      @TheCodingTrain  6 ปีที่แล้ว +19

      Yes, the video got removed by TH-cam due to some a Yelp copyright notice. I scanned it over many times and could not find use of the Yelp logo anywhere so we made some small edit changes and re-uploaded.

    • @lasseibsen2942
      @lasseibsen2942 6 ปีที่แล้ว

      I have never coded in Java and most likely never will, but i love watching your videos! You should do some Python, hint hint :D

  • @alxx736
    @alxx736 3 ปีที่แล้ว

    Could you make it again ? Things are deprecated

  • @Bloom_HD
    @Bloom_HD 6 ปีที่แล้ว +5

    I'm gonna abuse the heck out of this.. muahaha.. Muhahahaa... MUAHHHAAHAHAHAHAHAAAA!

  • @jericnisperos5015
    @jericnisperos5015 6 ปีที่แล้ว

    Can you please create Pinball Game using Javascript ? :D

  • @anthonyorloff1794
    @anthonyorloff1794 6 ปีที่แล้ว +2

    Love the channel but it would be awesome if you did programs for all programming languages 👍

    • @furakkusu1337
      @furakkusu1337 6 ปีที่แล้ว +4

      Anthony Orloff yeah for all 1000+ programming languages

    • @DoctoratKetamine
      @DoctoratKetamine 5 ปีที่แล้ว

      @@furakkusu1337 i was waiting for this. i replied after a yier

  • @honeylove7u4
    @honeylove7u4 6 ปีที่แล้ว

    I dont know how to run this. can you please help me

    • @powpowson
      @powpowson 5 ปีที่แล้ว

      What do you need help with specifically?

  • @saritamurcia
    @saritamurcia 5 ปีที่แล้ว +2

    it doesnt work anymore :(

  • @faisaltaher851
    @faisaltaher851 6 ปีที่แล้ว

    you are the thank you

  • @wtiy
    @wtiy 3 ปีที่แล้ว

    in what language?

  • @Angadsingh95
    @Angadsingh95 6 ปีที่แล้ว

    When is neural networks going to be resumed¿?

    • @TheCodingTrain
      @TheCodingTrain  6 ปีที่แล้ว +1

      Later this year or early 2018 I hope.

  • @turkenits
    @turkenits 6 ปีที่แล้ว

    How this is a 15.7 if there is 15.8 and it uploded before

    • @turkenits
      @turkenits 6 ปีที่แล้ว

      No Name thanks

  • @ryanzarmbinski7446
    @ryanzarmbinski7446 6 ปีที่แล้ว +1

    If you don't call the bot "Coding Rainbot," it'll be a missed opportunity.

  • @ppunz
    @ppunz 3 ปีที่แล้ว +1

    came here from lucy/rat

  • @toastyPredicament
    @toastyPredicament 2 ปีที่แล้ว

    i learned how to bell :v

  • @rafaelalmeida2020
    @rafaelalmeida2020 6 ปีที่แล้ว

    1080p quality video
    720p screen resolution
    480p camera resolution

  • @wouter11234
    @wouter11234 6 ปีที่แล้ว

    Wait is this a reupload?

    • @TheCodingTrain
      @TheCodingTrain  6 ปีที่แล้ว

      Yes, the video got removed by TH-cam due to some a Yelp copyright notice. I scanned it over many times and could not find use of the Yelp logo anywhere so we made some small edit changes and re-uploaded.

  • @vivekverma5200
    @vivekverma5200 5 ปีที่แล้ว +1

    Hi , this information is no longer helpful. twitter have removed stream functionality. Can you please update the content. Because your videos are very helpful.

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +3

      I am working on a new set of tutorials for a Mastodon bot. Unfortunately with the restrictions Twitter has put on the developer API I'm not sure it's worth the effort to update these.

    • @vivekverma5200
      @vivekverma5200 5 ปีที่แล้ว +1

      @@TheCodingTrain new set of tutorials! That sounds amazing. Waiting eagerly. :)

    • @EDashMan
      @EDashMan 5 ปีที่แล้ว

      @@TheCodingTrain So are you saying this no longer works anymore? Please can you upload the new way to do this ASAP please. That's when I'll subscribe

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +2

      @@EDashMan I wish I could, unfortunately the Twitter API doesn't include this feature anymore. (Note get() and post() still work, just no stream)

    • @EDashMan
      @EDashMan 5 ปีที่แล้ว

      The Coding Train so if Rihanna posted and I wanted to be the first reply to her tweet, I can’t do that ?

  • @lizbethvarghese8161
    @lizbethvarghese8161 ปีที่แล้ว

    how to make a twitter bot reply to a hastag

  • @turkenits
    @turkenits 6 ปีที่แล้ว

    Can you do slither.io(coding challenge)

  • @SA-jl6ie
    @SA-jl6ie 6 ปีที่แล้ว

    I asked you many times , what is your computer ، i want to buy like it ?!!?

    • @TheCodingTrain
      @TheCodingTrain  6 ปีที่แล้ว +1

      it's just a mac

    • @SA-jl6ie
      @SA-jl6ie 6 ปีที่แล้ว

      The Coding Train mac pro or mac air ? This is important to me 🌹

  • @angelcaru
    @angelcaru 4 ปีที่แล้ว

    What if there is a bot with the name @bot and each time someone replies him he replies the reverse character and someone sent to him "@bot HellolleH tob@"
    Then the bot would go laike this:
    "@bot HellolleH tob@". Reverse!
    "@bot HellolleH tob@". Reverse!

  • @ReddEdits
    @ReddEdits 6 ปีที่แล้ว +1

    Make a discord bot

  • @chicagoboy279
    @chicagoboy279 4 ปีที่แล้ว

    Im scared to tweet rn

  • @coding1818
    @coding1818 2 ปีที่แล้ว

    Why you always put finger in nose sir 🤣🤣🤣

  • @adriandeveraaa
    @adriandeveraaa 4 ปีที่แล้ว

    My twitter dev account was revoked because they dont like bots apparently :/

  • @geoffwagner4935
    @geoffwagner4935 ปีที่แล้ว

    better yet say say "twoot" 3 time in row. Right after you try and beat Robb's Flynn's belching record right into your mic this time, really needs some more commitment. it'll be Danial's Shiffman's "happy hour" and the most confusing 10 seconds of your you tubers files . i got complimented by the gas station lady last time i was in there, she said it sounded good and healthy she loves people who just let a rip when they have to burp!

  • @Hepasta
    @Hepasta 4 ปีที่แล้ว

    Error: Bad Twitter streaming request: 404

    • @MrShadowhawk7011
      @MrShadowhawk7011 4 ปีที่แล้ว +2

      Unfortunately, the Twitter API has depreciated user streams.

  • @user-ji7pz2rb2b
    @user-ji7pz2rb2b 4 ปีที่แล้ว

    Hi from Ukraine. I want to create a bot which can send tweet from virtual account (custom profile). But I got an error with code number 87. When I attempt to create this custom profile. Anyone can help me?

  • @BenJamin-ox7kj
    @BenJamin-ox7kj 5 ปีที่แล้ว

    In my field I get nowhere, the guys at the top dominate the market, I often see they get millions of views of course they have millions of subs, i dig down deeper and and on socialblade checkout their most viewed video and almost always will see this, the channel will pin a comment like what do you think of this video? (for example) then the replies to that comment will be about 500 and they are like 0 or disddon, or ffffshsh or in arabic or all spanish, what kind of bot are they using? They obviously use this to get ranked higher in the youtube suggest videos or videos on the right handside therefore leapfrogging all competitors and thats how they get real views and real subscribers, I see many doing this but Im the only dumb one who doesnt know, can any of you guys be kind enough to let me know, I work hard to make videos and and in one year made $5 and these guys are making millions unfairly.
    I can show you at least 20 channels at the top doing this and youtube have done NOTHING for years.

  • @vincedayanan8742
    @vincedayanan8742 6 ปีที่แล้ว

    If those people could be alive would you give up your guns

  • @dannyc321
    @dannyc321 6 ปีที่แล้ว +1

    AYY NOTIFICATION SQUAD I LOVE YOUR VIDEOS PLEASE NOTICE ME

    • @kamilbolka
      @kamilbolka 6 ปีที่แล้ว +1

      You have been noticed