title
How To Create A Twitter Bot With Python | Build a Startup #4
description
Learn how to create a Twitter bot with Python and Tweepy!
Also, here are the links I mentioned in the video:
- How to install Tweepy and the source code of this project: https://csdojo.io/twitter
- PythonAnywhere (a referral link): https://csdojo.io/py
And this was part of the:
- Build a startup series: https://www.youtube.com/playlist?list=PLBZBJbE_rGRXBhJNdKbN7IUy-ctlOFxA1
- As well as my Python tutorial series: https://www.youtube.com/playlist?list=PLBZBJbE_rGRWeh5mIBhD-hhDwSEDxogDg
And, you can find me on Twitter and Instagram @ykdojo!
detail
{'title': 'How To Create A Twitter Bot With Python | Build a Startup #4', 'heatmap': [{'end': 162.661, 'start': 128.788, 'weight': 0.784}, {'end': 260.688, 'start': 234.288, 'weight': 0.744}, {'end': 569.895, 'start': 536.214, 'weight': 0.812}, {'end': 841.955, 'start': 752.476, 'weight': 0.797}, {'end': 1660.882, 'start': 1605.653, 'weight': 0.819}], 'summary': "Learn to create a twitter bot with python, featuring a bot that responds to tweets with the hashtag 'hello world' within 15 seconds. it covers setting up twitter api, python 3, api keys, authentication, bot development, automation of responses, and deploying the bot on python anywhere.", 'chapters': [{'end': 243.432, 'segs': [{'end': 128.788, 'src': 'embed', 'start': 0.309, 'weight': 0, 'content': [{'end': 4.973, 'text': "Hi everyone! In this video, I'm gonna show you how to make a Twitter bot with Python.", 'start': 0.309, 'duration': 4.664}, {'end': 8.955, 'text': 'First of all, let me just show you what the final result is gonna look like.', 'start': 5.753, 'duration': 3.202}, {'end': 14.079, 'text': "So right now I'm in my personal Twitter account at ykdojo,", 'start': 9.596, 'duration': 4.483}, {'end': 20.684, 'text': "but the Twitter account we're gonna be controlling with Python is gonna be this account at editdojo instead.", 'start': 14.079, 'duration': 6.605}, {'end': 25.434, 'text': "And here's the way this account is gonna work, or this bot is gonna work.", 'start': 21.588, 'duration': 3.846}, {'end': 36.47, 'text': 'When you tweet at this account, at Edit Dojo, from either my account or your account with the hashtag hello world,', 'start': 26.295, 'duration': 10.175}, {'end': 43.468, 'text': "it's gonna respond back with the same hashtag within 15 seconds or so.", 'start': 38.186, 'duration': 5.282}, {'end': 45.129, 'text': "So let's just wait for a bit.", 'start': 44.089, 'duration': 1.04}, {'end': 47.91, 'text': 'And I think I got a new tweet here.', 'start': 46.23, 'duration': 1.68}, {'end': 50.371, 'text': "Let's check if that's the correct one.", 'start': 48.591, 'duration': 1.78}, {'end': 51.992, 'text': 'Let me just refresh the page here.', 'start': 50.571, 'duration': 1.421}, {'end': 54.013, 'text': "And it's the correct one.", 'start': 52.752, 'duration': 1.261}, {'end': 58.015, 'text': 'I get hello world back to you from this account, Edit Dojo.', 'start': 54.753, 'duration': 3.262}, {'end': 65.798, 'text': "So I'm going to show you how I made this, but just by changing the implementation a little bit, you'll be able to do different things.", 'start': 58.735, 'duration': 7.063}, {'end': 73.401, 'text': "Like for example, you might say, if someone mentions me with a certain keyword, I'm going to send them a direct message.", 'start': 66.358, 'duration': 7.043}, {'end': 80.144, 'text': "Or if someone I follow mentions a certain topic, then I'm going to reply to that message.", 'start': 74.041, 'duration': 6.103}, {'end': 81.971, 'text': "Anyway, let's get started.", 'start': 80.851, 'duration': 1.12}, {'end': 90.095, 'text': 'Okay, actually the first thing you need to do to follow this tutorial is you need to apply for a developer account for Twitter.', 'start': 82.612, 'duration': 7.483}, {'end': 98.218, 'text': 'To do that, you can just go to your browser and then search for Twitter developer.', 'start': 91.155, 'duration': 7.063}, {'end': 103.46, 'text': 'And by the way, make sure to sign in to your Twitter account first.', 'start': 99.138, 'duration': 4.322}, {'end': 106.761, 'text': "And then, of course, create a Twitter account if you don't have it yet.", 'start': 103.88, 'duration': 2.881}, {'end': 114.524, 'text': 'And if you go to developer.twitter.com, You see this button at the top that says apply,', 'start': 107.622, 'duration': 6.902}, {'end': 120.326, 'text': 'so click that and then just follow everything that says here.', 'start': 114.524, 'duration': 5.802}, {'end': 123.868, 'text': 'So choose which Twitter account you want to use here.', 'start': 120.326, 'duration': 3.542}, {'end': 125.888, 'text': "I'm gonna use another Twitter account.", 'start': 123.868, 'duration': 2.02}, {'end': 128.788, 'text': 'I have here at CS dojo for four.', 'start': 125.888, 'duration': 2.9}], 'summary': 'The video demonstrates creating a twitter bot in python, which responds with a hashtag within 15 seconds to tweets mentioning a specific hashtag; viewers are encouraged to customize the bot for different actions and are directed to apply for a developer account on twitter.', 'duration': 128.479, 'max_score': 0.309, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc309.jpg'}, {'end': 162.661, 'src': 'heatmap', 'start': 128.788, 'weight': 0.784, 'content': [{'end': 141.199, 'text': 'so click continue and then follow everything else here, and And then, once you go through everything, uh, you should see terms of service.', 'start': 128.788, 'duration': 12.411}, {'end': 149.687, 'text': 'So read through it and then check these boxes or, you know, this first box at least, and click submit application.', 'start': 141.88, 'duration': 7.807}, {'end': 155.557, 'text': "And then once you confirm your email address, you're done.", 'start': 152.435, 'duration': 3.122}, {'end': 162.661, 'text': 'So actually, initially, I thought there was gonna be a waiting period, but it looks like I got the access already.', 'start': 156.237, 'duration': 6.424}], 'summary': 'Complete the application, confirm email, and access granted without waiting period.', 'duration': 33.873, 'max_score': 128.788, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc128788.jpg'}, {'end': 219.94, 'src': 'embed', 'start': 194.495, 'weight': 3, 'content': [{'end': 201.803, 'text': "So then I'm just going to search for Twitter developer on Google and find this website again.", 'start': 194.495, 'duration': 7.308}, {'end': 205.548, 'text': 'And on the top right corner, you should see your name.', 'start': 201.823, 'duration': 3.725}, {'end': 209.292, 'text': 'And then when you hover over it, you should see this one, Apps.', 'start': 206.129, 'duration': 3.163}, {'end': 213.215, 'text': "So click that, and here you'll be able to create a new app.", 'start': 209.853, 'duration': 3.362}, {'end': 219.94, 'text': "I already have one app here, Edit Dojo, but I'm just gonna create a new app just for demonstration.", 'start': 213.235, 'duration': 6.705}], 'summary': 'Demonstrate how to create a new app on twitter developer platform.', 'duration': 25.445, 'max_score': 194.495, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc194495.jpg'}], 'start': 0.309, 'title': 'Creating a twitter bot with python', 'summary': "Demonstrates how to create a twitter bot using python, featuring a bot that responds to tweets with the hashtag 'hello world' within 15 seconds. it also outlines the process of applying for a developer account for twitter, including creating an app and confirming access through email and phone number.", 'chapters': [{'end': 73.401, 'start': 0.309, 'title': 'Twitter bot with python', 'summary': "Demonstrates how to create a twitter bot using python, showcasing a bot that responds to tweets with the hashtag 'hello world' within 15 seconds, providing a practical example and highlighting the potential for customization.", 'duration': 73.092, 'highlights': ["The Twitter bot responds to tweets with the hashtag 'hello world' within 15 seconds, showcasing the practical implementation. (Quantifiable data: 15 seconds)", "The demonstration emphasizes the potential for customization by mentioning the ability to modify the bot's behavior, such as sending direct messages based on specific keywords. (Key point: customization)", 'The video showcases the process of making a Twitter bot with Python, providing a practical example of controlling a specific Twitter account. (Key point: practical demonstration)']}, {'end': 243.432, 'start': 74.041, 'title': 'Setting up twitter developer account', 'summary': 'Outlines the process of applying for a developer account for twitter, including creating an app and the steps involved, with key points such as applying for a developer account, creating a twitter app, and confirming access through email and phone number.', 'duration': 169.391, 'highlights': ['Creating a Twitter app involves providing a description, website URL, and other necessary details.', 'Applying for a developer account for Twitter requires following the instructions on the Twitter developer website and confirming the email address, with the possibility of needing to confirm a phone number or wait for access.', 'The first step to follow the tutorial is to apply for a developer account for Twitter by visiting the Twitter developer website and signing in to a Twitter account.', "Upon visiting developer.twitter.com, there is an option to apply for a developer account by clicking the 'apply' button at the top of the page."]}], 'duration': 243.123, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc309.jpg', 'highlights': ["The Twitter bot responds to tweets with the hashtag 'hello world' within 15 seconds, showcasing the practical implementation. (Quantifiable data: 15 seconds)", "The demonstration emphasizes the potential for customization by mentioning the ability to modify the bot's behavior, such as sending direct messages based on specific keywords. (Key point: customization)", 'The video showcases the process of making a Twitter bot with Python, providing a practical example of controlling a specific Twitter account. (Key point: practical demonstration)', 'Creating a Twitter app involves providing a description, website URL, and other necessary details.', 'Applying for a developer account for Twitter requires following the instructions on the Twitter developer website and confirming the email address, with the possibility of needing to confirm a phone number or wait for access.', 'The first step to follow the tutorial is to apply for a developer account for Twitter by visiting the Twitter developer website and signing in to a Twitter account.', "Upon visiting developer.twitter.com, there is an option to apply for a developer account by clicking the 'apply' button at the top of the page."]}, {'end': 609.309, 'segs': [{'end': 269.353, 'src': 'embed', 'start': 244.312, 'weight': 0, 'content': [{'end': 252.88, 'text': 'Anyway, once you finish that, click create, and then read everything, click create, and then your app should be created.', 'start': 244.312, 'duration': 8.568}, {'end': 260.688, 'text': 'And once your app is created, the next step is to check the permissions and make sure you have read and write permission,', 'start': 253.601, 'duration': 7.087}, {'end': 263.25, 'text': "because we're gonna be reading and writing tweets.", 'start': 260.688, 'duration': 2.562}, {'end': 269.353, 'text': 'and then go to keys and tokens and make sure you have all your keys generated.', 'start': 264.131, 'duration': 5.222}], 'summary': 'After creating the app, ensure read and write permissions and generate all necessary keys.', 'duration': 25.041, 'max_score': 244.312, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc244312.jpg'}, {'end': 348.418, 'src': 'embed', 'start': 321.937, 'weight': 1, 'content': [{'end': 326.758, 'text': 'The first one is to obviously, you know, download and then install Python 3 on your system.', 'start': 321.937, 'duration': 4.821}, {'end': 336.302, 'text': "But if you don't want to bother going through the process or if you have trouble doing that, you can just use this website called Python Anywhere,", 'start': 327.359, 'duration': 8.943}, {'end': 339.883, 'text': 'which you can find at csdojo.io slash py.', 'start': 336.302, 'duration': 3.581}, {'end': 348.418, 'text': 'So this is a website where you can create a Python script and run them without installing Python at all.', 'start': 342.552, 'duration': 5.866}], 'summary': 'Python 3 can be installed or used via python anywhere website to run scripts without installation.', 'duration': 26.481, 'max_score': 321.937, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc321937.jpg'}, {'end': 423.03, 'src': 'embed', 'start': 393.683, 'weight': 3, 'content': [{'end': 397.388, 'text': 'And the next step after this is actually going to be a little bit tricky.', 'start': 393.683, 'duration': 3.705}, {'end': 402.755, 'text': "So we're going to be using this library called TweetPie, you know, Twitter for Python.", 'start': 398.329, 'duration': 4.426}, {'end': 410.605, 'text': 'But the thing is, it only works with Python, as you can see, 2.7, 3.4, 3.5, and 3.6.', 'start': 403.316, 'duration': 7.289}, {'end': 415.087, 'text': "So so Python 3.7 doesn't work with this library.", 'start': 410.605, 'duration': 4.482}, {'end': 418.008, 'text': 'So there are a few options for getting around that issue.', 'start': 415.087, 'duration': 2.921}, {'end': 423.03, 'text': 'The first option is to use a previous version of Python, for example 3.7..', 'start': 418.008, 'duration': 5.022}], 'summary': "Next step: utilize tweetpie, but it's limited to python 2.7 - 3.6. options include using previous python version.", 'duration': 29.347, 'max_score': 393.683, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc393683.jpg'}, {'end': 505.385, 'src': 'embed', 'start': 475.615, 'weight': 4, 'content': [{'end': 483.358, 'text': "Anyway, copy and paste that command on terminal or in console, and then I'm actually gonna replace pip with pip3..", 'start': 475.615, 'duration': 7.743}, {'end': 488.159, 'text': 'It really depends on your environment which command you should use.', 'start': 484.218, 'duration': 3.941}, {'end': 494.221, 'text': "So I would try pip3 first, and then if it doesn't work, I would try pip install and so on.", 'start': 488.739, 'duration': 5.482}, {'end': 496.142, 'text': 'So let me just try this here.', 'start': 494.922, 'duration': 1.22}, {'end': 505.385, 'text': 'And this is gonna install, like I said, a particular version of TwiPi that should work with Python 3.7.', 'start': 497.022, 'duration': 8.363}], 'summary': 'Install twipi with pip3 for python 3.7 environment.', 'duration': 29.77, 'max_score': 475.615, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc475615.jpg'}, {'end': 584.468, 'src': 'heatmap', 'start': 536.214, 'weight': 2, 'content': [{'end': 537.636, 'text': "I'm actually not sure how to pronounce it.", 'start': 536.214, 'duration': 1.422}, {'end': 541.22, 'text': 'Anyway, go into that folder that you just created.', 'start': 538.357, 'duration': 2.863}, {'end': 546.144, 'text': 'and then create a new file.', 'start': 544.443, 'duration': 1.701}, {'end': 551.606, 'text': "Let's call it mytwitterbot.py.", 'start': 546.824, 'duration': 4.782}, {'end': 558.269, 'text': "Let's just write print this is my Twitter bot just to get started.", 'start': 552.587, 'duration': 5.682}, {'end': 566.953, 'text': 'Go back to terminal and then in the same folder type in Python 3 or Python mytwitterbot.py.', 'start': 559.09, 'duration': 7.863}, {'end': 569.895, 'text': 'And this should print this.', 'start': 568.514, 'duration': 1.381}, {'end': 571.217, 'text': 'This is my Twitter bot.', 'start': 570.136, 'duration': 1.081}, {'end': 574.099, 'text': 'Okay, the next step is to import TweetPie.', 'start': 571.817, 'duration': 2.282}, {'end': 581.866, 'text': 'After installing TweetPie, you know, with the command I showed you earlier, you should be able to do that with just this.', 'start': 574.74, 'duration': 7.126}, {'end': 584.468, 'text': 'Import TweetPie.', 'start': 582.686, 'duration': 1.782}], 'summary': "Create mytwitterbot.py, print 'this is my twitter bot,' and import tweetpie.", 'duration': 64.212, 'max_score': 536.214, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc536214.jpg'}], 'start': 244.312, 'title': 'Setting up twitter api and python 3', 'summary': 'Explains the steps to create a twitter app, obtain necessary keys and tokens, and check for python 3 installation or use python anywhere for running python scripts without installation. it also covers setting up a twitter bot using python 3.7, including using the library tweetpie and the specific commands needed for installation and execution.', 'chapters': [{'end': 372.736, 'start': 244.312, 'title': 'Setting up twitter api and python 3', 'summary': 'Explains the steps to create a twitter app, obtain necessary keys and tokens, and check for python 3 installation or use python anywhere for running python scripts without installation.', 'duration': 128.424, 'highlights': ['The first step is to create a Twitter app and ensure read and write permissions, along with generating necessary keys and tokens. Creating a Twitter app with read and write permissions and generating consumer api keys, api key, api secret keys, access token, and access token secrets.', 'The next step is to verify the installation of Python 3 and suggests using Python Anywhere as an alternative for running Python scripts without installing Python on the system. Verifying Python 3 installation and providing an alternative option of using Python Anywhere for running Python scripts without installation.']}, {'end': 609.309, 'start': 373.596, 'title': 'Setting up twitter bot with python 3.7', 'summary': 'Explains the steps to set up a twitter bot using python 3.7, including using the library tweetpie and the specific commands needed for installation and execution.', 'duration': 235.713, 'highlights': ['The tutorial provides instructions for setting up a Twitter bot using Python 3.7 and the library TweetPie. The chapter outlines the process of setting up a Twitter bot using Python 3.7 and the TweetPie library.', 'The chapter explains the specific command required to install a particular version of TweetPie that works with Python 3.7. Instructions are provided for installing a specific version of TweetPie that is compatible with Python 3.7.', "The tutorial advises on using the command 'pip3' and then 'pip install' if needed for the installation process. The tutorial suggests using 'pip3' initially, and then 'pip install' if necessary for the installation.", 'The chapter recommends creating a new directory and file for the Twitter bot project and using a text editor like Atom for coding. It is recommended to create a new directory and file for the Twitter bot project and utilize a text editor like Atom for coding.']}], 'duration': 364.997, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc244312.jpg', 'highlights': ['Creating a Twitter app with read and write permissions and generating necessary keys and tokens', 'Verifying Python 3 installation and providing an alternative option of using Python Anywhere for running Python scripts without installation', 'The chapter outlines the process of setting up a Twitter bot using Python 3.7 and the TweetPie library', 'Instructions are provided for installing a specific version of TweetPie that is compatible with Python 3.7', "The tutorial suggests using 'pip3' initially, and then 'pip install' if necessary for the installation", 'It is recommended to create a new directory and file for the Twitter bot project and utilize a text editor like Atom for coding']}, {'end': 1110.144, 'segs': [{'end': 718.642, 'src': 'embed', 'start': 610.65, 'weight': 0, 'content': [{'end': 619.254, 'text': 'We have, as you can see, these four variables here consumer key, consumer secret, access access key and access secret.', 'start': 610.65, 'duration': 8.604}, {'end': 621.536, 'text': 'These are the keys that we saw earlier.', 'start': 619.254, 'duration': 2.282}, {'end': 626.258, 'text': 'so copy and paste Your particular keys into those.', 'start': 621.536, 'duration': 4.722}, {'end': 633.783, 'text': 'I have the consumer API key here and the api secret key here and so on.', 'start': 626.258, 'duration': 7.525}, {'end': 642.65, 'text': 'and access key i mean access secret should be right here, and once you have this, you should have these three commands.', 'start': 633.783, 'duration': 8.867}, {'end': 648.776, 'text': "after that we're setting up this auth object using consumer key and consumer secret,", 'start': 642.65, 'duration': 6.126}, {'end': 654.621, 'text': 'and then we set access token on the auth object with access key and access secret.', 'start': 648.776, 'duration': 5.845}, {'end': 662.085, 'text': "don't worry too much about what it's doing right now, But the important part is after that we're setting up this object called API.", 'start': 654.621, 'duration': 7.464}, {'end': 670.908, 'text': "And we're going to be using this API object to basically talk to Twitter, to read data from Twitter and write data into Twitter.", 'start': 662.505, 'duration': 8.403}, {'end': 676.47, 'text': 'So save this file and go back to terminal and run this command again.', 'start': 671.489, 'duration': 4.981}, {'end': 679.752, 'text': "And if you get no error, then that's good again.", 'start': 677.371, 'duration': 2.381}, {'end': 687.758, 'text': 'And after that, we want to be able to process all the ad mention tweets directed for at EditDojo.', 'start': 680.692, 'duration': 7.066}, {'end': 698.926, 'text': 'So let me go into my personal Twitter account, at YKDojo, and then create a bunch of new ad mentions for EditDojo.', 'start': 688.478, 'duration': 10.448}, {'end': 705.251, 'text': "So let me just write, at EditDojo, let's say, tweet1.", 'start': 699.807, 'duration': 5.444}, {'end': 708.113, 'text': 'So this is going to be the first at mention.', 'start': 706.232, 'duration': 1.881}, {'end': 718.642, 'text': "And then I'll say, at EditDojo, tweet2, hashtag, hello world, and so on.", 'start': 709.114, 'duration': 9.528}], 'summary': 'Setting up api keys and commands to interact with twitter api, testing for errors, and processing ad mention tweets for editdojo.', 'duration': 107.992, 'max_score': 610.65, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc610650.jpg'}, {'end': 841.955, 'src': 'heatmap', 'start': 752.476, 'weight': 0.797, 'content': [{'end': 758.745, 'text': "In this Python shell, copy the commands we've written so far, all the commands we've written so far.", 'start': 752.476, 'duration': 6.269}, {'end': 761.607, 'text': 'and then paste it here.', 'start': 760.666, 'duration': 0.941}, {'end': 767.67, 'text': "So this way, you know, we've just created the API object in this Python shell environment.", 'start': 762.327, 'duration': 5.343}, {'end': 770.592, 'text': 'If you type in API, you should see something like this.', 'start': 768.17, 'duration': 2.422}, {'end': 773.974, 'text': "Now let me go to Tweepy's documentation for a second.", 'start': 771.332, 'duration': 2.642}, {'end': 779.117, 'text': 'You can find this page just by searching for Tweepy documentation on Google.', 'start': 774.514, 'duration': 4.603}, {'end': 785.381, 'text': 'and here you see this command api.mentions timeline.', 'start': 780.257, 'duration': 5.124}, {'end': 790.564, 'text': 'this is this is going to return all the recent mentions for this account.', 'start': 785.381, 'duration': 5.183}, {'end': 792.765, 'text': "so that's what we're going to use.", 'start': 790.564, 'duration': 2.201}, {'end': 799.09, 'text': 'and there are, you know, different kinds of commands here and, for example, you have you know home timeline.', 'start': 792.765, 'duration': 6.325}, {'end': 805.594, 'text': "if you want to get all the tweets from, you know people you follow, but here we're going to use mentions timeline.", 'start': 799.09, 'duration': 6.504}, {'end': 818.474, 'text': 'So go back to a terminal and then try typing in api.mentionsTimeline parentheses, and then you should get some kind of results like this.', 'start': 806.778, 'duration': 11.696}, {'end': 823.441, 'text': "Let's store this in a new variable called mentions.", 'start': 819.255, 'duration': 4.186}, {'end': 831.731, 'text': "So here, if you just print out the results just by typing in mentions, I think it's really hard to know what's going on,", 'start': 824.369, 'duration': 7.362}, {'end': 833.692, 'text': "because there's a lot of stuff here.", 'start': 831.731, 'duration': 1.961}, {'end': 841.955, 'text': 'So what I would do here is I would just say type mentions to find the type of this result.', 'start': 834.712, 'duration': 7.243}], 'summary': 'Using tweepy api to retrieve recent mentions in python environment.', 'duration': 89.479, 'max_score': 752.476, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc752476.jpg'}, {'end': 1010.863, 'src': 'embed', 'start': 982.799, 'weight': 5, 'content': [{'end': 988.285, 'text': "So, using this information, we'll be able to you know if you want to extract, for example,", 'start': 982.799, 'duration': 5.486}, {'end': 994.913, 'text': "the text you'll be able to just do mentions square bracket zero, which is an object dot text.", 'start': 988.285, 'duration': 6.628}, {'end': 998.417, 'text': 'And this is the last tweet that we sent out.', 'start': 996.114, 'duration': 2.303}, {'end': 1006.44, 'text': "And then if you want to extract the ID, which we're going to use later, you can just replace text with ID and then you get this.", 'start': 999.335, 'duration': 7.105}, {'end': 1010.863, 'text': 'And this is actually an integer, I think, by the way.', 'start': 1007.34, 'duration': 3.523}], 'summary': 'Using this information, we can extract text and id from the last tweet, with id being an integer.', 'duration': 28.064, 'max_score': 982.799, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc982799.jpg'}], 'start': 610.65, 'title': 'Setting up api keys and authentication and twitter bot with python', 'summary': 'Covers the process of setting up api keys and authentication, including essential variables and step-by-step commands, and setting up an api object to interact with twitter, creating and processing ad mention tweets for editdojo, and extracting text and id from the tweet data to use in the python environment.', 'chapters': [{'end': 654.621, 'start': 610.65, 'title': 'Setting up api keys and authentication', 'summary': 'Covers the process of setting up api keys and authentication, including the four essential variables and the step-by-step commands for creating an auth object using these keys.', 'duration': 43.971, 'highlights': ['The four essential variables for setting up API keys and authentication are consumer key, consumer secret, access key, and access secret.', 'The process includes copying and pasting the specific keys into the designated fields.', 'The step-by-step commands for setting up the auth object involve using the consumer key and secret, as well as the access token with the access key and secret.']}, {'end': 1110.144, 'start': 654.621, 'title': 'Setting up twitter bot with python', 'summary': 'Covers setting up an api object to interact with twitter, creating and processing ad mention tweets for editdojo, and extracting text and id from the tweet data to use in the python environment.', 'duration': 455.523, 'highlights': ['Setting up API object to interact with Twitter The chapter discusses setting up an object called API to interact with Twitter, allowing the bot to read and write data. This is a crucial step in the process.', 'Creating and processing ad mention tweets for EditDojo The chapter explains the creation of ad mention tweets for EditDojo, with specific examples and the necessity to respond to tweets with a certain hashtag.', 'Extracting text and ID from the tweet data to use in the Python environment The process of extracting text and ID from tweet data is explained, including the conversion of ID into a string, and how to print the ad mentions received from the command.']}], 'duration': 499.494, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc610650.jpg', 'highlights': ['The four essential variables for setting up API keys and authentication are consumer key, consumer secret, access key, and access secret.', 'The process includes copying and pasting the specific keys into the designated fields.', 'The step-by-step commands for setting up the auth object involve using the consumer key and secret, as well as the access token with the access key and secret.', 'Setting up API object to interact with Twitter The chapter discusses setting up an object called API to interact with Twitter, allowing the bot to read and write data. This is a crucial step in the process.', 'Creating and processing ad mention tweets for EditDojo The chapter explains the creation of ad mention tweets for EditDojo, with specific examples and the necessity to respond to tweets with a certain hashtag.', 'Extracting text and ID from the tweet data to use in the Python environment The process of extracting text and ID from tweet data is explained, including the conversion of ID into a string, and how to print the ad mentions received from the command.']}, {'end': 1449.716, 'segs': [{'end': 1163.223, 'src': 'embed', 'start': 1134.42, 'weight': 0, 'content': [{'end': 1143.787, 'text': 'Okay, the next thing we wanna do is for each of these tweets, we wanna check if each of these tweets includes the hashtag hello world or not.', 'start': 1134.42, 'duration': 9.367}, {'end': 1152.014, 'text': 'So go back to the Python terminal and then make sure that you still have this variable mentions.', 'start': 1144.488, 'duration': 7.526}, {'end': 1155.056, 'text': "And let's just retrieve one of them, mentions zero.", 'start': 1152.654, 'duration': 2.402}, {'end': 1158.839, 'text': "Let's just call this one T zero.", 'start': 1155.577, 'duration': 3.262}, {'end': 1163.223, 'text': 'And then to get text, we were able to do just T zero dot text.', 'start': 1159.46, 'duration': 3.763}], 'summary': 'Check tweets for #hello world, retrieve text using python terminal.', 'duration': 28.803, 'max_score': 1134.42, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1134420.jpg'}, {'end': 1246.389, 'src': 'embed', 'start': 1191.684, 'weight': 1, 'content': [{'end': 1200.993, 'text': 'And the reason I want to convert it to a lowercase is because you know this hashtag hello world could be in any case right?. It could be all caps or.', 'start': 1191.684, 'duration': 9.309}, {'end': 1207.596, 'text': 'It could be that H and W are capitalized and so on, or it could be all lowercase.', 'start': 1201.673, 'duration': 5.923}, {'end': 1212.938, 'text': "But if we lowercase everything, we'll be able to handle all of those cases.", 'start': 1208.296, 'duration': 4.642}, {'end': 1221.924, 'text': 'And then we want to say does this lowercase version of the text include the hashtag hello world?', 'start': 1213.478, 'duration': 8.446}, {'end': 1235.382, 'text': 'we can do that with this command quotes hello world, close the quotes and then in this, and this returns true, if this hashtag is in there,', 'start': 1221.924, 'duration': 13.458}, {'end': 1242.607, 'text': "But if it's not in there for example, hello world 2 is not in there, it's going to return false.", 'start': 1236.343, 'duration': 6.264}, {'end': 1246.389, 'text': "So that's what we're going to use in our main file.", 'start': 1243.327, 'duration': 3.062}], 'summary': 'Converting to lowercase allows handling different case variations. check for inclusion of hashtag hello world using a command, returning true or false.', 'duration': 54.705, 'max_score': 1191.684, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1191684.jpg'}, {'end': 1424.052, 'src': 'embed', 'start': 1372.728, 'weight': 3, 'content': [{'end': 1378.672, 'text': "In that case, we don't want to take a look at these three tweets again because we've already done that.", 'start': 1372.728, 'duration': 5.944}, {'end': 1381.254, 'text': "We don't want to respond to the same people over and over again.", 'start': 1378.692, 'duration': 2.562}, {'end': 1388.519, 'text': "So we'll need to make sure to store the ID of the last tweet that we've seen.", 'start': 1381.894, 'duration': 6.625}, {'end': 1395.383, 'text': "So that's why I created a new file in the same folder called the last seen ID.txt.", 'start': 1389.339, 'duration': 6.044}, {'end': 1402.348, 'text': 'So I decided to just store that ID in this file and then retrieve it every time we run our script.', 'start': 1395.924, 'duration': 6.424}, {'end': 1408.209, 'text': 'It could be in a database or something, but a text file is the simplest solution for this kind of stuff.', 'start': 1402.768, 'duration': 5.441}, {'end': 1416.111, 'text': 'So I wrote these two functions for that, retrieve last seen ID and store last seen ID.', 'start': 1409.009, 'duration': 7.102}, {'end': 1424.052, 'text': 'Retrieve last seen ID takes the file name, this file name, and then returns the last seen ID.', 'start': 1416.911, 'duration': 7.141}], 'summary': 'Created functions to store and retrieve last seen tweet id from a text file.', 'duration': 51.324, 'max_score': 1372.728, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1372728.jpg'}], 'start': 1110.945, 'title': 'Twitter bot development', 'summary': "Covers developing a twitter bot to check tweets for the hashtag 'hello world' and respond accordingly, resulting in 2 out of 6 tweets containing the hashtag. it also discusses the process of storing and retrieving tweet ids using a script, including the concept of last seen id, the use of a text file for storage, and the functions retrieve last seen id and store last seen id.", 'chapters': [{'end': 1308.197, 'start': 1110.945, 'title': 'Twitter bot hashtag checker', 'summary': "Demonstrates the process of checking tweets for the presence of the hashtag 'hello world' and responding accordingly, resulting in 2 out of 6 tweets containing the hashtag.", 'duration': 197.252, 'highlights': ["The process involves retrieving tweets, converting them to lowercase, and checking for the presence of the hashtag 'hello world', resulting in a successful response for 2 out of 6 tweets.", 'The lowercase conversion ensures handling of different cases for the hashtag, such as all caps or mixed case variations, increasing the reliability of the detection process.', "The script successfully identifies the presence of the hashtag 'hello world' in tweets and responds accordingly, showcasing a functional implementation of the hashtag checker."]}, {'end': 1449.716, 'start': 1308.877, 'title': 'Developing a script: storing and retrieving tweet ids', 'summary': 'Discusses the process of developing a script to store and retrieve tweet ids, including the concept of last seen id, the use of text file for storage, and the functions retrieve last seen id and store last seen id.', 'duration': 140.839, 'highlights': ['The process of developing a script to store and retrieve tweet IDs is explained, including the concept of last seen ID and the use of a text file for storage.', 'The functions retrieve last seen ID and store last seen ID are created to handle the retrieval and storage of tweet IDs in a text file.', 'The need to store the ID of the last tweet seen is emphasized to avoid responding to the same people repeatedly.']}], 'duration': 338.771, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1110945.jpg', 'highlights': ["The process involves retrieving tweets, converting them to lowercase, and checking for the presence of the hashtag 'hello world', resulting in a successful response for 2 out of 6 tweets.", 'The lowercase conversion ensures handling of different cases for the hashtag, such as all caps or mixed case variations, increasing the reliability of the detection process.', "The script successfully identifies the presence of the hashtag 'hello world' in tweets and responds accordingly, showcasing a functional implementation of the hashtag checker.", 'The process of developing a script to store and retrieve tweet IDs is explained, including the concept of last seen ID and the use of a text file for storage.', 'The functions retrieve last seen ID and store last seen ID are created to handle the retrieval and storage of tweet IDs in a text file.', 'The need to store the ID of the last tweet seen is emphasized to avoid responding to the same people repeatedly.']}, {'end': 1857.407, 'segs': [{'end': 1529.498, 'src': 'embed', 'start': 1449.716, 'weight': 0, 'content': [{'end': 1452.178, 'text': 'you can just go to csdojo.io slash Twitter.', 'start': 1449.716, 'duration': 2.462}, {'end': 1455.982, 'text': 'Anyway, let me just demonstrate to you how this whole thing works.', 'start': 1452.799, 'duration': 3.183}, {'end': 1467.873, 'text': "Actually, another thing I changed, another major thing I changed is that when I go through these mentions, I'm reversing this list.", 'start': 1456.802, 'duration': 11.071}, {'end': 1470.135, 'text': "That's for a technical reason too.", 'start': 1468.693, 'duration': 1.442}, {'end': 1474.676, 'text': "But another reason is that, you know, it's a more natural way of thinking about it.", 'start': 1470.915, 'duration': 3.761}, {'end': 1481.939, 'text': "Instead of going through you know, tweet six, tweet five, tweet four we're going through, you know,", 'start': 1475.237, 'duration': 6.702}, {'end': 1484.079, 'text': 'all tweets first and then responding to them first.', 'start': 1481.939, 'duration': 2.14}, {'end': 1488.641, 'text': "So it's going to be, you know, tweet one first, two, three, and so on.", 'start': 1484.8, 'duration': 3.841}, {'end': 1499.868, 'text': "Okay, and we're using another argument in this mentions timeline function, the first argument of this function actually, and that's last seen ID.", 'start': 1489.381, 'duration': 10.487}, {'end': 1508.293, 'text': "This way if the last seen ID is, let's say, the ID of this tweet, let's say 91,", 'start': 1500.608, 'duration': 7.685}, {'end': 1515.258, 'text': 'then that API is going to ignore this tweet and then give us these five tweets instead.', 'start': 1508.293, 'duration': 6.965}, {'end': 1520.856, 'text': 'And actually, I stored the ID of the first tweet in the comment right here.', 'start': 1515.914, 'duration': 4.942}, {'end': 1527.698, 'text': 'So let me just copy and paste this ID in this, you know, lasting ID dot text.', 'start': 1521.356, 'duration': 6.342}, {'end': 1529.498, 'text': "That's actually what I already had.", 'start': 1527.918, 'duration': 1.58}], 'summary': 'Reversed mentions list for natural response, used last seen id to ignore tweets, and stored id in comment.', 'duration': 79.782, 'max_score': 1449.716, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1449716.jpg'}, {'end': 1660.882, 'src': 'heatmap', 'start': 1590.608, 'weight': 4, 'content': [{'end': 1594.349, 'text': 'so let me show you how to actually reply to those tweets.', 'start': 1590.608, 'duration': 3.741}, {'end': 1605.253, 'text': "uh, to do that, let me just, you know, copy the idea of the first tweet that we've seen and then go to our terminal and go to the Python shell again.", 'start': 1594.349, 'duration': 10.904}, {'end': 1617.043, 'text': 'And then to respond to that particular tweet, you need to use this command api.update status and then at the username.', 'start': 1605.653, 'duration': 11.39}, {'end': 1618.564, 'text': "that's actually ykdojo.", 'start': 1617.043, 'duration': 1.521}, {'end': 1619.344, 'text': 'let me just do that.', 'start': 1618.564, 'duration': 0.78}, {'end': 1630.613, 'text': "And then let's say, hello world, back to you, and this is testing, or this is just a test, comma, and then that ID.", 'start': 1619.865, 'duration': 10.748}, {'end': 1632.615, 'text': 'So this should work.', 'start': 1631.554, 'duration': 1.061}, {'end': 1634.837, 'text': "Let's go back to Twitter.", 'start': 1633.015, 'duration': 1.822}, {'end': 1636.779, 'text': "Let's see if we got it.", 'start': 1635.498, 'duration': 1.281}, {'end': 1643.852, 'text': 'If we look at tweet one, we see this new tweet, hello back to you, and this is just a test.', 'start': 1638.109, 'duration': 5.743}, {'end': 1646.634, 'text': "And that's the string that we wrote just earlier.", 'start': 1644.353, 'duration': 2.281}, {'end': 1651.877, 'text': "And to integrate that in our main code, I'm gonna write this.", 'start': 1647.214, 'duration': 4.663}, {'end': 1660.882, 'text': "So after we make sure that hello world is in the mission, I'm gonna write API.update status.", 'start': 1652.377, 'duration': 8.505}], 'summary': 'Demonstrating how to reply to tweets using python api and updating status with a sample tweet successfully', 'duration': 28.736, 'max_score': 1590.608, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1590608.jpg'}, {'end': 1797.22, 'src': 'embed', 'start': 1768.749, 'weight': 3, 'content': [{'end': 1779.913, 'text': "actually, let's say retrieving and reply into tweets and then, once we have this in a function, if we do this, it's just going to be easier to see,", 'start': 1768.749, 'duration': 11.164}, {'end': 1781.374, 'text': 'while true.', 'start': 1779.913, 'duration': 1.461}, {'end': 1783.695, 'text': 'so this is going to be an infinite loop.', 'start': 1781.374, 'duration': 2.321}, {'end': 1785.815, 'text': "i'll say reply to tweets.", 'start': 1783.695, 'duration': 2.12}, {'end': 1791.698, 'text': 'so reply to tweets and then time that sleep 15 seconds.', 'start': 1785.815, 'duration': 5.883}, {'end': 1797.22, 'text': 'so this stops this process for 15 seconds and then restart it after 15 seconds.', 'start': 1791.698, 'duration': 5.522}], 'summary': 'Creating a function to retrieve and reply to tweets in an infinite loop, pausing for 15 seconds between iterations.', 'duration': 28.471, 'max_score': 1768.749, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1768749.jpg'}, {'end': 1857.407, 'src': 'embed', 'start': 1829.784, 'weight': 5, 'content': [{'end': 1834.148, 'text': 'And I just press Command Control C to stop that.', 'start': 1829.784, 'duration': 4.364}, {'end': 1842.675, 'text': "And here, the reason I'm comfortable enough with this code at this point is because I already tested everything in the function.", 'start': 1834.808, 'duration': 7.867}, {'end': 1847.019, 'text': 'I just copy and pasted everything, so it should work.', 'start': 1842.855, 'duration': 4.164}, {'end': 1850.962, 'text': "Okay, so let's change this time back to 15 seconds.", 'start': 1847.479, 'duration': 3.483}, {'end': 1855.086, 'text': "And once you run this in your terminal, that's your bot.", 'start': 1851.543, 'duration': 3.543}, {'end': 1857.407, 'text': "But there's a problem here right?", 'start': 1855.606, 'duration': 1.801}], 'summary': 'Code tested and pasted, adjusting time to 15 seconds for bot functionality.', 'duration': 27.623, 'max_score': 1829.784, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1829784.jpg'}], 'start': 1449.716, 'title': 'Twitter mentions and bot response automation', 'summary': 'Covers handling and responding to twitter mentions, ensuring efficient and chronological tweet processing, and creating python script for automated tweet replies with an infinite loop running every 15 seconds.', 'chapters': [{'end': 1590.608, 'start': 1449.716, 'title': 'Twitter mentions handling', 'summary': 'Demonstrates the process of handling and responding to twitter mentions, including reverse listing, utilizing last seen id to fetch new tweets, and storing the id of the first tweet for reference, resulting in efficient and chronological tweet processing.', 'duration': 140.892, 'highlights': ['The process involves reversing the list of mentions for a more natural way of response, ensuring that tweets are responded to in chronological order.', 'Utilizing the last seen ID parameter in the mentions timeline function to ignore previously seen tweets and fetch new tweets, improving the efficiency of tweet processing.', 'Storing the ID of the first tweet in the last seen ID for reference, ensuring accurate tracking of the latest tweet for efficient handling of mentions.']}, {'end': 1857.407, 'start': 1590.608, 'title': 'Twitter bot response automation', 'summary': 'Demonstrates how to create a python script to reply to tweets using the twitter api, including updating status, integrating into main code, and implementing an infinite loop to run the function every 15 seconds.', 'duration': 266.799, 'highlights': ['The chapter demonstrates how to create a Python script to reply to tweets using the Twitter API. It includes examples of copying tweet ideas, using the API to update status, and integrating the script into the main code.', "Implementing an infinite loop to run the function every 15 seconds. The script utilizes an infinite loop and the time module to run the 'reply to tweets' function every 15 seconds.", 'Testing the script with a shorter time interval of 2 seconds. The script is tested with a shorter time interval of 2 seconds before changing it back to 15 seconds for the intended functionality.']}], 'duration': 407.691, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1449716.jpg', 'highlights': ['Utilizing the last seen ID parameter in the mentions timeline function to ignore previously seen tweets and fetch new tweets, improving the efficiency of tweet processing.', 'The process involves reversing the list of mentions for a more natural way of response, ensuring that tweets are responded to in chronological order.', 'Storing the ID of the first tweet in the last seen ID for reference, ensuring accurate tracking of the latest tweet for efficient handling of mentions.', "Implementing an infinite loop to run the function every 15 seconds. The script utilizes an infinite loop and the time module to run the 'reply to tweets' function every 15 seconds.", 'The chapter demonstrates how to create a Python script to reply to tweets using the Twitter API. It includes examples of copying tweet ideas, using the API to update status, and integrating the script into the main code.', 'Testing the script with a shorter time interval of 2 seconds. The script is tested with a shorter time interval of 2 seconds before changing it back to 15 seconds for the intended functionality.']}, {'end': 2147.001, 'segs': [{'end': 1882.146, 'src': 'embed', 'start': 1857.928, 'weight': 0, 'content': [{'end': 1864.853, 'text': "If you just use your terminal as a bot, you'll never be able to close it, you'll never be able to go off the internet,", 'start': 1857.928, 'duration': 6.925}, {'end': 1866.815, 'text': 'and that would be pretty inconvenient.', 'start': 1864.853, 'duration': 1.962}, {'end': 1870.297, 'text': 'So to solve that issue, you need to put it online.', 'start': 1867.936, 'duration': 2.361}, {'end': 1878.143, 'text': 'And actually the easiest way to put it online, I think, is to use the website I mentioned earlier, Python Anywhere,', 'start': 1870.718, 'duration': 7.425}, {'end': 1882.146, 'text': 'which again you can find at csdojo.io slash py.', 'start': 1878.143, 'duration': 4.003}], 'summary': 'To prevent terminal from closing, put it online using python anywhere at csdojo.io/py.', 'duration': 24.218, 'max_score': 1857.928, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1857928.jpg'}, {'end': 1970.299, 'src': 'embed', 'start': 1937.25, 'weight': 2, 'content': [{'end': 1945.117, 'text': 'So create the file and then copy the ID that you have in your last scene ID file locally.', 'start': 1937.25, 'duration': 7.867}, {'end': 1949.802, 'text': 'Click save here and then go back to dashboard of Python anywhere again.', 'start': 1945.618, 'duration': 4.184}, {'end': 1954.846, 'text': 'Okay, once you have those two files, you can go to the console.', 'start': 1949.822, 'duration': 5.024}, {'end': 1956.428, 'text': 'Just click bash here.', 'start': 1955.387, 'duration': 1.041}, {'end': 1959.25, 'text': "This is just like the local console that we've been using.", 'start': 1956.808, 'duration': 2.442}, {'end': 1970.299, 'text': 'So first type ls to make sure you have my-twitter-bot.py and last-scene-id.text and then use the command that we used earlier.', 'start': 1960.031, 'duration': 10.268}], 'summary': 'Create and copy id, save, go to dashboard, access console, and use command.', 'duration': 33.049, 'max_score': 1937.25, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1937250.jpg'}, {'end': 2024.128, 'src': 'embed', 'start': 1991.542, 'weight': 3, 'content': [{'end': 1992.923, 'text': "Let's make sure this still works.", 'start': 1991.542, 'duration': 1.381}, {'end': 2000.868, 'text': "I'm going to do that by going to Twitter and then by at mentioning edit dojo, edit dojo.", 'start': 1993.724, 'duration': 7.144}, {'end': 2002.869, 'text': "And then I'm going to create two tweets.", 'start': 2001.348, 'duration': 1.521}, {'end': 2007.692, 'text': 'The first one is going to be tweet A with a hashtag hello world.', 'start': 2003.529, 'duration': 4.163}, {'end': 2012.897, 'text': "let's all cap here hello world i think that's spelled correctly.", 'start': 2008.132, 'duration': 4.765}, {'end': 2020.765, 'text': 'and then the second tweet is going to be tweets b, without the hashtag.', 'start': 2012.897, 'duration': 7.868}, {'end': 2024.128, 'text': "let's say hello world.", 'start': 2020.765, 'duration': 3.363}], 'summary': 'Testing on twitter: 2 tweets - a with #hello world, b without. mentioning @editdojo.', 'duration': 32.586, 'max_score': 1991.542, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1991542.jpg'}, {'end': 2081.121, 'src': 'embed', 'start': 2053.299, 'weight': 4, 'content': [{'end': 2060.626, 'text': "So I don't see any replies to tweet B, and I do see a reply, hello world, back to you on tweet A.", 'start': 2053.299, 'duration': 7.327}, {'end': 2070.114, 'text': "Okay, so this method of using Python Anywhere's console works, but it turns out every half a day or so, or maybe every day,", 'start': 2060.626, 'duration': 9.488}, {'end': 2075.098, 'text': 'this console kind of shuts down and then the script just stops working.', 'start': 2070.114, 'duration': 4.984}, {'end': 2081.121, 'text': "and if you don't mind, you know, restarting it every half a day or so, then that's fine.", 'start': 2076.079, 'duration': 5.042}], 'summary': "Using python anywhere's console works, but it shuts down every half a day, requiring manual restart.", 'duration': 27.822, 'max_score': 2053.299, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc2053299.jpg'}, {'end': 2147.001, 'src': 'embed', 'start': 2123.417, 'weight': 5, 'content': [{'end': 2127.782, 'text': "So if you don't want to do that, you know, you should look into other options like I mentioned earlier.", 'start': 2123.417, 'duration': 4.365}, {'end': 2130.664, 'text': "Anyway, that's pretty much it for this video.", 'start': 2128.362, 'duration': 2.302}, {'end': 2135.87, 'text': "And I think I'm going to keep running this script for at least for the next few weeks or so.", 'start': 2131.185, 'duration': 4.685}, {'end': 2141.615, 'text': 'So if you add mention edit dojo with the hashtag hello world, this spot might still work.', 'start': 2136.53, 'duration': 5.085}, {'end': 2147.001, 'text': "Anyway, thank you as always for watching my videos and I'll see you guys in the next one.", 'start': 2142.196, 'duration': 4.805}], 'summary': 'Exploring alternative options and planning to run the script for the next few weeks.', 'duration': 23.584, 'max_score': 2123.417, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc2123417.jpg'}], 'start': 1857.928, 'title': 'Setting up a twitter bot with python anywhere', 'summary': "Details the process of setting up a twitter bot on python anywhere, covering signing up, file addition, and bot execution, ensuring it can run online. it also explores the functionality of a twitter bot using python anywhere's console, including responding to tweets and utilizing 'always on tasks' in the paid option.", 'chapters': [{'end': 1990.942, 'start': 1857.928, 'title': 'Setting up a twitter bot with python anywhere', 'summary': 'Explains the process of setting up a twitter bot using python anywhere, including signing up, adding files, and running the bot, ultimately ensuring it can run online.', 'duration': 133.014, 'highlights': ['The process of setting up a Twitter bot using Python Anywhere is explained, including signing up, adding files, and running the bot, ultimately ensuring it can run online. Setting up a Twitter bot using Python Anywhere, signing up, adding files, running the bot, ensuring it can run online', 'The easiest way to put the terminal online is by using Python Anywhere, which can be accessed at csdojo.io/py. Using Python Anywhere to put the terminal online, access at csdojo.io/py', 'Instruction on creating and transferring files, including the process of adding files and creating a last scene ID file. Creating and transferring files, adding files, creating a last scene ID file']}, {'end': 2147.001, 'start': 1991.542, 'title': "Using python anywhere's console for twitter bot", 'summary': "Demonstrates the functionality of a twitter bot using python anywhere's console, responding to tweets and exploring options to keep the script running, including using 'always on tasks' in the paid option.", 'duration': 155.459, 'highlights': ["The Twitter bot successfully responds to tweets mentioning 'edit dojo' and creates two tweets, with the first one containing the hashtag 'hello world', and it found these two mentions, responding only to the first one.", "The Python Anywhere's console shuts down every half a day or so, causing the script to stop working, requiring manual restart, but there are alternative options like using other cloud services or Python Anywhere's 'always on tasks' function, which automatically restarts the script if it crashes, available in the paid option for $5 a month.", "The chapter concludes with the plan to continue running the script for the next few weeks and encourages viewers to engage by mentioning 'edit dojo' with the hashtag 'hello world'."]}], 'duration': 289.073, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/W0wWwglE1Vc/pics/W0wWwglE1Vc1857928.jpg', 'highlights': ['Setting up a Twitter bot using Python Anywhere, signing up, adding files, running the bot, ensuring it can run online', 'Using Python Anywhere to put the terminal online, access at csdojo.io/py', 'Creating and transferring files, adding files, creating a last scene ID file', "The Twitter bot successfully responds to tweets mentioning 'edit dojo' and creates two tweets, with the first one containing the hashtag 'hello world', and it found these two mentions, responding only to the first one", "Python Anywhere's console shuts down every half a day or so, causing the script to stop working, requiring manual restart, but there are alternative options like using other cloud services or Python Anywhere's 'always on tasks' function, which automatically restarts the script if it crashes, available in the paid option for $5 a month", "The chapter concludes with the plan to continue running the script for the next few weeks and encourages viewers to engage by mentioning 'edit dojo' with the hashtag 'hello world'"]}], 'highlights': ["The Twitter bot responds to tweets with the hashtag 'hello world' within 15 seconds, showcasing the practical implementation. (Quantifiable data: 15 seconds)", 'Utilizing the last seen ID parameter in the mentions timeline function to ignore previously seen tweets and fetch new tweets, improving the efficiency of tweet processing.', 'The process involves reversing the list of mentions for a more natural way of response, ensuring that tweets are responded to in chronological order.', 'The lowercase conversion ensures handling of different cases for the hashtag, such as all caps or mixed case variations, increasing the reliability of the detection process.', "The demonstration emphasizes the potential for customization by mentioning the ability to modify the bot's behavior, such as sending direct messages based on specific keywords. (Key point: customization)", 'The video showcases the process of making a Twitter bot with Python, providing a practical example of controlling a specific Twitter account. (Key point: practical demonstration)', "The process involves retrieving tweets, converting them to lowercase, and checking for the presence of the hashtag 'hello world', resulting in a successful response for 2 out of 6 tweets.", "The script successfully identifies the presence of the hashtag 'hello world' in tweets and responds accordingly, showcasing a functional implementation of the hashtag checker.", 'The chapter demonstrates how to create a Python script to reply to tweets using the Twitter API. It includes examples of copying tweet ideas, using the API to update status, and integrating the script into the main code.', 'The need to store the ID of the last tweet seen is emphasized to avoid responding to the same people repeatedly.']}