1 00:00:00,000 --> 00:00:00,920 2 00:00:00,920 --> 00:00:04,290 ZAMYLA CHAN: Get ready, we're moving on to the world wide web. 3 00:00:04,290 --> 00:00:07,750 In application.py we allow a user to see, 4 00:00:07,750 --> 00:00:13,190 in a web page, a pie chart breaking down a particular Twitter users 5 00:00:13,190 --> 00:00:16,340 positive, negative, and neutral tweets. 6 00:00:16,340 --> 00:00:17,990 So what do we have to do? 7 00:00:17,990 --> 00:00:21,530 Well, if we look into application.py let's read through this 8 00:00:21,530 --> 00:00:24,800 and see how the workflow for this problem goes. 9 00:00:24,800 --> 00:00:29,270 First we'll get the screen name from a GET request, redirecting to the index 10 00:00:29,270 --> 00:00:30,750 if that's missing. 11 00:00:30,750 --> 00:00:32,689 Then we want to get that particular screen 12 00:00:32,689 --> 00:00:38,090 names tweets, redirecting to index if none but that's your job to implement. 13 00:00:38,090 --> 00:00:43,040 Once you've done that initialize Analyzer as you learned in Analyzer.py 14 00:00:43,040 --> 00:00:45,440 and analyze those tweets. 15 00:00:45,440 --> 00:00:48,980 To analyze the tweets we'll want to iterate over the tweets scoring 16 00:00:48,980 --> 00:00:52,520 all of the words in those tweets, calculating whether they 17 00:00:52,520 --> 00:00:55,160 are positive, negative, or neutral. 18 00:00:55,160 --> 00:01:00,200 Now assuming that you've successfully implemented analyzer.py and tweets, 19 00:01:00,200 --> 00:01:03,500 then the actual amount of code that you'll be writing for this problem 20 00:01:03,500 --> 00:01:05,250 is minimal. 21 00:01:05,250 --> 00:01:07,880 The real takeaway from this problem is to see 22 00:01:07,880 --> 00:01:12,350 how Python can interact with the web, how we can render templates and pass 23 00:01:12,350 --> 00:01:13,880 in actual values. 24 00:01:13,880 --> 00:01:17,600 Because if we continue to read on an application.py 25 00:01:17,600 --> 00:01:21,080 you'll see how application.py generates the pie chart 26 00:01:21,080 --> 00:01:24,020 and then renders that pie chart, showing the percentages 27 00:01:24,020 --> 00:01:29,120 of positive, negative, and neutral tweets and displays that on a website. 28 00:01:29,120 --> 00:01:33,950 My name is Zamyla, and this was application.py. 29 00:01:33,950 --> 00:01:36,338