title
Tweet Visualization and Sentiment Analysis in Python - Full Tutorial

description
In this Python tutorial, the Tweepy module is used to stream live tweets directly from Twitter in real-time. The tweets are visualized and then the TextBlob module is used to do sentiment analysis on the tweets. 💻Code: https://github.com/vprusso/youtube_tutorials/tree/master/twitter_python ⭐️ Contents ⭐️ ⌨️ (00:06) Streaming live tweets ⌨️ (23:17) Cursor and pagination ⌨️ (43:28) Analyzing tweet data ⌨️ (1:03:16) Visualizing tweet data ⌨️ (1:20:18) Sentiment analysis 🔗Tweepy Website:http://www.tweepy.org/ 🔗Cursor Docs: http://docs.tweepy.org/en/v3.5.0/cursor_tutorial.html 🔗API Reference: http://docs.tweepy.org/en/v3.5.0/api.html Tutorial from Vincent Russo of Lucid Programming. Check out his YouTube channel: http://bit.ly/lucidcode 🐦Vincent on Twitter: @captainhamptons -- Learn to code for free and get a developer job: https://www.freecodecamp.org Read hundreds of articles on programming: https://medium.freecodecamp.org

detail
{'title': 'Tweet Visualization and Sentiment Analysis in Python - Full Tutorial', 'heatmap': [{'end': 218.87, 'start': 160.347, 'weight': 0.714}, {'end': 496.398, 'start': 266.025, 'weight': 0.721}, {'end': 921.077, 'start': 808.153, 'weight': 0.868}, {'end': 1412.076, 'start': 1349.459, 'weight': 1}, {'end': 1626.265, 'start': 1566.31, 'weight': 0.85}, {'end': 2056.112, 'start': 1996.566, 'weight': 0.747}], 'summary': 'The tutorial series on twitter data analysis in python covers setting up a twitter application, accessing tweepy documentation, streaming real-time tweets, refactoring code, retrieving user timeline tweets, and analyzing tweet data, with specific insights including the average tweet length of 122.2 characters, the tweet with the most likes receiving 121,862 likes, and the tweet with the most retweets garnering 107,000 retweets, as well as visualizing twitter data, and conducting sentiment analysis using textblob.', 'chapters': [{'end': 466.746, 'segs': [{'end': 43.093, 'src': 'embed', 'start': 0.31, 'weight': 1, 'content': [{'end': 5.049, 'text': 'If you enjoy content like this, please subscribe to the Lucid Programming channel for more programming tutorials.', 'start': 0.31, 'duration': 4.739}, {'end': 13.797, 'text': "Okay, so in this video, we'll be making use of the Tweepy API.", 'start': 9.033, 'duration': 4.764}, {'end': 22.403, 'text': 'And this is an API that we can access via Python, which will allow us to very easily stream tweets in real time directly from Twitter.', 'start': 14.177, 'duration': 8.226}, {'end': 30.329, 'text': "So in order to follow this series of tutorials, what we're going to be doing is installing Tweepy, which is a Python package.", 'start': 23.224, 'duration': 7.105}, {'end': 33.49, 'text': "So I'm going to assume that you have Python installed in your machine.", 'start': 30.829, 'duration': 2.661}, {'end': 36.751, 'text': "And if so, all we'll need is the Tweepy module.", 'start': 34.05, 'duration': 2.701}, {'end': 40.832, 'text': "We're just going to create a Python, sorry, well, we are going to create some Python.", 'start': 36.931, 'duration': 3.901}, {'end': 43.093, 'text': "We're going to first create a Twitter application.", 'start': 40.872, 'duration': 2.221}], 'summary': 'Tutorial on using tweepy api for real-time tweet streaming in python.', 'duration': 42.783, 'max_score': 0.31, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw310.jpg'}, {'end': 103.28, 'src': 'embed', 'start': 63.361, 'weight': 0, 'content': [{'end': 71.507, 'text': "And then we'll write Python code that will interface with that application to stream tweets in real time based on keywords or hashtags.", 'start': 63.361, 'duration': 8.146}, {'end': 77.292, 'text': "Now, what we'll do in this video is we'll just write a very simple application to accomplish just that.", 'start': 72.288, 'duration': 5.004}, {'end': 80.755, 'text': "So we'll see tweets given a set of keywords.", 'start': 77.672, 'duration': 3.083}, {'end': 86.816, 'text': "And then in later subsequent videos, we'll see what we can do to analyze the content of the tweets that we get back.", 'start': 81.415, 'duration': 5.401}, {'end': 90.357, 'text': 'Maybe we can produce some nice graphs based on that data.', 'start': 87.236, 'duration': 3.121}, {'end': 96.678, 'text': 'And then some other fun things that we can do with that data, like possibly sentiment analysis,', 'start': 90.997, 'duration': 5.681}, {'end': 101.659, 'text': 'which will most likely be part of the natural language processing series of videos.', 'start': 96.678, 'duration': 4.981}, {'end': 103.28, 'text': 'So keep an eye out for that as well.', 'start': 101.839, 'duration': 1.441}], 'summary': 'Python code will stream tweets in real time based on keywords, and analyze tweet content for graphs and sentiment analysis.', 'duration': 39.919, 'max_score': 63.361, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw63361.jpg'}, {'end': 218.87, 'src': 'heatmap', 'start': 160.347, 'weight': 0.714, 'content': [{'end': 164.908, 'text': 'So in order to do that, what we need to do is navigate over to apps.twitter.com.', 'start': 160.347, 'duration': 4.561}, {'end': 168.489, 'text': 'Again, this will require that you do have a Twitter account and are logged in.', 'start': 165.068, 'duration': 3.421}, {'end': 175.691, 'text': "If so, you should be presented with a dashboard that looks probably similar to this, depending on what time when you're watching this video.", 'start': 169.009, 'duration': 6.682}, {'end': 182.395, 'text': 'You can see that I already have an application here listed under my Twitter apps that was used for something else I was working on just for fun.', 'start': 176.671, 'duration': 5.724}, {'end': 185.918, 'text': "And then what you're going to want to do, you might not see anything here.", 'start': 183.196, 'duration': 2.722}, {'end': 192.563, 'text': "If you don't have any apps in this application management section, you can click on this create new app button.", 'start': 186.799, 'duration': 5.764}, {'end': 201.113, 'text': 'That will take you to a form which just asks for some really simple details about what this Twitter application is going to be doing.', 'start': 193.383, 'duration': 7.73}, {'end': 208.022, 'text': "So I've already kind of did a dry run of this and I have some information for what we'll be filling in.", 'start': 201.614, 'duration': 6.408}, {'end': 210.544, 'text': 'So you can put in whatever name you like.', 'start': 208.542, 'duration': 2.002}, {'end': 212.625, 'text': "I'm going to put in this name.", 'start': 211.024, 'duration': 1.601}, {'end': 216.028, 'text': 'This is just the name of the Twitter application, Lucid Programming Twitter app.', 'start': 212.645, 'duration': 3.383}, {'end': 218.87, 'text': 'A description, which is also required.', 'start': 217.069, 'duration': 1.801}], 'summary': 'Navigate to apps.twitter.com, create new app, fill in required details.', 'duration': 58.523, 'max_score': 160.347, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw160347.jpg'}], 'start': 0.31, 'title': 'Real-time tweet streaming and twitter application setup with tweepy api', 'summary': 'Covers the process of setting up a twitter application with python, accessing tweepy documentation, securing credentials, and installing tweepy module. it also explains how to stream real-time tweets from twitter based on keywords or hashtags, with future videos focusing on analyzing tweet content and performing sentiment analysis.', 'chapters': [{'end': 103.28, 'start': 0.31, 'title': 'Real-time tweet streaming with tweepy api', 'summary': 'Covers the process of installing tweepy, creating a twitter application, and writing python code to stream real-time tweets from twitter based on keywords or hashtags, with future videos focusing on analyzing tweet content and performing sentiment analysis.', 'duration': 102.97, 'highlights': ['The chapter covers the process of installing Tweepy, creating a Twitter application, and writing Python code to stream real-time tweets from Twitter based on keywords or hashtags. The tutorial focuses on the installation of Tweepy, the creation of a Twitter application, and the development of Python code for real-time tweet streaming.', 'Future videos will focus on analyzing tweet content and performing sentiment analysis. Upcoming videos will explore the analysis of tweet content, including the generation of graphs and sentiment analysis using natural language processing.', 'Viewers are encouraged to subscribe to the Lucid Programming channel for more programming tutorials. The audience is invited to subscribe to the Lucid Programming channel for additional programming tutorials.']}, {'end': 466.746, 'start': 104.52, 'title': 'Setting up twitter application with python', 'summary': 'Outlines the process of setting up a twitter application using python, covering topics such as accessing tweepy documentation, creating a twitter application, securing credentials, and installing tweepy module.', 'duration': 362.226, 'highlights': ['The transcript provides step-by-step instructions for setting up a Twitter application using Python, including accessing Tweepy documentation, creating a Twitter application, and securing credentials. step-by-step instructions, setting up Twitter application, accessing Tweepy documentation, creating Twitter application, securing credentials', "Instructions are given for installing the Tweepy module using pip, and a demonstration of checking for the module's installation status is provided. installing Tweepy module, using pip, checking installation status"]}], 'duration': 466.436, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw310.jpg', 'highlights': ['The chapter covers the process of installing Tweepy, creating a Twitter application, and writing Python code to stream real-time tweets from Twitter based on keywords or hashtags.', 'The tutorial focuses on the installation of Tweepy, the creation of a Twitter application, and the development of Python code for real-time tweet streaming.', 'The transcript provides step-by-step instructions for setting up a Twitter application using Python, including accessing Tweepy documentation, creating a Twitter application, and securing credentials.', "Instructions are given for installing the Tweepy module using pip, and a demonstration of checking for the module's installation status is provided.", 'Future videos will focus on analyzing tweet content and performing sentiment analysis.', 'Upcoming videos will explore the analysis of tweet content, including the generation of graphs and sentiment analysis using natural language processing.', 'Viewers are encouraged to subscribe to the Lucid Programming channel for more programming tutorials.', 'The audience is invited to subscribe to the Lucid Programming channel for additional programming tutorials.']}, {'end': 1300.302, 'segs': [{'end': 514.783, 'src': 'embed', 'start': 486.655, 'weight': 0, 'content': [{'end': 496.398, 'text': "This is a class that's from the Tweepy module that will allow us to listen to the tweets, kind of the fire hose of tweets as they come,", 'start': 486.655, 'duration': 9.743}, {'end': 498.259, 'text': 'based on certain keywords or hashtags.', 'start': 496.398, 'duration': 1.861}, {'end': 502.04, 'text': "we'll also need to import another thing for authentication.", 'start': 499.059, 'duration': 2.981}, {'end': 506.521, 'text': "so we'll say from 2p imports, oauth handler.", 'start': 502.04, 'duration': 4.481}, {'end': 514.783, 'text': 'this class is going to be responsible for authenticating based on the credentials that we stored in the other file for associated with the twitter app.', 'start': 506.521, 'duration': 8.262}], 'summary': 'Tweepy module allows listening to tweets based on keywords or hashtags, using oauth handler for authentication.', 'duration': 28.128, 'max_score': 486.655, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw486655.jpg'}, {'end': 670.258, 'src': 'embed', 'start': 639.483, 'weight': 2, 'content': [{'end': 646.185, 'text': "So if we encounter an error, what will happen is this method will be triggered and we'll print the status message of that error to the screen.", 'start': 639.483, 'duration': 6.702}, {'end': 652.755, 'text': "So the next thing that we're going to want to do is just actually create a method sorry,", 'start': 648.331, 'duration': 4.424}, {'end': 658.48, 'text': 'an object from this standard outlistener class that we just created, and then actually get onto streaming the tweets.', 'start': 652.755, 'duration': 5.725}, {'end': 661.122, 'text': 'So this will be in the main part of the program.', 'start': 659.06, 'duration': 2.062}, {'end': 670.258, 'text': "So we'll say if name is equal to main, And what we'll first do is create a listener object.", 'start': 661.382, 'duration': 8.876}], 'summary': 'Method triggers error message printing; create listener object for tweet streaming.', 'duration': 30.775, 'max_score': 639.483, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw639483.jpg'}, {'end': 921.077, 'src': 'heatmap', 'start': 808.153, 'weight': 0.868, 'content': [{'end': 817.642, 'text': 'and in this track list we can provide it a list of things which, if the tweet contains any of these list objects,', 'start': 808.153, 'duration': 9.489}, {'end': 821.045, 'text': "then it will apply it and it will say I'll add this to the stream.", 'start': 817.642, 'duration': 3.403}, {'end': 822.366, 'text': "So let's see.", 'start': 821.705, 'duration': 0.661}, {'end': 825.509, 'text': "Let's just add Donald Trump.", 'start': 822.406, 'duration': 3.103}, {'end': 834.379, 'text': "Let's Hillary Clinton and Barack Obama and let's say Bernie Sanders.", 'start': 826.971, 'duration': 7.408}, {'end': 838.867, 'text': 'So just some politicians in there.', 'start': 836.966, 'duration': 1.901}, {'end': 842.869, 'text': "So we'll filter tweets based on this list of keywords.", 'start': 838.927, 'duration': 3.942}, {'end': 849.313, 'text': 'So we can go ahead and write this to a file and then we can go ahead and try to see what happens when we run it.', 'start': 843.89, 'duration': 5.423}, {'end': 851.654, 'text': 'So Python Tweepy Streamer.', 'start': 849.773, 'duration': 1.881}, {'end': 856.936, 'text': "Now, if we run this, we get, let's see, a 401.", 'start': 853.615, 'duration': 3.321}, {'end': 858.637, 'text': "Let's check why that happens to be.", 'start': 856.936, 'duration': 1.701}, {'end': 865.56, 'text': "I think the reason for that was because I didn't fill in any of the consumer key, consumer secret, or anything like that.", 'start': 859.097, 'duration': 6.463}, {'end': 868, 'text': 'I had just written it from what you saw before.', 'start': 865.62, 'duration': 2.38}, {'end': 870.001, 'text': "All of those things were completely blank, so don't be me.", 'start': 868.081, 'duration': 1.92}, {'end': 871.022, 'text': "Don't be an idiot.", 'start': 870.381, 'duration': 0.641}, {'end': 872.942, 'text': 'Go ahead and make sure you fill that stuff in.', 'start': 871.462, 'duration': 1.48}, {'end': 877.144, 'text': 'And once you do, if you do that, hopefully that should run and things should work.', 'start': 873.423, 'duration': 3.721}, {'end': 879.026, 'text': 'start coming on the screen there.', 'start': 877.404, 'duration': 1.622}, {'end': 884.913, 'text': 'so like we see a ton of uh look seemingly garbage just showing up on the screen here.', 'start': 879.026, 'duration': 5.887}, {'end': 886.214, 'text': 'these are tweets.', 'start': 884.913, 'duration': 1.301}, {'end': 890.078, 'text': 'specifically, these are let me just kind of stop this here.', 'start': 886.214, 'duration': 3.864}, {'end': 891.8, 'text': "so if you don't stop it, it'll just keep.", 'start': 890.078, 'duration': 1.722}, {'end': 893.442, 'text': "uh, it'll just keep streaming.", 'start': 891.8, 'duration': 1.642}, {'end': 896.045, 'text': 'so this whole blob here.', 'start': 893.442, 'duration': 2.603}, {'end': 899.028, 'text': "this is one tweet, It's not.", 'start': 896.045, 'duration': 2.983}, {'end': 900.808, 'text': "the person didn't tweet this thing out, of course.", 'start': 899.028, 'duration': 1.78}, {'end': 912.193, 'text': "What this is, is it's a JSON formatted dictionary object, and each of the fields in this braced thing here contains information about the tweet.", 'start': 901.369, 'duration': 10.824}, {'end': 915.535, 'text': 'So this says the tweet was created today, this is today.', 'start': 912.233, 'duration': 3.302}, {'end': 921.077, 'text': 'This is the, you know, ID that Twitter associates with this particular tweet.', 'start': 916.355, 'duration': 4.722}], 'summary': 'Python tweepy streamer filters tweets based on keywords, encountered a 401 error due to missing consumer key and secret, displaying json formatted tweet data.', 'duration': 112.924, 'max_score': 808.153, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw808153.jpg'}, {'end': 870.001, 'src': 'embed', 'start': 843.89, 'weight': 4, 'content': [{'end': 849.313, 'text': 'So we can go ahead and write this to a file and then we can go ahead and try to see what happens when we run it.', 'start': 843.89, 'duration': 5.423}, {'end': 851.654, 'text': 'So Python Tweepy Streamer.', 'start': 849.773, 'duration': 1.881}, {'end': 856.936, 'text': "Now, if we run this, we get, let's see, a 401.", 'start': 853.615, 'duration': 3.321}, {'end': 858.637, 'text': "Let's check why that happens to be.", 'start': 856.936, 'duration': 1.701}, {'end': 865.56, 'text': "I think the reason for that was because I didn't fill in any of the consumer key, consumer secret, or anything like that.", 'start': 859.097, 'duration': 6.463}, {'end': 868, 'text': 'I had just written it from what you saw before.', 'start': 865.62, 'duration': 2.38}, {'end': 870.001, 'text': "All of those things were completely blank, so don't be me.", 'start': 868.081, 'duration': 1.92}], 'summary': 'Troubleshooting python tweepy streamer to resolve 401 error.', 'duration': 26.111, 'max_score': 843.89, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw843890.jpg'}, {'end': 1020.269, 'src': 'embed', 'start': 991.601, 'weight': 5, 'content': [{'end': 995.083, 'text': 'so that in subsequent videos things are just kind of a little bit more.', 'start': 991.601, 'duration': 3.482}, {'end': 998.117, 'text': 'Well robust, I guess, is the right word.', 'start': 996.676, 'duration': 1.441}, {'end': 1006.301, 'text': "So let's go and create another class, which we'll call, let's call this TwitterStreamer.", 'start': 998.357, 'duration': 7.944}, {'end': 1011.704, 'text': "So this is gonna be a class that we'll define for ourselves, which will be responsible for actually streaming the tweets.", 'start': 1006.361, 'duration': 5.343}, {'end': 1013.825, 'text': 'Just makes it a little bit more concise.', 'start': 1011.784, 'duration': 2.041}, {'end': 1020.269, 'text': "So we'll call this streamTweets, and this is a class method, so it takes the object of self.", 'start': 1014.146, 'duration': 6.123}], 'summary': 'Creating a twitterstreamer class to stream tweets for a more robust and concise approach.', 'duration': 28.668, 'max_score': 991.601, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw991601.jpg'}, {'end': 1083.046, 'src': 'embed', 'start': 1059.371, 'weight': 1, 'content': [{'end': 1066.015, 'text': 'So this will just be the list of keywords or hashtags that we wish to filter the tweets out by.', 'start': 1059.371, 'duration': 6.644}, {'end': 1073.94, 'text': "So we're really just kind of reworking some of the code that we have that's the proof of concept into something that's a little bit more modular.", 'start': 1066.615, 'duration': 7.325}, {'end': 1078.143, 'text': "So let's go ahead and add a comment just to make this look a little nicer.", 'start': 1074.86, 'duration': 3.283}, {'end': 1083.046, 'text': 'This handles Twitter authentication.', 'start': 1078.603, 'duration': 4.443}], 'summary': 'Reworking code to filter tweets by keywords or hashtags, improving modularity.', 'duration': 23.675, 'max_score': 1059.371, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1059371.jpg'}], 'start': 466.786, 'title': 'Tweepy library basics and twitter streaming', 'summary': 'Discusses the basics of using the tweepy library to import classes, create a custom listener class for handling tweets, and override methods for on_data and on_error. it also demonstrates the process of authenticating code using tweepy to create a twitter stream, filter tweets based on keywords, and process live tweets, while emphasizing the importance of filling in consumer key and consumer secret to avoid errors. the chapter introduces the concept of a twitterstreamer class to make the code more modular and robust.', 'chapters': [{'end': 681.747, 'start': 466.786, 'title': 'Tweepy library basics', 'summary': 'Discusses the basics of using the tweepy library to import classes, create a custom listener class for handling tweets, and override methods for on_data and on_error, emphasizing simplicity and functionality.', 'duration': 214.961, 'highlights': ['The chapter discusses the basics of using the Tweepy library to import classes, create a custom listener class for handling tweets, and override methods for on_data and on_error, emphasizing simplicity and functionality. The chapter covers the basic usage of the Tweepy library, including importing classes, creating a custom listener class, and overriding methods for tweet handling.', 'The Tweepy library is used for listening to tweets based on certain keywords or hashtags, and for authentication based on stored credentials. The Tweepy library is utilized to listen to tweets based on keywords or hashtags and for authentication using stored credentials.', "The chapter explains the creation of a custom listener class, 'standard out listener', which inherits from the 'stream listener' class and overrides methods for tweet handling and error management. The creation of a custom listener class, 'standard out listener', is explained, which inherits from the 'stream listener' class and overrides methods for tweet handling and error management."]}, {'end': 1300.302, 'start': 682.788, 'title': 'Twitter streaming and authentication', 'summary': 'Demonstrates the process of authenticating code using tweepy to create a twitter stream, filter tweets based on keywords, and process live tweets, while emphasizing the importance of filling in consumer key and consumer secret to avoid errors. it also introduces the concept of a twitterstreamer class to make the code more modular and robust.', 'duration': 617.514, 'highlights': ['The chapter demonstrates the process of authenticating code using Tweepy to create a Twitter stream, filter tweets based on keywords, and process live tweets. Demonstrates authentication process, creating Twitter stream, filtering tweets, processing live tweets.', 'Emphasizes the importance of filling in consumer key and consumer secret to avoid errors. Importance of filling in consumer key and consumer secret to avoid errors.', 'Introduces the concept of a TwitterStreamer class to make the code more modular and robust. Introduction of TwitterStreamer class for modular and robust code.']}], 'duration': 833.516, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw466786.jpg', 'highlights': ['The chapter covers the basic usage of the Tweepy library, including importing classes, creating a custom listener class, and overriding methods for tweet handling.', 'Demonstrates authentication process, creating Twitter stream, filtering tweets, processing live tweets.', "The creation of a custom listener class, 'standard out listener', is explained, which inherits from the 'stream listener' class and overrides methods for tweet handling and error management.", 'The Tweepy library is utilized to listen to tweets based on keywords or hashtags and for authentication using stored credentials.', 'Importance of filling in consumer key and consumer secret to avoid errors.', 'Introduction of TwitterStreamer class for modular and robust code.']}, {'end': 1707.67, 'segs': [{'end': 1328.026, 'src': 'embed', 'start': 1300.342, 'weight': 1, 'content': [{'end': 1307.784, 'text': "So let's go ahead and use our new class to do pretty much what we did before, but just make it a little bit more nice and modular.", 'start': 1300.342, 'duration': 7.442}, {'end': 1310.825, 'text': "So what we'll do is we'll create a hashtag list here.", 'start': 1308.204, 'duration': 2.621}, {'end': 1328.026, 'text': "We'll, I guess, create it as, let's say, Donald Trump, Hillary Clinton, Barack Obama and Bernie Sanders, And let's see.", 'start': 1312.025, 'duration': 16.001}], 'summary': 'Using a new class to create a hashtag list with donald trump, hillary clinton, barack obama, and bernie sanders.', 'duration': 27.684, 'max_score': 1300.342, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1300342.jpg'}, {'end': 1386.71, 'src': 'embed', 'start': 1353.101, 'weight': 0, 'content': [{'end': 1354.903, 'text': "It's not necessary if you don't want to do that.", 'start': 1353.101, 'duration': 1.802}, {'end': 1359.94, 'text': "Okay, so now let's define a TwitterStreamer object.", 'start': 1357.139, 'duration': 2.801}, {'end': 1365.041, 'text': "So I'll say TwitterStreamer is equal to TwitterStreamer.", 'start': 1360.06, 'duration': 4.981}, {'end': 1372.964, 'text': "And then we'll say TwitterStreamer, there it is, .", 'start': 1367.002, 'duration': 5.962}, {'end': 1377.242, 'text': 'streamTweets which is the method that we created up above.', 'start': 1372.964, 'duration': 4.278}, {'end': 1386.71, 'text': "And we'll send it, it takes two things, the file name that we want to write to, and then also the list of keywords that we're looking for.", 'start': 1378.103, 'duration': 8.607}], 'summary': 'Defining a twitterstreamer object to stream tweets based on keywords.', 'duration': 33.609, 'max_score': 1353.101, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1353101.jpg'}, {'end': 1427.402, 'src': 'heatmap', 'start': 1349.459, 'weight': 3, 'content': [{'end': 1352.661, 'text': "txt there, it's totally fine, but I'm just changing the extension to JSON.", 'start': 1349.459, 'duration': 3.202}, {'end': 1354.903, 'text': "It's not necessary if you don't want to do that.", 'start': 1353.101, 'duration': 1.802}, {'end': 1359.94, 'text': "Okay, so now let's define a TwitterStreamer object.", 'start': 1357.139, 'duration': 2.801}, {'end': 1365.041, 'text': "So I'll say TwitterStreamer is equal to TwitterStreamer.", 'start': 1360.06, 'duration': 4.981}, {'end': 1372.964, 'text': "And then we'll say TwitterStreamer, there it is, .", 'start': 1367.002, 'duration': 5.962}, {'end': 1377.242, 'text': 'streamTweets which is the method that we created up above.', 'start': 1372.964, 'duration': 4.278}, {'end': 1386.71, 'text': "And we'll send it, it takes two things, the file name that we want to write to, and then also the list of keywords that we're looking for.", 'start': 1378.103, 'duration': 8.607}, {'end': 1391.133, 'text': 'So that just made that a little bit more concise and everything a little bit more modular.', 'start': 1387.65, 'duration': 3.483}, {'end': 1396.137, 'text': 'And that will kind of get us started on this whole streaming tweets thing.', 'start': 1391.794, 'duration': 4.343}, {'end': 1403.093, 'text': "We're going to be touching up some of the code that we wrote in part one.", 'start': 1399.952, 'duration': 3.141}, {'end': 1412.076, 'text': "So we'll be touching up some code and we'll be focusing on the notion of pagination and also the cursor object in Twitter and specifically the Tweepy library.", 'start': 1403.193, 'duration': 8.883}, {'end': 1417.178, 'text': "So we'll be making use of that to do things like accessing our own tweets on our timeline,", 'start': 1412.396, 'duration': 4.782}, {'end': 1422.92, 'text': 'accessing user tweets from a specific user that we might want to analyze tweets from,', 'start': 1417.178, 'duration': 5.742}, {'end': 1427.402, 'text': 'also getting followers or friends from certain users and other things like that.', 'start': 1422.92, 'duration': 4.482}], 'summary': 'Defining twitterstreamer object, streamtweets method, and focusing on pagination and cursor object in tweepy library.', 'duration': 77.943, 'max_score': 1349.459, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1349459.jpg'}, {'end': 1521.543, 'src': 'embed', 'start': 1498.151, 'weight': 2, 'content': [{'end': 1505.373, 'text': 'but I thought I would abstract this functionality into its own class, so that way we can authenticate for other purposes that we may have.', 'start': 1498.151, 'duration': 7.222}, {'end': 1507.834, 'text': "Indeed, we'll have those other purposes in this video.", 'start': 1505.433, 'duration': 2.401}, {'end': 1512.756, 'text': "So I'm going to create another class up here, which will be for authentication.", 'start': 1507.854, 'duration': 4.902}, {'end': 1516.938, 'text': "So I'm going to call this, let's say, Twitter authenticator.", 'start': 1513.156, 'duration': 3.782}, {'end': 1521.543, 'text': "And we'll call the class TwitterAuthenticator.", 'start': 1518.622, 'duration': 2.921}], 'summary': 'Abstracting functionality into twitterauthenticator class for authentication purposes.', 'duration': 23.392, 'max_score': 1498.151, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1498151.jpg'}, {'end': 1626.265, 'src': 'heatmap', 'start': 1566.31, 'weight': 0.85, 'content': [{'end': 1569.071, 'text': "what we're gonna do now is we're just going to create,", 'start': 1566.31, 'duration': 2.761}, {'end': 1577.135, 'text': 'instantiate an object of the Authenticator class here in the constructor and then use that object right where we had the previous code.', 'start': 1569.071, 'duration': 8.064}, {'end': 1580.436, 'text': "So let me actually just write that out because maybe that's a little bit more clear.", 'start': 1577.735, 'duration': 2.701}, {'end': 1585.019, 'text': "So we'll say self.twitterAuthenticator.", 'start': 1581.237, 'duration': 3.782}, {'end': 1588.54, 'text': 'This will be the class object of the authenticator class.', 'start': 1585.079, 'duration': 3.461}, {'end': 1597.684, 'text': "And then what we'll do here is we'll just say auth is equal to self.twitterAuthenticator.authenticateTwitterApp.", 'start': 1589.341, 'duration': 8.343}, {'end': 1601.466, 'text': 'And that will go ahead and do the same thing that those two lines did,', 'start': 1598.085, 'duration': 3.381}, {'end': 1606.869, 'text': "but we've just kind of lifted that functionality into a class of its own to make it a bit more modular.", 'start': 1601.466, 'duration': 5.403}, {'end': 1611.593, 'text': "So I think that's one of the changes I wanted to make.", 'start': 1607.589, 'duration': 4.004}, {'end': 1615.636, 'text': "Let's just go ahead and write this and go ahead and run it to make sure that we didn't break anything.", 'start': 1611.633, 'duration': 4.003}, {'end': 1618.679, 'text': "So it looks like that's streaming tweets just as it was before.", 'start': 1616.076, 'duration': 2.603}, {'end': 1620.46, 'text': 'Seems like that worked out okay.', 'start': 1618.779, 'duration': 1.681}, {'end': 1626.265, 'text': "The next thing I want to mention that I didn't before that I thought would be worthwhile to point out is this onError method.", 'start': 1620.96, 'duration': 5.305}], 'summary': 'Code refactored to create modular authenticator class for twitter app authentication', 'duration': 59.955, 'max_score': 1566.31, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1566310.jpg'}], 'start': 1300.342, 'title': 'Refactoring twitter code', 'summary': 'Covers modular streaming of tweets, hashtag list creation, and code clean-up using tweepy library. it also includes refactoring for separate twitter authentication class, error checking for rate limits, and addressing implications of 420 error message.', 'chapters': [{'end': 1482.96, 'start': 1300.342, 'title': 'Modular streaming tweets and code clean-up', 'summary': 'Covers the creation of a hashtag list, defining a twitterstreamer object, and focusing on code clean-up and modularization to efficiently access and analyze tweets using the tweepy library.', 'duration': 182.618, 'highlights': ['The chapter covers creating a hashtag list with keywords like Donald Trump, Hillary Clinton, Barack Obama, and Bernie Sanders to be used for tweet analysis.', 'The process of defining a TwitterStreamer object and utilizing the streamTweets method for efficiently accessing and analyzing tweets is explained.', 'The significance of code clean-up and modularization is highlighted, emphasizing the use of the cursor class in Tweepy to access and analyze tweets from specific users, as well as the notion of pagination.', 'The importance of changing the name of the twitter stream listener class to accurately reflect its functionality, including writing tweets to a file, is discussed.']}, {'end': 1707.67, 'start': 1483.08, 'title': 'Refactoring twitter authentication', 'summary': 'Covers refactoring the code to create a separate class for twitter authentication, abstracting the authentication functionality, and adding error checking for rate limits, with a focus on the 420 error message and its implications on access to tweets.', 'duration': 224.59, 'highlights': ["Refactoring the code to create a separate class for Twitter authentication The speaker discusses creating a new class 'TwitterAuthenticator' to abstract the authentication functionality, allowing for authentication for other purposes in the future.", 'Error checking for rate limits, focusing on the 420 error message and its implications on access to tweets The speaker explains the significance of the 420 error message, indicating that repeated attempts to access tweets may lead to access restrictions, and suggests implementing error checking to prevent abuse of the system.', "Abstracting the authentication functionality into its own class The speaker abstracts the authentication functionality into a separate class, 'TwitterAuthenticator', to make it more modular and reusable for other purposes in the future."]}], 'duration': 407.328, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1300342.jpg', 'highlights': ['The process of defining a TwitterStreamer object and utilizing the streamTweets method for efficiently accessing and analyzing tweets is explained.', 'The chapter covers creating a hashtag list with keywords like Donald Trump, Hillary Clinton, Barack Obama, and Bernie Sanders to be used for tweet analysis.', "Refactoring the code to create a separate class for Twitter authentication The speaker discusses creating a new class 'TwitterAuthenticator' to abstract the authentication functionality, allowing for authentication for other purposes in the future.", 'The significance of code clean-up and modularization is highlighted, emphasizing the use of the cursor class in Tweepy to access and analyze tweets from specific users, as well as the notion of pagination.']}, {'end': 2103.835, 'segs': [{'end': 1770.689, 'src': 'embed', 'start': 1738.631, 'weight': 2, 'content': [{'end': 1739.372, 'text': 'And that is that.', 'start': 1738.631, 'duration': 0.741}, {'end': 1739.912, 'text': 'Okay, great.', 'start': 1739.472, 'duration': 0.44}, {'end': 1749.419, 'text': 'Now we can start into actually making use of the cursor module that we imported there, the cursor class, and also, essentially,', 'start': 1739.952, 'duration': 9.467}, {'end': 1756.204, 'text': "figure out how to use that to extract timeline tweets on your own timeline or a friend's timeline, or things of that nature.", 'start': 1749.419, 'duration': 6.785}, {'end': 1767.008, 'text': "So to do that, what we're going to do is we're going to create another class and we'll call this let's call this class Twitter clients.", 'start': 1756.884, 'duration': 10.124}, {'end': 1770.689, 'text': "So it'll be class Twitter clients.", 'start': 1768.888, 'duration': 1.801}], 'summary': "Learn to use the cursor module to extract timeline tweets from your own or a friend's timeline.", 'duration': 32.058, 'max_score': 1738.631, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1738631.jpg'}, {'end': 1834.404, 'src': 'embed', 'start': 1804.29, 'weight': 0, 'content': [{'end': 1808.811, 'text': "And then what we're going to do is we're going to find another class variable, which we'll call TwitterClient.", 'start': 1804.29, 'duration': 4.521}, {'end': 1815.092, 'text': "And this is going to be equal to API, which as you'll notice is one of the two things that we imported from Tweepy in this video.", 'start': 1809.191, 'duration': 5.901}, {'end': 1819.113, 'text': "And then we'll pass it in the authentication credentials so that way that is authenticated.", 'start': 1815.472, 'duration': 3.641}, {'end': 1824.797, 'text': "So we're going to make use of that in the following functions that we'll write in this class.", 'start': 1819.993, 'duration': 4.804}, {'end': 1834.404, 'text': "And actually what I'm going to do here is I'm just going to comment these things out and then we're going to instantiate an object of the Twitter client class and see what we can do with this.", 'start': 1825.237, 'duration': 9.167}], 'summary': 'Creating twitterclient class variable using tweepy api for authentication and functionality.', 'duration': 30.114, 'max_score': 1804.29, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1804290.jpg'}, {'end': 1917.047, 'src': 'embed', 'start': 1888.604, 'weight': 1, 'content': [{'end': 1893.866, 'text': "so I'll explain these things as I go dot items, num tweets.", 'start': 1888.604, 'duration': 5.262}, {'end': 1896.387, 'text': "let's actually break this down, what I just wrote here.", 'start': 1893.866, 'duration': 2.521}, {'end': 1898.008, 'text': 'So we import a cursor.', 'start': 1896.847, 'duration': 1.161}, {'end': 1905.536, 'text': "This is a class that will allow us to essentially do what we're about to do, which is get the user timeline tweets.", 'start': 1898.048, 'duration': 7.488}, {'end': 1910.881, 'text': "So I should actually call this, let's say, get user timeline tweets.", 'start': 1905.736, 'duration': 5.145}, {'end': 1913.183, 'text': "And yeah, let's keep it like that.", 'start': 1911.842, 'duration': 1.341}, {'end': 1917.047, 'text': "So, basically what I'm doing is, I'm saying okay, the client object that we created.", 'start': 1913.844, 'duration': 3.203}], 'summary': 'Using a cursor to get user timeline tweets from a client object.', 'duration': 28.443, 'max_score': 1888.604, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1888604.jpg'}, {'end': 2056.112, 'src': 'heatmap', 'start': 1996.566, 'weight': 0.747, 'content': [{'end': 2001.169, 'text': 'So Twitter client is equal to Twitter clients like that.', 'start': 1996.566, 'duration': 4.603}, {'end': 2003.531, 'text': "And then what I'm going to do is I'm just going to print.", 'start': 2001.57, 'duration': 1.961}, {'end': 2005.674, 'text': 'the function that we just created.', 'start': 2004.131, 'duration': 1.543}, {'end': 2010.962, 'text': 'So TwitterClient.GetUserTimelineTweets.', 'start': 2005.714, 'duration': 5.248}, {'end': 2012.905, 'text': 'And that takes an argument.', 'start': 2011.883, 'duration': 1.022}, {'end': 2015.048, 'text': 'That argument is the number of tweets to get.', 'start': 2012.925, 'duration': 2.123}, {'end': 2017.192, 'text': "In this case, I'll say, let's say five.", 'start': 2015.649, 'duration': 1.543}, {'end': 2019.635, 'text': "So let's make sure that works.", 'start': 2018.735, 'duration': 0.9}, {'end': 2020.876, 'text': "Let's save that and run it.", 'start': 2019.655, 'duration': 1.221}, {'end': 2022.836, 'text': "So we'll see what tweets are on my timeline.", 'start': 2021.036, 'duration': 1.8}, {'end': 2024.616, 'text': "So it's got quite a few.", 'start': 2023.176, 'duration': 1.44}, {'end': 2028.297, 'text': 'So remember these tweets come in these big blobs.', 'start': 2025.036, 'duration': 3.261}, {'end': 2033.378, 'text': "So actually to make this a little bit more readable, I'm going to replace that number with just one.", 'start': 2028.337, 'duration': 5.041}, {'end': 2039.56, 'text': 'So I just want to first clear my screen to make it a little bit easier to read and then actually go and run this again.', 'start': 2033.478, 'duration': 6.082}, {'end': 2041.68, 'text': 'This will only get one tweet.', 'start': 2039.92, 'duration': 1.76}, {'end': 2043.841, 'text': 'This whole thing is one tweet.', 'start': 2042.381, 'duration': 1.46}, {'end': 2051.768, 'text': "And basically this is if I go to, let's see if I can find some information about this tweet that will Distinguish it,", 'start': 2044.802, 'duration': 6.966}, {'end': 2056.112, 'text': "and then we'll go to my Twitter profile to verify this actually got the correct tweet.", 'start': 2051.768, 'duration': 4.344}], 'summary': 'Demonstration of retrieving and printing twitter timeline tweets, with a focus on getting a specific number of tweets and enhancing readability.', 'duration': 59.546, 'max_score': 1996.566, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1996566.jpg'}, {'end': 2033.378, 'src': 'embed', 'start': 2001.57, 'weight': 3, 'content': [{'end': 2003.531, 'text': "And then what I'm going to do is I'm just going to print.", 'start': 2001.57, 'duration': 1.961}, {'end': 2005.674, 'text': 'the function that we just created.', 'start': 2004.131, 'duration': 1.543}, {'end': 2010.962, 'text': 'So TwitterClient.GetUserTimelineTweets.', 'start': 2005.714, 'duration': 5.248}, {'end': 2012.905, 'text': 'And that takes an argument.', 'start': 2011.883, 'duration': 1.022}, {'end': 2015.048, 'text': 'That argument is the number of tweets to get.', 'start': 2012.925, 'duration': 2.123}, {'end': 2017.192, 'text': "In this case, I'll say, let's say five.", 'start': 2015.649, 'duration': 1.543}, {'end': 2019.635, 'text': "So let's make sure that works.", 'start': 2018.735, 'duration': 0.9}, {'end': 2020.876, 'text': "Let's save that and run it.", 'start': 2019.655, 'duration': 1.221}, {'end': 2022.836, 'text': "So we'll see what tweets are on my timeline.", 'start': 2021.036, 'duration': 1.8}, {'end': 2024.616, 'text': "So it's got quite a few.", 'start': 2023.176, 'duration': 1.44}, {'end': 2028.297, 'text': 'So remember these tweets come in these big blobs.', 'start': 2025.036, 'duration': 3.261}, {'end': 2033.378, 'text': "So actually to make this a little bit more readable, I'm going to replace that number with just one.", 'start': 2028.337, 'duration': 5.041}], 'summary': 'Printing function twitterclient.getusertimelinetweets with 5 tweets, adjusting for readability.', 'duration': 31.808, 'max_score': 2001.57, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2001570.jpg'}, {'end': 2111.778, 'src': 'embed', 'start': 2084.31, 'weight': 5, 'content': [{'end': 2092.431, 'text': "this is the most recent tweet that I retweeted from Sam Harris, and it's of the late great Christopher Hitchens, who, if you're not a fan of,", 'start': 2084.31, 'duration': 8.121}, {'end': 2092.911, 'text': 'shame on you.', 'start': 2092.431, 'duration': 0.48}, {'end': 2098.394, 'text': "He's a really interesting guy, and I encourage you to read about him if you don't know who he is.", 'start': 2093.911, 'duration': 4.483}, {'end': 2102.895, 'text': "So this isn't a political channel, but he's amazing.", 'start': 2098.554, 'duration': 4.341}, {'end': 2103.835, 'text': "Anyway, so that's that.", 'start': 2103.015, 'duration': 0.82}, {'end': 2111.778, 'text': "So yeah, so we've successfully obtained the most recent tweet on my timeline.", 'start': 2103.915, 'duration': 7.863}], 'summary': 'The speaker discusses retweeting a tweet about christopher hitchens and encourages learning more about him.', 'duration': 27.468, 'max_score': 2084.31, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2084310.jpg'}], 'start': 1707.991, 'title': 'Twitter api and timeline tweets retrieval', 'summary': 'Covers creating a twitter client class to authenticate and utilize the twitter api, explaining the process of extracting user timeline tweets and the functionality of the cursor class. it also discusses retrieving user timeline tweets using a python twitter client, demonstrating the process of fetching and displaying tweets, including applying filters and verifying the results.', 'chapters': [{'end': 1938.147, 'start': 1707.991, 'title': 'Twitter api: extracting and using tweets', 'summary': 'Covers creating a twitter client class to authenticate and utilize the twitter api, explaining the process of extracting user timeline tweets and the functionality of the cursor class.', 'duration': 230.156, 'highlights': ['Creating a Twitter client class to authenticate and utilize the Twitter API The transcript details the process of creating a Twitter client class to authenticate and utilize the Twitter API, involving the use of an authenticator object and the API class from Tweepy.', "Explaining the process of extracting user timeline tweets The process of extracting user timeline tweets is explained, involving the creation of a 'get tweets' function and the use of the cursor class to retrieve a specified number of tweets.", 'Functionality of the cursor class The functionality of the cursor class is described, highlighting its role in accessing and retrieving user timeline tweets through the Twitter API.']}, {'end': 2103.835, 'start': 1938.608, 'title': 'Twitter timeline tweets retrieval', 'summary': 'Discusses retrieving user timeline tweets using a python twitter client, demonstrating the process of fetching and displaying tweets, including applying filters and verifying the results.', 'duration': 165.227, 'highlights': ['The function GetUserTimelineTweets retrieves user timeline tweets and takes an argument for the number of tweets to get, such as five. The function GetUserTimelineTweets is used to retrieve user timeline tweets, allowing the specification of the number of tweets to fetch, demonstrated with an example of fetching five tweets.', "A demonstration of retrieving and displaying one tweet from the user's timeline, including verifying the tweet's correctness using the Twitter profile. Demonstrating the retrieval and display of a single tweet from the user's timeline, followed by a verification process using the Twitter profile to ensure the correctness of the fetched tweet.", "A brief introduction to the content of the most recent tweet on the user's timeline, featuring a retweet from Sam Harris about Christopher Hitchens. Providing a brief introduction to the most recent tweet on the user's timeline, which involves a retweet from Sam Harris about Christopher Hitchens, with an encouragement to read about the late great Christopher Hitchens."]}], 'duration': 395.844, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw1707991.jpg', 'highlights': ['Creating a Twitter client class to authenticate and utilize the Twitter API involving the use of an authenticator object and the API class from Tweepy', "Explaining the process of extracting user timeline tweets involving the creation of a 'get tweets' function and the use of the cursor class to retrieve a specified number of tweets", 'The functionality of the cursor class is described, highlighting its role in accessing and retrieving user timeline tweets through the Twitter API', 'The function GetUserTimelineTweets retrieves user timeline tweets and takes an argument for the number of tweets to get, such as five', "A demonstration of retrieving and displaying one tweet from the user's timeline, including verifying the tweet's correctness using the Twitter profile", "A brief introduction to the content of the most recent tweet on the user's timeline, featuring a retweet from Sam Harris about Christopher Hitchens"]}, {'end': 2597.079, 'segs': [{'end': 2201.717, 'src': 'embed', 'start': 2169.698, 'weight': 0, 'content': [{'end': 2170.799, 'text': 'this is a default argument.', 'start': 2169.698, 'duration': 1.101}, {'end': 2174.96, 'text': 'And if nothing is specified here for Twitter user, it just defaults to none.', 'start': 2170.999, 'duration': 3.961}, {'end': 2181.683, 'text': "And remember, in our case, none, if you don't specify a Twitter user, it will just go to your own timeline.", 'start': 2175.761, 'duration': 5.922}, {'end': 2186.845, 'text': 'So we want to specify a user, so we will be doing that.', 'start': 2182.203, 'duration': 4.642}, {'end': 2193.733, 'text': "So the way that we tell the Tweepy API that we've specified a user is in this cursor function here.", 'start': 2187.365, 'duration': 6.368}, {'end': 2198.199, 'text': 'This method will say ID is equal to self.twitterUser.', 'start': 2194.374, 'duration': 3.825}, {'end': 2201.717, 'text': 'So that will do that.', 'start': 2199.716, 'duration': 2.001}], 'summary': 'Specify a twitter user to access tweepy api with id=self.twitteruser.', 'duration': 32.019, 'max_score': 2169.698, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2169698.jpg'}, {'end': 2266.817, 'src': 'embed', 'start': 2220.343, 'weight': 1, 'content': [{'end': 2224.864, 'text': "So in this case, I'm going to specify based on a user PyCon.", 'start': 2220.343, 'duration': 4.521}, {'end': 2227.784, 'text': "What is PyCon? How do I know it's PyCon? Let's go back here.", 'start': 2225.284, 'duration': 2.5}, {'end': 2233.946, 'text': "So PyCon, if you're not aware, is a conference that focuses on the Python programming language.", 'start': 2228.385, 'duration': 5.561}, {'end': 2237.086, 'text': "And if you're not familiar with it, you should check it out.", 'start': 2234.446, 'duration': 2.64}, {'end': 2240.287, 'text': 'Again, also on YouTube, all the talks are available there.', 'start': 2237.186, 'duration': 3.101}, {'end': 2242.408, 'text': 'Lots of really interesting talks and topics.', 'start': 2240.727, 'duration': 1.681}, {'end': 2244.228, 'text': 'I highly suggest you check it out.', 'start': 2242.908, 'duration': 1.32}, {'end': 2247.109, 'text': 'So anyway, this is the user.', 'start': 2245.188, 'duration': 1.921}, {'end': 2252.371, 'text': 'This is the tweets that we want to obtain the timeline or the home tweets from.', 'start': 2247.209, 'duration': 5.162}, {'end': 2257.813, 'text': 'And the way that I got PyCon was I just followed the, what followed the dot at symbol here.', 'start': 2252.751, 'duration': 5.062}, {'end': 2262.115, 'text': 'So this is the name of the user of which we wish to extract the tweets from.', 'start': 2258.133, 'duration': 3.982}, {'end': 2264.236, 'text': 'So let me just minimize that.', 'start': 2262.855, 'duration': 1.381}, {'end': 2266.817, 'text': "We've specified that it's PyCon.", 'start': 2265.296, 'duration': 1.521}], 'summary': 'Pycon is a conference focusing on python programming language. its talks are available on youtube.', 'duration': 46.474, 'max_score': 2220.343, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2220343.jpg'}, {'end': 2390.223, 'src': 'embed', 'start': 2346.299, 'weight': 3, 'content': [{'end': 2351.343, 'text': "so i'm just going to, i guess, quickly write those down, just so you can have access to them.", 'start': 2346.299, 'duration': 5.044}, {'end': 2352.824, 'text': 'you can play with them.', 'start': 2351.343, 'duration': 1.481}, {'end': 2356.206, 'text': 'the form of all of these functions is pretty much the same.', 'start': 2352.824, 'duration': 3.382}, {'end': 2363.19, 'text': "so if you understand how this one works, the other ones that i'm going to write, which are just two other ones, should be pretty similar.", 'start': 2356.206, 'duration': 6.984}, {'end': 2366.292, 'text': 'so the other one that we can do is we can get friend list.', 'start': 2363.19, 'duration': 3.102}, {'end': 2369.634, 'text': 'so this also will be a class method.', 'start': 2367.773, 'duration': 1.861}, {'end': 2375.437, 'text': "we can also determine how many friends we get by a parameter here that we'll set.", 'start': 2369.634, 'duration': 5.803}, {'end': 2382.96, 'text': "so this again, just like we did before, we're going to define an empty friend list which will store all of the friends for a given user.", 'start': 2375.437, 'duration': 7.523}, {'end': 2390.223, 'text': "in this case i'm not going to specify the user, just because i guess it's not really necessary to get the concept of how this thing works.", 'start': 2382.96, 'duration': 7.263}], 'summary': "Functions for accessing and managing user's friend list, with similar form and methods. another function retrieves friend list and allows specifying number of friends to retrieve.", 'duration': 43.924, 'max_score': 2346.299, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2346299.jpg'}, {'end': 2475.377, 'src': 'embed', 'start': 2445.062, 'weight': 2, 'content': [{'end': 2447.023, 'text': 'uh, we can get home timeline.', 'start': 2445.062, 'duration': 1.961}, {'end': 2447.683, 'text': "let's call it that.", 'start': 2447.023, 'duration': 0.66}, {'end': 2451.765, 'text': 'get home timeline tweets.', 'start': 2447.683, 'duration': 4.082}, {'end': 2455.927, 'text': "so these are uh, you know, you have your own tweets that you've tweeted out yourself.", 'start': 2451.765, 'duration': 4.162}, {'end': 2458.408, 'text': 'the home line, the home line, oh my goodness.', 'start': 2455.927, 'duration': 2.481}, {'end': 2460.149, 'text': 'the home timeline tweets.', 'start': 2458.408, 'duration': 1.741}, {'end': 2466.192, 'text': 'those are the ones that, if you go to your twitter page on the home page, you will see all the people that you follow and everything like that.', 'start': 2460.149, 'duration': 6.043}, {'end': 2469.614, 'text': 'so the top tweet there and and following, you know,', 'start': 2466.192, 'duration': 3.422}, {'end': 2475.377, 'text': "from there are the home timeline tweets and that's we can also extract those for a given user as well.", 'start': 2469.614, 'duration': 5.763}], 'summary': 'Extract home timeline tweets for a given user.', 'duration': 30.315, 'max_score': 2445.062, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2445062.jpg'}], 'start': 2103.915, 'title': 'Obtaining timeline tweets for specific user using tweepy api', 'summary': 'Discusses modifying a function to specify a user for obtaining timeline tweets, with a demonstration using the pycon user and verifying the successful extraction. it also explains how to use tweepy api to retrieve friend list, home timeline tweets, and user timeline, allowing for customization such as specifying the number of tweets or pages to retrieve.', 'chapters': [{'end': 2346.299, 'start': 2103.915, 'title': 'Obtaining timeline tweets for specific user', 'summary': 'Discusses modifying a function to allow the specification of a user for obtaining timeline tweets, with a demonstration using the pycon user and verifying the successful extraction of a timeline tweet.', 'duration': 242.384, 'highlights': ['The method of specifying a user for obtaining timeline tweets is demonstrated by modifying a function to allow passing the user information as an argument, with a default argument of none, and instantiating a Twitter client object based on the specified user (PyCon) to extract the timeline tweets (8 times mentioned).', 'The successful extraction of a timeline tweet from the specified user (PyCon) is verified by retrieving the text of the tweet and confirming its presence in the timeline, demonstrating the capability to obtain timeline tweets from specific users (3 times mentioned).', 'The chapter mentions the availability of talks and topics related to PyCon on YouTube and encourages checking it out for those unfamiliar with the conference, showcasing its relevance and providing additional information for context (2 times mentioned).']}, {'end': 2597.079, 'start': 2346.299, 'title': 'Tweepy api functions', 'summary': 'Explains how to use tweepy api to retrieve friend list, home timeline tweets, and user timeline, with similar patterns and methods, allowing for customization such as specifying the number of tweets or pages to retrieve.', 'duration': 250.78, 'highlights': ["Explaining the method to retrieve home timeline tweets The chapter explains the process of retrieving home timeline tweets, which are tweets visible on the user's Twitter home page, and the method allows for customizing the number of tweets to retrieve.", 'Method to retrieve friend list The chapter outlines the method to retrieve a friend list, allowing for customizing the number of friends to retrieve for a given user.', 'Similar pattern in API methods The chapter emphasizes the similarity in the patterns of the API methods, indicating that once the understanding of one method is gained, the others are relatively similar in structure and functionality.']}], 'duration': 493.164, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2103915.jpg', 'highlights': ['The method of specifying a user for obtaining timeline tweets is demonstrated by modifying a function to allow passing the user information as an argument, with a default argument of none, and instantiating a Twitter client object based on the specified user (PyCon) to extract the timeline tweets.', 'The successful extraction of a timeline tweet from the specified user (PyCon) is verified by retrieving the text of the tweet and confirming its presence in the timeline, demonstrating the capability to obtain timeline tweets from specific users.', "Explaining the method to retrieve home timeline tweets The chapter explains the process of retrieving home timeline tweets, which are tweets visible on the user's Twitter home page, and the method allows for customizing the number of tweets to retrieve.", 'Method to retrieve friend list The chapter outlines the method to retrieve a friend list, allowing for customizing the number of friends to retrieve for a given user.', 'The chapter emphasizes the similarity in the patterns of the API methods, indicating that once the understanding of one method is gained, the others are relatively similar in structure and functionality.', 'The chapter mentions the availability of talks and topics related to PyCon on YouTube and encourages checking it out for those unfamiliar with the conference, showcasing its relevance and providing additional information for context.']}, {'end': 3845.516, 'segs': [{'end': 2656.875, 'src': 'embed', 'start': 2631.356, 'weight': 0, 'content': [{'end': 2637.678, 'text': "And if you don't already have NumPy and Pandas installed, then you'll need to run the following command in the terminal.", 'start': 2631.356, 'duration': 6.322}, {'end': 2639.219, 'text': 'Let me just make this a little bit bigger.', 'start': 2638.139, 'duration': 1.08}, {'end': 2642.982, 'text': 'So, if you run pip, install pandas,', 'start': 2639.899, 'duration': 3.083}, {'end': 2653.272, 'text': 'this is going to essentially give us the content that will allow us to store the tweets and the corresponding things that we extract from those tweets into something called a data frame.', 'start': 2642.982, 'duration': 10.29}, {'end': 2656.875, 'text': 'And this will allow us to pass this around, maybe make a graph out of it.', 'start': 2653.372, 'duration': 3.503}], 'summary': "Installing numpy and pandas using 'pip' allows for storing and analyzing tweet data in a data frame for visualization.", 'duration': 25.519, 'max_score': 2631.356, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2631356.jpg'}, {'end': 2834.966, 'src': 'embed', 'start': 2808.352, 'weight': 2, 'content': [{'end': 2812.273, 'text': "So we'll say TweetAnalyzer and this is just going to be a class.", 'start': 2808.352, 'duration': 3.921}, {'end': 2816.614, 'text': "We'll go ahead and put in a comment here to briefly describe what this class is supposed to be doing.", 'start': 2812.313, 'duration': 4.301}, {'end': 2825.598, 'text': "Let's say functionality for analyzing and categorizing content from tweets, something like that.", 'start': 2817.035, 'duration': 8.563}, {'end': 2828.739, 'text': "Okay, so that's a brief description of that class.", 'start': 2826.778, 'duration': 1.961}, {'end': 2831.482, 'text': "So we'll eventually go and fill this in.", 'start': 2829.299, 'duration': 2.183}, {'end': 2834.966, 'text': 'Let me go down to the main portion of the file here,', 'start': 2831.903, 'duration': 3.063}], 'summary': 'Creating a tweetanalyzer class for analyzing and categorizing tweet content.', 'duration': 26.614, 'max_score': 2808.352, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2808352.jpg'}, {'end': 3086.497, 'src': 'embed', 'start': 3031.231, 'weight': 1, 'content': [{'end': 3039.297, 'text': "what we're going to be doing is just kind of honing in on a few key aspects of what content we can extract from a single tweet and then just putting that into a data frame.", 'start': 3031.231, 'duration': 8.066}, {'end': 3041.838, 'text': "So we've got this tweet, we know that it works.", 'start': 3039.997, 'duration': 1.841}, {'end': 3044.62, 'text': "We're streaming tweets from Donald Trump's Twitter page.", 'start': 3041.858, 'duration': 2.762}, {'end': 3056.329, 'text': 'And now what we can do is we can go ahead and create a data frame which is going to store that content and just going to allow us to neatly organize that and also to process it for further data analysis later.', 'start': 3044.901, 'duration': 11.428}, {'end': 3064.475, 'text': "So we're going to make use of this tweet analyzer class, which we've created up here and also the NumPy and Pandas modules that we imported.", 'start': 3057.109, 'duration': 7.366}, {'end': 3069.3, 'text': 'So the first thing that I want to do is I want to create a function in this tweet analyzer class.', 'start': 3065.195, 'duration': 4.105}, {'end': 3072.323, 'text': "Let's call it tweetsToDataFrame.", 'start': 3069.66, 'duration': 2.663}, {'end': 3080.23, 'text': "So it's just going to take the tweets that we've gotten here, which is just this big JSON string, and then convert it to a data frame.", 'start': 3072.903, 'duration': 7.327}, {'end': 3086.497, 'text': "So in this, it'll take self, it's a member of the class, and it will also take the tweets that we want to convert to a data frame.", 'start': 3081.271, 'duration': 5.226}], 'summary': "Extract and organize tweets from donald trump's twitter into a data frame for analysis.", 'duration': 55.266, 'max_score': 3031.231, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3031231.jpg'}, {'end': 3347.262, 'src': 'embed', 'start': 3317.426, 'weight': 8, 'content': [{'end': 3319.728, 'text': 'We can ask how many likes there are, favorite count.', 'start': 3317.426, 'duration': 2.302}, {'end': 3324.231, 'text': 'So we can ask where this tweet actually came from, the ID, a whole bunch of things.', 'start': 3320.088, 'duration': 4.143}, {'end': 3330.735, 'text': "And so what we're going to want to do is we're going to want to figure out how to extract this information from each individual tweet.", 'start': 3324.711, 'duration': 6.024}, {'end': 3334.817, 'text': 'put that information into our data frame and then kind of build on this.', 'start': 3331.355, 'duration': 3.462}, {'end': 3341.059, 'text': "So not only do we have the text for each of the tweets, but we've also got maybe the ID, the like count, things like that.", 'start': 3334.857, 'duration': 6.202}, {'end': 3342.72, 'text': "So that's what we wanna do.", 'start': 3341.079, 'duration': 1.641}, {'end': 3344.641, 'text': "So I'm just gonna go ahead and comment this out.", 'start': 3343.14, 'duration': 1.501}, {'end': 3347.262, 'text': "That's just was to kind of illustrate what things we can extract.", 'start': 3344.661, 'duration': 2.601}], 'summary': 'Extract tweet data including likes, id, and build data frame.', 'duration': 29.836, 'max_score': 3317.426, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3317426.jpg'}, {'end': 3501.301, 'src': 'embed', 'start': 3474.93, 'weight': 9, 'content': [{'end': 3480.032, 'text': "So the list that we're going to be feeding into this is similar to what we saw above.", 'start': 3474.93, 'duration': 5.102}, {'end': 3482.453, 'text': 'So we can say tweet.id.', 'start': 3480.592, 'duration': 1.861}, {'end': 3486.795, 'text': "So that's again, how we extracted the ID for a specific tweet.", 'start': 3482.653, 'duration': 4.142}, {'end': 3491.037, 'text': 'As we saw down here below, we wanted to extract the retweet count or the ID.', 'start': 3487.115, 'duration': 3.922}, {'end': 3498.48, 'text': 'We did tweet zero or whatever ID that corresponds to in our list of tweets.id.retweetcount.', 'start': 3491.397, 'duration': 7.083}, {'end': 3499.8, 'text': 'whatever we happen to be interested in.', 'start': 3498.52, 'duration': 1.28}, {'end': 3501.301, 'text': "So we're doing the ID here.", 'start': 3500.26, 'duration': 1.041}], 'summary': 'Extracting tweet ids and retweet counts from a list.', 'duration': 26.371, 'max_score': 3474.93, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3474930.jpg'}, {'end': 3702.073, 'src': 'embed', 'start': 3670.656, 'weight': 6, 'content': [{'end': 3672.097, 'text': "So if you're not sure, you can consult that.", 'start': 3670.656, 'duration': 1.441}, {'end': 3678.38, 'text': 'So for us to get the date here, we can say created.createdAt.', 'start': 3672.777, 'duration': 5.603}, {'end': 3682.002, 'text': 'So this is going to give us the date that that particular tweet was created at.', 'start': 3678.8, 'duration': 3.202}, {'end': 3683.323, 'text': 'Same process there.', 'start': 3682.402, 'duration': 0.921}, {'end': 3686.204, 'text': "Let's say that we also want to do the source.", 'start': 3683.803, 'duration': 2.401}, {'end': 3690.586, 'text': 'So this is going to allow us to determine where the tweet is coming from.', 'start': 3686.504, 'duration': 4.082}, {'end': 3697.09, 'text': 'Was it from an iPhone? Was it from an Android? Was it from a desktop PC? And the way that we can get that information is by saying .', 'start': 3690.646, 'duration': 6.444}, {'end': 3702.073, 'text': "source Let's say we also want to do the number of likes.", 'start': 3697.09, 'duration': 4.983}], 'summary': "Consult 'created.createdat' for tweet date and 'source' for tweet origin. can also determine the number of likes.", 'duration': 31.417, 'max_score': 3670.656, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3670656.jpg'}], 'start': 2597.119, 'title': 'Twitter data analysis', 'summary': 'Covers setting up infrastructure for twitter data analysis using pandas and numpy, analyzing tweets with pandas, and extracting information from tweets, including specific attributes like date of creation, source, likes, and retweets.', 'chapters': [{'end': 2999.056, 'start': 2597.119, 'title': 'Setting up infrastructure for twitter data analysis', 'summary': 'Covers setting up the infrastructure for analyzing tweets using pandas and numpy. it includes instructions for installing the necessary modules, such as pandas and numpy, and creating classes and functions for interfacing with the twitter client api and analyzing tweets.', 'duration': 401.937, 'highlights': ['Instructions for installing Pandas and NumPy modules using pip in the terminal. The speaker provides instructions for installing Pandas and NumPy modules using pip in the terminal, which are essential for storing and analyzing tweet data.', 'Introduction to the functionality of Pandas and NumPy for storing and analyzing tweet data. The speaker introduces the functionality of Pandas and NumPy for storing and analyzing tweet data, emphasizing their importance for creating data frames and performing analysis.', "Creation of a class for analyzing and categorizing content from tweets. The speaker describes the creation of a class called 'TweetAnalyzer' for analyzing and categorizing content from tweets, indicating the direction for future development and analysis of tweet data."]}, {'end': 3651.141, 'start': 2999.516, 'title': 'Analyzing twitter data with pandas', 'summary': "Demonstrates extracting and organizing data from donald trump's twitter page into a pandas dataframe, including text, id, retweet count, and length of tweets for further analysis, using python and pandas modules.", 'duration': 651.625, 'highlights': ["Extracting and organizing data from Donald Trump's Twitter page into a Pandas DataFrame for further analysis, including text, ID, retweet count, and length of tweets using Python and Pandas modules", 'Demonstrating the process of creating a function in the tweet analyzer class to convert tweets into a DataFrame using Pandas, allowing for neat organization and further data analysis', 'Exploring the extraction of various attributes from tweets, such as ID, retweet count, and tweet length, and storing them in the DataFrame for analysis and visualization']}, {'end': 3845.516, 'start': 3651.482, 'title': 'Extracting information from tweets', 'summary': 'Explains how to extract various attributes from tweets, including the date of creation, source (e.g., iphone, android), number of likes, and number of retweets, which can be used to create a data frame for further analysis and visualization.', 'duration': 194.034, 'highlights': ['By using the created.createdAt attribute, we can extract the date of creation for each tweet.', 'The .source attribute allows us to determine the source of each tweet (e.g., iPhone, Android, desktop PC).', 'We can obtain the number of likes for each tweet by using the favorite_count attribute.', 'The retweet_count attribute enables us to extract the number of retweets for each tweet.', 'The extracted attributes are used to create a data frame for further analysis and visualization of the tweet data.']}], 'duration': 1248.397, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw2597119.jpg', 'highlights': ['Instructions for installing Pandas and NumPy modules using pip in the terminal. (Importance of installation)', 'Introduction to the functionality of Pandas and NumPy for storing and analyzing tweet data. (Importance of Pandas and NumPy for data storage and analysis)', 'Creation of a class for analyzing and categorizing content from tweets. (Future development and analysis direction)', "Extracting and organizing data from Donald Trump's Twitter page into a Pandas DataFrame for further analysis. (Data extraction and organization)", 'Demonstrating the process of creating a function in the tweet analyzer class to convert tweets into a DataFrame using Pandas. (Function creation for data conversion)', 'Exploring the extraction of various attributes from tweets and storing them in the DataFrame for analysis and visualization. (Attributes extraction for analysis and visualization)', 'Using the created.createdAt attribute to extract the date of creation for each tweet. (Date of creation extraction)', 'Determining the source of each tweet using the .source attribute. (Source determination)', 'Obtaining the number of likes for each tweet using the favorite_count attribute. (Likes extraction)', 'Extracting the number of retweets for each tweet using the retweet_count attribute. (Retweets extraction)', 'Creating a data frame for further analysis and visualization of the tweet data using the extracted attributes. (Data frame creation for analysis and visualization)']}, {'end': 4421.099, 'segs': [{'end': 3919.367, 'src': 'embed', 'start': 3885.35, 'weight': 6, 'content': [{'end': 3892.172, 'text': "So one thing we can get from our data frame that we've already got is let's just say that we want to, maybe within the data frame,", 'start': 3885.35, 'duration': 6.822}, {'end': 3897.613, 'text': 'we have a want to figure out what is the average length of all of the tweets that we have in our data frame.', 'start': 3892.172, 'duration': 5.441}, {'end': 3904.496, 'text': 'So we here collect 20 tweets and we want to figure out okay, what is the average length of all of those 20 tweets?', 'start': 3897.693, 'duration': 6.803}, {'end': 3907.196, 'text': 'And of course we can change this count from 20 to 200 or 400, or whatever we care about.', 'start': 3904.536, 'duration': 2.66}, {'end': 3919.367, 'text': "so let's just write in a comment here, which is get average length over all tweets, and now that we've stored everything in this data frame,", 'start': 3909.517, 'duration': 9.85}], 'summary': 'Calculate average length of 20 tweets in data frame.', 'duration': 34.017, 'max_score': 3885.35, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3885350.jpg'}, {'end': 4002.602, 'src': 'embed', 'start': 3976.081, 'weight': 3, 'content': [{'end': 3980.285, 'text': "I'm just going to go ahead and write that, clear the terminal, and then we can go ahead and say Python.", 'start': 3976.081, 'duration': 4.204}, {'end': 3982.786, 'text': 'This is called visualizing Twitter data pie.', 'start': 3980.685, 'duration': 2.101}, {'end': 3991.733, 'text': 'And we get here that the average length is 122.2 characters per tweet in this size.', 'start': 3983.747, 'duration': 7.986}, {'end': 3995.556, 'text': "So we can, of course, increase that to, let's say, like maybe, I don't know, 200 tweets.", 'start': 3992.074, 'duration': 3.482}, {'end': 3998.799, 'text': "Let's see how that changes when we get a larger sample of data.", 'start': 3996.017, 'duration': 2.782}, {'end': 4002.602, 'text': "So it actually doesn't change terribly much and it's only gone up by a little bit.", 'start': 3999.199, 'duration': 3.403}], 'summary': 'Visualizing twitter data with an average length of 122.2 characters per tweet, increasing to 200 tweets showed minimal change.', 'duration': 26.521, 'max_score': 3976.081, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3976081.jpg'}, {'end': 4086.634, 'src': 'embed', 'start': 4058.161, 'weight': 0, 'content': [{'end': 4063.722, 'text': 'so the maximum number of likes it looks like over those 20 tweets was something like 121 862..', 'start': 4058.161, 'duration': 5.561}, {'end': 4066.242, 'text': "so again, maybe i'm just curious.", 'start': 4063.722, 'duration': 2.52}, {'end': 4074.364, 'text': "i want to see how this scales if we increase the number of tweets from 20 to 200 and it looks like it's gone up by a factor of two, uh,", 'start': 4066.242, 'duration': 8.122}, {'end': 4074.644, 'text': 'from 121 000 to 332 000..', 'start': 4074.364, 'duration': 0.28}, {'end': 4080.146, 'text': "so that's interesting One more.", 'start': 4074.644, 'duration': 5.502}, {'end': 4086.634, 'text': "So let's say that we want to do a very similar thing where instead of getting the number of likes, we want to get the number of retweets.", 'start': 4080.366, 'duration': 6.268}], 'summary': 'Maximum likes increased from 121,862 to 332,000 when tweets increased from 20 to 200.', 'duration': 28.473, 'max_score': 4058.161, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw4058161.jpg'}, {'end': 4159.325, 'src': 'embed', 'start': 4103.094, 'weight': 2, 'content': [{'end': 4110.162, 'text': "So instead of performing it on likes, I'm going to be performing it on the retweets column of the data frame and then printing that out to the screen.", 'start': 4103.094, 'duration': 7.068}, {'end': 4111.464, 'text': "So let's go ahead and write that.", 'start': 4110.202, 'duration': 1.262}, {'end': 4114.502, 'text': 'And then run it, see what we get.', 'start': 4113.362, 'duration': 1.14}, {'end': 4118.044, 'text': 'So the maximum number of retweets is 107, 000.', 'start': 4115.844, 'duration': 2.2}, {'end': 4120.667, 'text': "So that's interesting as well.", 'start': 4118.045, 'duration': 2.622}, {'end': 4123.129, 'text': 'So of course, these are just printing out the numbers to the screen.', 'start': 4120.707, 'duration': 2.422}, {'end': 4126.511, 'text': "It's very minimal in terms of what we're actually doing with the data.", 'start': 4123.549, 'duration': 2.962}, {'end': 4133.877, 'text': "There's endless possibilities for what you could actually do and extract from these sorts of insights that we're driving from this data.", 'start': 4126.571, 'duration': 7.306}, {'end': 4137.698, 'text': "All right, so now let's move on to plotting some time series data.", 'start': 4134.596, 'duration': 3.102}, {'end': 4144, 'text': "And I'm just going to put in a comment here to distinguish what we're going to do from what we previously did, time series.", 'start': 4138.138, 'duration': 5.862}, {'end': 4151.862, 'text': "And let's say hypothetically that what we want to do is we want to create a time series plot that's going to show us the number of, let's say,", 'start': 4144.72, 'duration': 7.142}, {'end': 4159.325, 'text': 'likes that Donald Trump received on any given day over the course of some days, which we can extract from some given count here.', 'start': 4151.862, 'duration': 7.463}], 'summary': 'Performed analysis on retweets column, max retweets: 107,000. exploring time series data for likes received by donald trump.', 'duration': 56.231, 'max_score': 4103.094, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw4103094.jpg'}, {'end': 4414.357, 'src': 'embed', 'start': 4385.993, 'weight': 5, 'content': [{'end': 4389.394, 'text': 'So I should also say that you should have matplotlib installed.', 'start': 4385.993, 'duration': 3.401}, {'end': 4393.956, 'text': "And if you don't have it installed, you can just open up a new terminal Just make this a little bit bigger.", 'start': 4389.654, 'duration': 4.302}, {'end': 4397.14, 'text': 'And you can just run pip install matplotlib.', 'start': 4394.276, 'duration': 2.864}, {'end': 4399.222, 'text': 'And this should install everything that you need.', 'start': 4397.42, 'duration': 1.802}, {'end': 4401.804, 'text': 'I believe this comes with NumPy already.', 'start': 4399.242, 'duration': 2.562}, {'end': 4404.728, 'text': 'So you might already have it installed if you have NumPy installed.', 'start': 4402.165, 'duration': 2.563}, {'end': 4409.913, 'text': "If you don't, if you want to be sure, you can run the command that I just ran, which is installing matplotlib.", 'start': 4405.088, 'duration': 4.825}, {'end': 4412.255, 'text': "You'll see that I already have this requirement satisfied.", 'start': 4410.153, 'duration': 2.102}, {'end': 4414.357, 'text': "i i'm good to go.", 'start': 4413.016, 'duration': 1.341}], 'summary': "Ensure matplotlib is installed using 'pip install matplotlib' to satisfy requirements for the program.", 'duration': 28.364, 'max_score': 4385.993, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw4385993.jpg'}], 'start': 3845.916, 'title': 'Analyzing twitter data', 'summary': 'Discusses analyzing twitter data, including the average tweet length of 122.2 characters, the tweet with the most likes receiving 121,862 likes, and the tweet with the most retweets garnering 107,000 retweets.', 'chapters': [{'end': 3976.061, 'start': 3845.916, 'title': 'Analyzing tweet length', 'summary': 'Discusses analyzing tweet data to derive insights without graphing, including calculating the average length of 20 tweets using the mean function in numpy.', 'duration': 130.145, 'highlights': ['The chapter discusses analyzing tweet data to derive insights without graphing The chapter focuses on deriving insights from tweet data without graphing, emphasizing the analysis of tweet length to demonstrate the process.', 'Calculating the average length of 20 tweets using the mean function in numpy The chapter explains the process of calculating the average length of 20 tweets by utilizing the mean function in numpy to manipulate the data stored in the data frame.']}, {'end': 4123.129, 'start': 3976.081, 'title': 'Analyzing twitter data', 'summary': 'Focuses on analyzing twitter data, including the average tweet length, the tweet with the most likes, and the tweet with the most retweets, revealing insights such as the average tweet length being 122.2 characters, the tweet with the most likes receiving 121,862 likes, and the tweet with the most retweets garnering 107,000 retweets.', 'duration': 147.048, 'highlights': ['The maximum number of retweets is 107,000, providing insights into the engagement level of the most retweeted tweet.', 'The maximum number of likes received by a tweet is 121,862, demonstrating the popularity of a specific tweet.', 'The average length of a tweet is 122.2 characters, indicating a common tweet length in the analyzed data.', 'Increasing the sample size from 20 to 200 tweets resulted in a twofold increase in the maximum number of likes, from 121,000 to 332,000, highlighting the scalability of likes with tweet volume.']}, {'end': 4421.099, 'start': 4123.549, 'title': 'Plotting time series data with pandas', 'summary': 'Discusses the process of creating a time series plot to display the number of likes received by donald trump on any given day over a specified range of days, using pandas and matplotlib, and provides guidance on installing matplotlib.', 'duration': 297.55, 'highlights': ['The process of creating a time series plot to display the number of likes received by Donald Trump on any given day is explained. The chapter delves into the creation of a time series plot to showcase the number of likes received by Donald Trump on any given day over a specified range of days, utilizing pandas and matplotlib.', 'Guidance on installing matplotlib is provided, including the command for installation and the assurance that it may already be installed if NumPy is present. Instructions for installing matplotlib are outlined, with a demonstration of the installation command and the assurance that it may already be installed if NumPy is present.']}], 'duration': 575.183, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw3845916.jpg', 'highlights': ['Increasing the sample size from 20 to 200 tweets resulted in a twofold increase in the maximum number of likes, from 121,000 to 332,000, highlighting the scalability of likes with tweet volume.', 'The maximum number of likes received by a tweet is 121,862, demonstrating the popularity of a specific tweet.', 'The maximum number of retweets is 107,000, providing insights into the engagement level of the most retweeted tweet.', 'The average length of a tweet is 122.2 characters, indicating a common tweet length in the analyzed data.', 'The process of creating a time series plot to display the number of likes received by Donald Trump on any given day is explained.', 'Guidance on installing matplotlib is provided, including the command for installation and the assurance that it may already be installed if NumPy is present.', 'Calculating the average length of 20 tweets using the mean function in numpy The chapter explains the process of calculating the average length of 20 tweets by utilizing the mean function in numpy to manipulate the data stored in the data frame.', 'The chapter discusses analyzing tweet data to derive insights without graphing The chapter focuses on deriving insights from tweet data without graphing, emphasizing the analysis of tweet length to demonstrate the process.']}, {'end': 5400.735, 'segs': [{'end': 4531.216, 'src': 'embed', 'start': 4505.337, 'weight': 4, 'content': [{'end': 4509.74, 'text': "So that's a time series for the number of likes, but we can also do time series for other things.", 'start': 4505.337, 'duration': 4.403}, {'end': 4516.525, 'text': "So really we can just kind of modify this code very slightly to do, let's say the time series for retweets.", 'start': 4510.141, 'duration': 6.384}, {'end': 4519.267, 'text': "So maybe I'll take this, I'll paste this down here.", 'start': 4516.765, 'duration': 2.502}, {'end': 4523.29, 'text': "And then instead of time likes, let's call this time retweets.", 'start': 4519.668, 'duration': 3.622}, {'end': 4525.772, 'text': "Let's also rename that.", 'start': 4524.011, 'duration': 1.761}, {'end': 4526.973, 'text': "So that's also time retweets.", 'start': 4525.792, 'duration': 1.181}, {'end': 4531.216, 'text': "then the series object that we're going to create.", 'start': 4528.633, 'duration': 2.583}], 'summary': 'Modifying code to create time series for retweets.', 'duration': 25.879, 'max_score': 4505.337, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw4505337.jpg'}, {'end': 4836.242, 'src': 'embed', 'start': 4792.511, 'weight': 2, 'content': [{'end': 4794.835, 'text': "So, first of all, there's a lot more likes than retweets,", 'start': 4792.511, 'duration': 2.324}, {'end': 4801.524, 'text': 'but you can see certain spikes that arise in the likes also correspond to spikes that arise in the retweets as well.', 'start': 4794.835, 'duration': 6.689}, {'end': 4809.093, 'text': "So that's very topical, probably something you could have arrived at without doing any sort of a plot analysis on it,", 'start': 4802.725, 'duration': 6.368}, {'end': 4812.136, 'text': "but it's kind of interesting to see the data being visualized like this.", 'start': 4809.093, 'duration': 3.043}, {'end': 4816.922, 'text': 'This is more just kind of an exercise in what you can do using this type of data.', 'start': 4812.156, 'duration': 4.766}, {'end': 4824.589, 'text': "We're going to analyze the sentiment of a given tweet.", 'start': 4820.765, 'duration': 3.824}, {'end': 4829.955, 'text': "So we're going to determine whether or not the sentiment of a given tweet is overly positive, negative, or neutral.", 'start': 4824.849, 'duration': 5.106}, {'end': 4836.242, 'text': "And for this purpose, we're going to make use of a module called Text Blob.", 'start': 4830.516, 'duration': 5.726}], 'summary': 'Data analysis shows correlation between likes and retweets in tweets.', 'duration': 43.731, 'max_score': 4792.511, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw4792511.jpg'}, {'end': 5037.035, 'src': 'embed', 'start': 5006.423, 'weight': 0, 'content': [{'end': 5008.305, 'text': 'So we have a function that does that.', 'start': 5006.423, 'duration': 1.882}, {'end': 5009.305, 'text': "It's responsible for that.", 'start': 5008.405, 'duration': 0.9}, {'end': 5018.532, 'text': "Now we want another function that's going to be responsible for calling TextBlob and using the sentiment analyzer provided from TextBlob and then returning the sentiment.", 'start': 5009.746, 'duration': 8.786}, {'end': 5023.725, 'text': "So let's call this function Analyze sentiment.", 'start': 5019.032, 'duration': 4.693}, {'end': 5029.089, 'text': 'this will be taking self and then also the tweet that we want to analyze the sentiment of.', 'start': 5023.725, 'duration': 5.364}, {'end': 5032.792, 'text': "so we'll go ahead and create an object that will be returned to us from text blob.", 'start': 5029.089, 'duration': 3.703}, {'end': 5037.035, 'text': "we'll call this object analysis and we'll set this equal to text blob,", 'start': 5032.792, 'duration': 4.243}], 'summary': 'Creating a function to analyze sentiment using textblob.', 'duration': 30.612, 'max_score': 5006.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw5006423.jpg'}, {'end': 5212.296, 'src': 'embed', 'start': 5185.769, 'weight': 1, 'content': [{'end': 5192.111, 'text': "So really what we're doing is we've created this data frame, which again is returned to us from this function as part of the tweet analyzer class.", 'start': 5185.769, 'duration': 6.342}, {'end': 5198.752, 'text': "And then what I'm doing is I'm adding another column onto that data frame, which I'm going to call, let's call it sentiment.", 'start': 5192.491, 'duration': 6.261}, {'end': 5205.214, 'text': 'And this is going to have the one zero or minus one, depending on the sentiment analysis of that tweet.', 'start': 5199.272, 'duration': 5.942}, {'end': 5212.296, 'text': "So what we're going to do, we're going to change one thing in here, instead of saying the reach week, we obviously don't want that.", 'start': 5205.714, 'duration': 6.582}], 'summary': 'Creating a data frame with sentiment analysis for tweets.', 'duration': 26.527, 'max_score': 5185.769, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw5185769.jpg'}], 'start': 4421.099, 'title': 'Visualizing twitter data and sentiment analysis in python', 'summary': 'Covers creating time series plots for likes and retweets, visualizing correlation, and sentiment analysis using textblob. it also discusses cleaning tweets and sentiment analysis resulting in a data frame with examples of -1 for negative, 0 for neutral, and 1 for positive sentiment.', 'chapters': [{'end': 4938.034, 'start': 4421.099, 'title': 'Visualizing twitter data with pandas', 'summary': 'Covers creating time series plots for the number of likes and retweets, visualizing the correlation between them, and the installation and usage of the text blob module for sentiment analysis of tweets.', 'duration': 516.935, 'highlights': ['The chapter covers creating time series plots for the number of likes and retweets The speaker demonstrates creating time series plots for the number of likes and retweets using pandas, allowing visualization of how the number of likes and retweets change over a given set of dates.', 'Visualizing the correlation between likes and retweets The speaker explains the correlation between the number of likes and retweets, displaying how certain spikes in likes correspond to spikes in retweets, providing a visual representation of the correlation between the two.', 'Installation and usage of the Text Blob module for sentiment analysis of tweets The chapter introduces the installation of the Text Blob module for sentiment analysis of tweets, including the use of a built-in sentiment analyzer to determine whether tweets are positive, negative, or neutral.']}, {'end': 5400.735, 'start': 4938.114, 'title': 'Sentiment analysis in python', 'summary': 'Discusses the creation of functions for cleaning tweets and analyzing sentiment using textblob, resulting in a data frame with sentiment analysis for each tweet, with examples of -1 for negative, 0 for neutral, and 1 for positive sentiment.', 'duration': 462.621, 'highlights': ["Creation of functions for cleaning tweets and analyzing sentiment using TextBlob The chapter covers the creation of two functions, 'clean tweet' and 'analyze sentiment,' using regular expressions and TextBlob for cleaning tweets and sentiment analysis.", 'Resulting data frame with sentiment analysis for each tweet The process results in a data frame containing sentiment analysis for each tweet, denoted by -1 for negative, 0 for neutral, and 1 for positive sentiment, demonstrated through examples in the output.', 'Examples of sentiment analysis results in the output The output demonstrates examples of sentiment analysis results, with tweets being interpreted as negative, neutral, or positive, showcasing the practical application of the sentiment analysis functions.']}], 'duration': 979.636, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/1gQ6uG5Ujiw/pics/1gQ6uG5Ujiw4421099.jpg', 'highlights': ['Creation of functions for cleaning tweets and analyzing sentiment using TextBlob', 'Resulting data frame with sentiment analysis for each tweet', 'Examples of sentiment analysis results in the output', 'Visualizing the correlation between likes and retweets', 'The chapter covers creating time series plots for the number of likes and retweets', 'Installation and usage of the Text Blob module for sentiment analysis of tweets']}], 'highlights': ['The tutorial series on twitter data analysis in python covers setting up a twitter application, accessing tweepy documentation, streaming real-time tweets, refactoring code, retrieving user timeline tweets, and analyzing tweet data.', 'The chapter covers the process of installing Tweepy, creating a Twitter application, and writing Python code to stream real-time tweets from Twitter based on keywords or hashtags.', 'The chapter covers the basic usage of the Tweepy library, including importing classes, creating a custom listener class, and overriding methods for tweet handling.', 'The process of defining a TwitterStreamer object and utilizing the streamTweets method for efficiently accessing and analyzing tweets is explained.', 'Creating a Twitter client class to authenticate and utilize the Twitter API involving the use of an authenticator object and the API class from Tweepy.', 'The method of specifying a user for obtaining timeline tweets is demonstrated by modifying a function to allow passing the user information as an argument, with a default argument of none, and instantiating a Twitter client object based on the specified user (PyCon) to extract the timeline tweets.', 'Instructions for installing Pandas and NumPy modules using pip in the terminal.', 'Increasing the sample size from 20 to 200 tweets resulted in a twofold increase in the maximum number of likes, from 121,000 to 332,000, highlighting the scalability of likes with tweet volume.', 'Creation of functions for cleaning tweets and analyzing sentiment using TextBlob', 'Visualizing the correlation between likes and retweets']}