0 00:00:00,000 --> 00:00:30,000 Dear viewer, these subtitles were generated by a machine via the service Trint and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/1144 Thanks! 1 00:00:18,610 --> 00:00:21,609 Hi, everyone, thanks for coming 2 00:00:21,610 --> 00:00:22,610 at this early hour 3 00:00:24,580 --> 00:00:26,859 today here. We'll have a basically a one 4 00:00:26,860 --> 00:00:29,139 hour walk through of building 5 00:00:29,140 --> 00:00:31,269 a wiki data tool 6 00:00:31,270 --> 00:00:33,459 by Lucas works for Wikimedia, 7 00:00:33,460 --> 00:00:35,409 but has independently of that built a 8 00:00:35,410 --> 00:00:37,749 wide range of creative tools, I guess. 9 00:00:39,070 --> 00:00:40,299 So give a hand for Lucas. 10 00:00:45,960 --> 00:00:47,909 Yeah, hi, I'm Lucas. 11 00:00:47,910 --> 00:00:50,249 I work at Wikimania Germany on 12 00:00:50,250 --> 00:00:52,439 the software development team for 13 00:00:52,440 --> 00:00:54,629 wiki data, but I 14 00:00:54,630 --> 00:00:56,729 also write some tools for Wiki 15 00:00:56,730 --> 00:00:58,199 data in my private time. 16 00:00:58,200 --> 00:01:00,269 Not really a wide range of things, but 17 00:01:00,270 --> 00:01:01,649 a few of them. 18 00:01:01,650 --> 00:01:03,929 So. So what I'm doing now is just private 19 00:01:03,930 --> 00:01:05,999 stuff not related to WMD 20 00:01:06,000 --> 00:01:07,000 directly, 21 00:01:08,490 --> 00:01:10,559 but what we're going to build is 22 00:01:10,560 --> 00:01:13,589 a tool for we could data as a tool 23 00:01:13,590 --> 00:01:16,529 generally is almost anything that 24 00:01:16,530 --> 00:01:19,019 people use to interact with 25 00:01:19,020 --> 00:01:21,209 wiki data or with Wikipedia or something. 26 00:01:21,210 --> 00:01:23,459 That's not part of the 27 00:01:23,460 --> 00:01:24,749 wiki software itself. 28 00:01:25,870 --> 00:01:27,239 But more specifically, we're going to 29 00:01:27,240 --> 00:01:29,609 build a tool on this 30 00:01:29,610 --> 00:01:32,339 Wikimedia Tool Forge platform where 31 00:01:34,170 --> 00:01:35,729 the Wikimedia Foundation takes care of 32 00:01:35,730 --> 00:01:37,769 the hosting for us so we don't have to 33 00:01:37,770 --> 00:01:39,899 rent a server or take care 34 00:01:39,900 --> 00:01:41,519 of certificates or anything. 35 00:01:41,520 --> 00:01:43,709 We just write the code for the tool 36 00:01:43,710 --> 00:01:45,839 and the foundation hosts 37 00:01:45,840 --> 00:01:47,969 for us, which is nice. 38 00:01:47,970 --> 00:01:50,039 And more specifically, 39 00:01:50,040 --> 00:01:52,020 we're going to build a tool for 40 00:01:53,040 --> 00:01:55,139 patrolling recent changes so 41 00:01:55,140 --> 00:01:57,329 we could data when 42 00:01:57,330 --> 00:01:59,429 a new user or a user who isn't 43 00:01:59,430 --> 00:02:01,709 even logged in makes edits that edits 44 00:02:01,710 --> 00:02:04,169 is marked as unpatrolled. 45 00:02:04,170 --> 00:02:06,669 And then later, some experienced 46 00:02:06,670 --> 00:02:08,519 editors can go through the list of 47 00:02:08,520 --> 00:02:11,038 uncontrolled changes and see 48 00:02:11,039 --> 00:02:13,169 all these changes. OK, do they make sense 49 00:02:13,170 --> 00:02:14,639 or perhaps someone made a mistake and 50 00:02:14,640 --> 00:02:16,049 this should be done differently? 51 00:02:16,050 --> 00:02:18,119 Or perhaps it's just vandalism 52 00:02:18,120 --> 00:02:20,279 and then they can mark 53 00:02:20,280 --> 00:02:22,409 the edit as patrolled or they can improve 54 00:02:22,410 --> 00:02:24,509 it or revert it and then Mark patrolled. 55 00:02:24,510 --> 00:02:26,579 So marking the edit 56 00:02:26,580 --> 00:02:28,349 as patrol doesn't mean that the edits is 57 00:02:28,350 --> 00:02:30,509 good or bad. It just means 58 00:02:30,510 --> 00:02:32,309 no one needs to look at this anymore. 59 00:02:32,310 --> 00:02:34,289 It's done for now and we're going to 60 00:02:34,290 --> 00:02:35,999 build a tool that helps people with a 61 00:02:36,000 --> 00:02:37,259 bit. 62 00:02:37,260 --> 00:02:38,260 And 63 00:02:41,550 --> 00:02:43,649 so I'm going to do this 64 00:02:43,650 --> 00:02:45,809 now within one hour, 65 00:02:45,810 --> 00:02:47,309 perhaps one and a half hours, depending 66 00:02:47,310 --> 00:02:48,809 on how long it takes, which is obviously 67 00:02:48,810 --> 00:02:50,879 not really realistic for building 68 00:02:50,880 --> 00:02:52,949 a full tool, because I practiced this 69 00:02:52,950 --> 00:02:55,079 a few times now, but 70 00:02:55,080 --> 00:02:57,299 I would say that the tool that we 71 00:02:57,300 --> 00:02:58,619 are going to build now would be 72 00:02:58,620 --> 00:03:00,749 realistic, I think, as a weekend project. 73 00:03:00,750 --> 00:03:03,029 And I don't mean a crazy twelve hours 74 00:03:03,030 --> 00:03:05,189 each day hackathon weekend, but just 75 00:03:05,190 --> 00:03:07,289 a normal, relaxed weekend where you have 76 00:03:07,290 --> 00:03:09,899 perhaps a few hours each day that you 77 00:03:09,900 --> 00:03:12,239 can spend on playing with this 78 00:03:12,240 --> 00:03:14,309 tool and experimenting with it. 79 00:03:14,310 --> 00:03:16,379 And then at the end of the weekend, 80 00:03:16,380 --> 00:03:18,479 you might have some first version of the 81 00:03:18,480 --> 00:03:20,159 tool and then you can improve on that. 82 00:03:20,160 --> 00:03:22,469 I think that would be more 83 00:03:22,470 --> 00:03:25,079 or less the realistic timescale for 84 00:03:25,080 --> 00:03:26,370 what's going to happen now. 85 00:03:27,870 --> 00:03:30,149 And we're going to create 86 00:03:30,150 --> 00:03:32,429 the tool using a template that 87 00:03:32,430 --> 00:03:34,139 takes care of a lot of boilerplate code 88 00:03:34,140 --> 00:03:36,389 for us. So that's called 89 00:03:36,390 --> 00:03:38,249 a cookie cutter template. 90 00:03:38,250 --> 00:03:40,409 And the template is 91 00:03:40,410 --> 00:03:42,149 under my name and it's called Cookie 92 00:03:42,150 --> 00:03:44,489 Cutter Tool Forge. 93 00:03:44,490 --> 00:03:45,929 And then it's going to ask us a few 94 00:03:45,930 --> 00:03:49,049 questions and please let me know 95 00:03:49,050 --> 00:03:50,759 if this is not readable. 96 00:03:52,020 --> 00:03:54,089 Um, so the tool identified is going 97 00:03:54,090 --> 00:03:56,339 to be speed patrolling and the full 98 00:03:56,340 --> 00:03:58,109 name is speed patrolling with them 99 00:03:58,110 --> 00:03:59,789 uppercase letters. So it looks nicer 100 00:04:01,290 --> 00:04:02,189 than maintain a name. 101 00:04:02,190 --> 00:04:03,749 That's my own username 102 00:04:04,830 --> 00:04:07,319 and my email address in case something 103 00:04:07,320 --> 00:04:10,229 goes really wrong is this 104 00:04:10,230 --> 00:04:12,599 and the tool is going to work on weekdays 105 00:04:12,600 --> 00:04:14,549 of work and not on any other weekend. 106 00:04:14,550 --> 00:04:15,870 So that's just OK. 107 00:04:20,300 --> 00:04:21,300 No, 108 00:04:22,430 --> 00:04:24,439 I practiced this like yesterday evening, 109 00:04:24,440 --> 00:04:25,440 who created this 110 00:04:27,050 --> 00:04:28,050 talent, 111 00:04:30,470 --> 00:04:32,150 did I create that accidentally? 112 00:04:33,500 --> 00:04:35,450 Hang on. First problem of the day, 113 00:04:36,860 --> 00:04:39,109 did I create a. 114 00:04:39,110 --> 00:04:40,829 No, I did not. 115 00:04:40,830 --> 00:04:43,400 Who created speed patrolling? 116 00:04:46,130 --> 00:04:47,130 Uh, 117 00:04:52,640 --> 00:04:54,919 well, if the true name 118 00:04:54,920 --> 00:04:56,689 is already taken, we'll just have to make 119 00:04:56,690 --> 00:04:58,849 up a different one, I guess. 120 00:04:58,850 --> 00:05:00,859 So let's instead call it. 121 00:05:00,860 --> 00:05:02,689 Yes. Thank you. 122 00:05:02,690 --> 00:05:04,040 Krick patrolling 123 00:05:06,020 --> 00:05:08,240 and copy the rest of the information. 124 00:05:13,940 --> 00:05:16,009 OK, do I not have an 125 00:05:16,010 --> 00:05:17,059 Internet connection anymore? 126 00:05:17,060 --> 00:05:20,119 That would be, of course, wonderful. 127 00:05:20,120 --> 00:05:22,279 Oh, that would also be why this 128 00:05:22,280 --> 00:05:23,449 doesn't work, because I don't have 129 00:05:23,450 --> 00:05:24,450 Internet. Apparently, 130 00:05:27,590 --> 00:05:29,000 I do have DNS. 131 00:05:33,410 --> 00:05:34,410 What the hell? 132 00:05:36,410 --> 00:05:37,579 We data is running, 133 00:05:39,230 --> 00:05:40,319 but. 134 00:05:40,320 --> 00:05:41,320 Oh, now it's running. 135 00:05:44,270 --> 00:05:46,429 Oh. To Tool's starts. 136 00:05:46,430 --> 00:05:48,439 Oops. Sorry. That is of course the meth 137 00:05:48,440 --> 00:05:49,440 labs. 138 00:05:50,930 --> 00:05:52,429 OK, uh 139 00:05:54,110 --> 00:05:55,970 I'll just try again with 140 00:05:58,700 --> 00:06:00,799 speed patrolling I guess. 141 00:06:11,130 --> 00:06:12,510 Now, uh. 142 00:06:17,840 --> 00:06:18,840 OK. 143 00:06:24,190 --> 00:06:25,190 Why, 144 00:06:27,310 --> 00:06:28,310 um, 145 00:06:29,710 --> 00:06:30,779 what can I do? 146 00:06:40,310 --> 00:06:43,039 Let me just delete this, 147 00:06:43,040 --> 00:06:45,259 and this 148 00:06:45,260 --> 00:06:47,239 is what I meant. Yes, yes, 149 00:06:48,450 --> 00:06:50,750 and try to run it again 150 00:06:52,910 --> 00:06:54,199 and kill it. 151 00:06:54,200 --> 00:06:56,449 And then we have cookie 152 00:06:56,450 --> 00:06:57,379 cutters. 153 00:06:57,380 --> 00:06:58,519 There it is. 154 00:06:58,520 --> 00:07:00,470 And I'm just going to 155 00:07:02,090 --> 00:07:04,459 disable this hook and 156 00:07:04,460 --> 00:07:06,649 then we will be able to 157 00:07:06,650 --> 00:07:08,420 proceed with the template, at least 158 00:07:11,540 --> 00:07:12,980 speed patrolling, 159 00:07:14,600 --> 00:07:16,039 and then we will see later if we are 160 00:07:16,040 --> 00:07:18,319 actually able to create the tool 161 00:07:18,320 --> 00:07:20,419 or not. But we'll just bypass this 162 00:07:20,420 --> 00:07:21,420 warning 163 00:07:22,880 --> 00:07:24,589 for now. 164 00:07:24,590 --> 00:07:25,980 There we go. OK. 165 00:07:28,220 --> 00:07:30,079 And I'm just going to open the new 166 00:07:30,080 --> 00:07:31,339 terminal. There we go. 167 00:07:33,110 --> 00:07:35,179 So here, let's open the read me 168 00:07:35,180 --> 00:07:37,609 first. That is generated for us. 169 00:07:37,610 --> 00:07:39,739 It says for local 170 00:07:39,740 --> 00:07:40,729 development set up. 171 00:07:40,730 --> 00:07:42,919 We want to run this 172 00:07:42,920 --> 00:07:43,920 command. 173 00:07:45,860 --> 00:07:48,229 So to install the dependencies, 174 00:07:48,230 --> 00:07:50,120 which should hopefully not take too long. 175 00:07:52,220 --> 00:07:53,509 There we go. 176 00:07:53,510 --> 00:07:55,669 And then we can run this command 177 00:07:55,670 --> 00:07:57,769 to run the tool for now just on our 178 00:07:57,770 --> 00:07:59,389 local system. 179 00:07:59,390 --> 00:08:01,760 And we can open this, your URL 180 00:08:02,780 --> 00:08:04,909 in a browser. 181 00:08:04,910 --> 00:08:06,739 And there we go. There's a first version 182 00:08:06,740 --> 00:08:09,049 of the tool. And here's a long 183 00:08:09,050 --> 00:08:11,209 page that tells you all 184 00:08:11,210 --> 00:08:13,279 kinds of things about how you would 185 00:08:13,280 --> 00:08:15,379 proceed with building 186 00:08:15,380 --> 00:08:16,519 the tool the next steps. 187 00:08:16,520 --> 00:08:19,249 And if 188 00:08:19,250 --> 00:08:20,539 you're building the tool, you should 189 00:08:20,540 --> 00:08:22,279 definitely follow this page because it's 190 00:08:22,280 --> 00:08:23,989 hopefully useful. But I'm going to skip 191 00:08:23,990 --> 00:08:26,599 most of it just for time reasons. 192 00:08:26,600 --> 00:08:28,429 So we're going to create the tool that we 193 00:08:28,430 --> 00:08:29,959 can be a tool for immediate lead, because 194 00:08:29,960 --> 00:08:31,699 that takes a few minutes behind the 195 00:08:31,700 --> 00:08:33,109 scenes and I don't want to wait for that 196 00:08:33,110 --> 00:08:35,178 later. So let's create speech 197 00:08:35,179 --> 00:08:36,409 patrolling. 198 00:08:38,570 --> 00:08:40,819 No, that is indeed 199 00:08:40,820 --> 00:08:42,529 already in use or invalid. 200 00:08:42,530 --> 00:08:44,450 Can I use quick patrolling? 201 00:08:46,220 --> 00:08:49,189 No speed. 202 00:08:49,190 --> 00:08:50,629 Speed minus patrolling 203 00:08:52,160 --> 00:08:53,209 that's available. 204 00:08:53,210 --> 00:08:55,349 OK, so I guess it's now called speed 205 00:08:55,350 --> 00:08:57,559 and minus patrolling speeds, 206 00:08:59,540 --> 00:09:01,069 patrolling the space. 207 00:09:01,070 --> 00:09:03,079 In that case, I guess and I already wrote 208 00:09:03,080 --> 00:09:05,629 the description, so I'll just 209 00:09:05,630 --> 00:09:07,819 copy that. 210 00:09:07,820 --> 00:09:10,099 It is a 211 00:09:10,100 --> 00:09:11,989 tool to patrol and patrol recent changes 212 00:09:11,990 --> 00:09:13,609 on the daytime. Autonomous patrols are 213 00:09:13,610 --> 00:09:14,929 rolling the back as appropriate. 214 00:09:14,930 --> 00:09:17,149 Given user writes, the software will 215 00:09:17,150 --> 00:09:19,219 be the HPL 216 00:09:19,220 --> 00:09:21,679 and the text are key data 217 00:09:21,680 --> 00:09:23,960 and patrol 218 00:09:25,010 --> 00:09:26,419 and create the tool. 219 00:09:26,420 --> 00:09:28,669 And behind the scenes, some stuff 220 00:09:28,670 --> 00:09:30,679 is happening that we don't care about for 221 00:09:30,680 --> 00:09:32,389 now, sorry. 222 00:09:32,390 --> 00:09:34,909 And instead we are going to 223 00:09:34,910 --> 00:09:37,249 move ahead and register an oil 224 00:09:37,250 --> 00:09:40,129 consumer. So off is 225 00:09:40,130 --> 00:09:41,539 oops. This is not readable by the way. 226 00:09:41,540 --> 00:09:43,819 Sorry, off 227 00:09:43,820 --> 00:09:46,009 is how we talk to we 228 00:09:46,010 --> 00:09:48,799 could data and because we need to 229 00:09:48,800 --> 00:09:51,259 do things on behalf of the of 230 00:09:51,260 --> 00:09:52,519 our user, the tool user. 231 00:09:52,520 --> 00:09:54,259 But if we don't want them to just give us 232 00:09:54,260 --> 00:09:55,609 their username and password because that 233 00:09:55,610 --> 00:09:57,829 would be terrible. And then if my tool 234 00:09:57,830 --> 00:10:00,289 gets hacked, all my users are compromised 235 00:10:00,290 --> 00:10:02,089 as well, which I don't want. 236 00:10:02,090 --> 00:10:03,859 So instead we're going to use a laugh and 237 00:10:03,860 --> 00:10:05,929 say this tool only needs 238 00:10:05,930 --> 00:10:08,419 to be able to do these few things. 239 00:10:08,420 --> 00:10:09,420 And 240 00:10:10,580 --> 00:10:11,959 we never see the user's password. 241 00:10:11,960 --> 00:10:14,509 We just see a bunch of tokens which 242 00:10:14,510 --> 00:10:16,249 we will give us. 243 00:10:16,250 --> 00:10:18,529 And usually this is not 244 00:10:18,530 --> 00:10:19,909 the first thing you do when you start 245 00:10:19,910 --> 00:10:21,469 working on the tool. 246 00:10:21,470 --> 00:10:23,179 Usually you can hack around a bit and 247 00:10:23,180 --> 00:10:26,299 then eventually get around to adding off. 248 00:10:26,300 --> 00:10:28,369 But we need off 249 00:10:28,370 --> 00:10:29,749 actually just to get a list of 250 00:10:29,750 --> 00:10:32,089 uncontrolled changes because that's 251 00:10:32,090 --> 00:10:33,200 not public. So we need 252 00:10:34,370 --> 00:10:36,499 to have the privileges of our 253 00:10:36,500 --> 00:10:38,869 tool user even to just see 254 00:10:38,870 --> 00:10:40,699 which changes are not patrolled yet, 255 00:10:40,700 --> 00:10:43,909 which changes we should show to the user. 256 00:10:43,910 --> 00:10:46,009 So we're going to start with that. 257 00:10:46,010 --> 00:10:48,199 And our consumer 258 00:10:48,200 --> 00:10:50,269 is going to be called speed 259 00:10:50,270 --> 00:10:51,979 patrolling. 260 00:10:51,980 --> 00:10:53,989 The version is going to be one point OS 261 00:10:53,990 --> 00:10:56,059 dash dev No. 262 00:10:56,060 --> 00:10:58,399 Oh one that's made point one and 263 00:10:58,400 --> 00:11:00,590 I wrote the description as well. 264 00:11:02,150 --> 00:11:03,499 Do not approve of this consumer. 265 00:11:03,500 --> 00:11:05,659 We will see in a second why 266 00:11:05,660 --> 00:11:06,979 and the callback. 267 00:11:06,980 --> 00:11:09,319 Your URL is going to be what it says 268 00:11:09,320 --> 00:11:11,419 here, except 269 00:11:11,420 --> 00:11:14,359 it's going to be speed minus patrolling 270 00:11:14,360 --> 00:11:16,039 because speed patrolling was apparently 271 00:11:16,040 --> 00:11:17,040 taking. 272 00:11:18,590 --> 00:11:20,669 This consumer will only work on 273 00:11:20,670 --> 00:11:22,789 wiki data and not on any other wiki. 274 00:11:22,790 --> 00:11:24,949 And the rights we need is 275 00:11:24,950 --> 00:11:27,139 our to patrol changes and 276 00:11:27,140 --> 00:11:28,369 to roll back changes. 277 00:11:28,370 --> 00:11:30,589 So we will only 278 00:11:30,590 --> 00:11:32,809 be able to make changes as patrols and 279 00:11:32,810 --> 00:11:34,759 to revert them if necessary. 280 00:11:34,760 --> 00:11:36,199 And we don't want any other privileges. 281 00:11:36,200 --> 00:11:38,419 So even if this tool 282 00:11:38,420 --> 00:11:39,359 gets. Compromised. 283 00:11:39,360 --> 00:11:41,789 No one can make weird 284 00:11:41,790 --> 00:11:44,639 edits using it, and 285 00:11:44,640 --> 00:11:46,739 I accept 286 00:11:46,740 --> 00:11:48,809 and acknowledge all these things and 287 00:11:48,810 --> 00:11:51,329 I'm going to propose the consumer. 288 00:11:51,330 --> 00:11:53,929 And no, apparently, 289 00:11:55,080 --> 00:11:56,809 oh, that's an invalid value. 290 00:11:58,260 --> 00:11:59,969 Can I use it in lowercase? 291 00:12:07,150 --> 00:12:07,959 Yes, OK. 292 00:12:07,960 --> 00:12:10,449 And here we have a consumer token and a 293 00:12:10,450 --> 00:12:12,279 secret token, which is 294 00:12:13,960 --> 00:12:16,509 why I put this big uppercase 295 00:12:16,510 --> 00:12:17,949 do not approve this consumer in that 296 00:12:17,950 --> 00:12:20,349 description, because this secret token 297 00:12:20,350 --> 00:12:22,029 is now public to all of you and to the 298 00:12:22,030 --> 00:12:23,739 entire Internet. 299 00:12:23,740 --> 00:12:25,899 So we are going to copy these for now 300 00:12:25,900 --> 00:12:27,999 and add them 301 00:12:28,000 --> 00:12:29,739 to the. 302 00:12:29,740 --> 00:12:31,929 So we are going to copy the config 303 00:12:31,930 --> 00:12:34,359 example file to a real config file, 304 00:12:36,140 --> 00:12:37,839 ensure that no one else can read it and 305 00:12:37,840 --> 00:12:40,179 then edit it and put the consumer 306 00:12:40,180 --> 00:12:43,479 key here and the consumer's secret 307 00:12:43,480 --> 00:12:44,480 here. 308 00:12:45,220 --> 00:12:47,499 And we can also fill in this secret 309 00:12:47,500 --> 00:12:49,209 key just with a bunch of keyboard 310 00:12:49,210 --> 00:12:50,979 mashing. That's fine. 311 00:12:50,980 --> 00:12:53,079 And now next, we need 312 00:12:53,080 --> 00:12:55,389 to tell the 313 00:12:55,390 --> 00:12:57,699 admins that we have requested this 314 00:12:57,700 --> 00:13:00,009 consumer. So we do that 315 00:13:00,010 --> 00:13:01,149 on 316 00:13:02,380 --> 00:13:05,049 this page using 317 00:13:05,050 --> 00:13:06,279 this template. 318 00:13:06,280 --> 00:13:08,349 So we copy this example 319 00:13:08,350 --> 00:13:11,379 code and edit 320 00:13:11,380 --> 00:13:14,079 this section of manual requests 321 00:13:14,080 --> 00:13:16,029 and add our own requests 322 00:13:17,680 --> 00:13:20,049 at the bottom, which just sets 323 00:13:20,050 --> 00:13:21,610 off approval requests for 324 00:13:22,750 --> 00:13:25,329 speed patrolling 325 00:13:25,330 --> 00:13:26,769 the app name is speed. 326 00:13:26,770 --> 00:13:29,019 Patrolling the version is zero 327 00:13:29,020 --> 00:13:30,669 point one dash dev. 328 00:13:30,670 --> 00:13:34,149 The publisher is myself 329 00:13:34,150 --> 00:13:36,489 and the consumer key is 330 00:13:36,490 --> 00:13:38,049 this thing. 331 00:13:38,050 --> 00:13:40,119 And my comments I have already 332 00:13:40,120 --> 00:13:42,249 written to tell the people that they're 333 00:13:42,250 --> 00:13:44,049 not supposed to approve this consumer 334 00:13:44,050 --> 00:13:46,179 because the secret token 335 00:13:46,180 --> 00:13:47,589 is actually public. 336 00:13:47,590 --> 00:13:49,929 So let's check if that looks more 337 00:13:49,930 --> 00:13:51,169 or less OK. 338 00:13:53,910 --> 00:13:56,640 Yes, OK, so 339 00:14:00,510 --> 00:14:03,229 act or approve 340 00:14:03,230 --> 00:14:04,230 request. 341 00:14:05,400 --> 00:14:07,829 So if this off 342 00:14:07,830 --> 00:14:10,079 tool is not accepted, then 343 00:14:10,080 --> 00:14:12,269 I will be the only one who is able to use 344 00:14:12,270 --> 00:14:13,320 it so 345 00:14:14,340 --> 00:14:17,039 I can test using my account right now. 346 00:14:17,040 --> 00:14:19,109 But no one else will be able 347 00:14:19,110 --> 00:14:20,289 to use this tool right now. 348 00:14:20,290 --> 00:14:22,289 And then later I will request the 349 00:14:22,290 --> 00:14:23,909 different consumer. And that's going to 350 00:14:23,910 --> 00:14:25,259 be the real one where the secret tokens 351 00:14:25,260 --> 00:14:26,309 actually secret. 352 00:14:26,310 --> 00:14:27,899 But usually, of course, if you were 353 00:14:27,900 --> 00:14:30,089 building the tool, then you just request 354 00:14:30,090 --> 00:14:32,879 one consumer and don't tell the 355 00:14:32,880 --> 00:14:35,009 admins to not approve 356 00:14:35,010 --> 00:14:36,299 that consumer because that's a bit weird. 357 00:14:37,500 --> 00:14:39,629 OK, so now we should be able 358 00:14:39,630 --> 00:14:42,089 to go back to this tool and 359 00:14:42,090 --> 00:14:43,799 open the login page. 360 00:14:45,690 --> 00:14:47,729 Uh huh. OK, now hang on a second. 361 00:14:47,730 --> 00:14:49,709 We we've changed the config file, so we 362 00:14:49,710 --> 00:14:52,259 need to restart 363 00:14:52,260 --> 00:14:53,459 the server. 364 00:14:53,460 --> 00:14:54,460 Let's do that. 365 00:14:55,560 --> 00:14:57,179 There we go. 366 00:14:57,180 --> 00:14:58,559 Speed patrolling, wants to interact, 367 00:14:58,560 --> 00:15:00,929 patrol changes and roll back changes. 368 00:15:00,930 --> 00:15:02,359 I'm going to allow that. 369 00:15:03,840 --> 00:15:06,269 And of course, this goes through the 370 00:15:06,270 --> 00:15:08,009 callback your be specified, which we 371 00:15:08,010 --> 00:15:08,969 haven't set up yet. 372 00:15:08,970 --> 00:15:11,189 So I'm just going to edit all this to 373 00:15:11,190 --> 00:15:13,469 go back to local hotspot five 374 00:15:13,470 --> 00:15:14,470 thousands 375 00:15:15,720 --> 00:15:17,849 and oops. 376 00:15:20,070 --> 00:15:21,070 Oh. 377 00:15:24,380 --> 00:15:27,469 Well, I'm not sure 378 00:15:27,470 --> 00:15:28,429 where that's coming from. 379 00:15:28,430 --> 00:15:30,619 OK, let's try 380 00:15:30,620 --> 00:15:32,689 going back here, and I 381 00:15:32,690 --> 00:15:34,819 might need to clear out some storage 382 00:15:34,820 --> 00:15:36,889 because I as 383 00:15:36,890 --> 00:15:38,960 I said, I practiced this a few times, so 384 00:15:40,280 --> 00:15:42,229 there might be some old cookie hanging 385 00:15:42,230 --> 00:15:44,749 around there. So let's go to log in 386 00:15:44,750 --> 00:15:47,149 and do this again 387 00:15:47,150 --> 00:15:50,179 and edit the URL again. 388 00:15:50,180 --> 00:15:52,429 Localhost part five thousand show 389 00:15:52,430 --> 00:15:53,779 off. There we go. 390 00:15:53,780 --> 00:15:55,039 And now I'm logged in as the 391 00:15:55,040 --> 00:15:56,389 concertmaster. 392 00:15:56,390 --> 00:15:59,779 OK, so now we should be able to 393 00:15:59,780 --> 00:16:02,059 make API requests to be data using 394 00:16:02,060 --> 00:16:03,829 this account here. 395 00:16:03,830 --> 00:16:06,049 So let's start by actually editing 396 00:16:06,050 --> 00:16:07,639 the tools code. 397 00:16:07,640 --> 00:16:09,109 There's a lot of example code here which 398 00:16:09,110 --> 00:16:11,209 we can use and we're 399 00:16:11,210 --> 00:16:13,759 going to start we will need some kind of 400 00:16:13,760 --> 00:16:15,679 authorization so we can just copy this 401 00:16:15,680 --> 00:16:17,179 code from here. 402 00:16:17,180 --> 00:16:19,369 So this is already some code that 403 00:16:19,370 --> 00:16:21,469 makes an API request in this 404 00:16:21,470 --> 00:16:22,939 case to get the user's gender. 405 00:16:22,940 --> 00:16:24,739 We don't need that, but we do need this 406 00:16:24,740 --> 00:16:26,779 part, which is just sets up the session 407 00:16:26,780 --> 00:16:28,159 using the total. 408 00:16:28,160 --> 00:16:29,329 And we're going to put that in your 409 00:16:29,330 --> 00:16:31,429 methods, authenticated 410 00:16:31,430 --> 00:16:33,589 session and 411 00:16:33,590 --> 00:16:34,849 paste all this here. 412 00:16:34,850 --> 00:16:36,919 And if there is no 413 00:16:36,920 --> 00:16:38,749 off access token in the session, then for 414 00:16:38,750 --> 00:16:40,339 now we just return none. 415 00:16:40,340 --> 00:16:42,199 And this will probably crash sooner or 416 00:16:42,200 --> 00:16:43,639 later. But I don't care. 417 00:16:43,640 --> 00:16:45,769 And instead of assigning this, we return 418 00:16:45,770 --> 00:16:48,289 this session and 419 00:16:48,290 --> 00:16:50,000 now we need 420 00:16:52,610 --> 00:16:54,709 to get a list of all 421 00:16:54,710 --> 00:16:56,629 the recent changes so that we can pick 422 00:16:56,630 --> 00:16:58,969 one of them and show it to the user. 423 00:16:58,970 --> 00:17:00,889 And so we're going to write a new method 424 00:17:00,890 --> 00:17:01,890 for that 425 00:17:02,960 --> 00:17:05,689 unpatrolled changes 426 00:17:05,690 --> 00:17:07,219 and get the session 427 00:17:09,140 --> 00:17:12,199 and make an API request. 428 00:17:12,200 --> 00:17:14,239 So to figure out what that looks like, we 429 00:17:14,240 --> 00:17:16,519 can use the API sandbox 430 00:17:16,520 --> 00:17:18,769 on Wiki data, which is an extremely 431 00:17:18,770 --> 00:17:21,019 useful way to just play with the API 432 00:17:21,020 --> 00:17:22,279 and experiment with it. 433 00:17:22,280 --> 00:17:24,949 So if we want to get a list of anything 434 00:17:24,950 --> 00:17:27,108 so like lists of the recent changes, 435 00:17:27,109 --> 00:17:29,029 we're usually going to use this query 436 00:17:29,030 --> 00:17:31,339 module and then here 437 00:17:31,340 --> 00:17:33,949 it asks us which list would we like? 438 00:17:33,950 --> 00:17:36,079 And there is a list called Recent 439 00:17:36,080 --> 00:17:38,329 Changes, which sounds very promising. 440 00:17:38,330 --> 00:17:41,419 And specifically, we want 441 00:17:41,420 --> 00:17:43,729 um, we're not interested 442 00:17:43,730 --> 00:17:45,919 in the timestamp and title, actually. 443 00:17:45,920 --> 00:17:46,939 We only need the I.D. 444 00:17:46,940 --> 00:17:50,179 of the changes we only want 445 00:17:50,180 --> 00:17:52,279 and patrol changes and we 446 00:17:52,280 --> 00:17:55,129 would like as many as possible. 447 00:17:55,130 --> 00:17:57,199 And that's 448 00:17:57,200 --> 00:17:58,759 it, I think. And so we can make the 449 00:17:58,760 --> 00:18:00,949 request here and we see a bunch 450 00:18:00,950 --> 00:18:02,359 of results and we're going to make the 451 00:18:02,360 --> 00:18:04,489 same request over 452 00:18:04,490 --> 00:18:06,709 in the tools. So we need to 453 00:18:06,710 --> 00:18:09,709 get request action as 454 00:18:09,710 --> 00:18:10,710 query. 455 00:18:12,800 --> 00:18:13,800 Is that 456 00:18:15,320 --> 00:18:17,059 OK? I'm just going to continue. 457 00:18:17,060 --> 00:18:18,889 I hope it's not too bad. 458 00:18:18,890 --> 00:18:21,199 We want this to be recent 459 00:18:21,200 --> 00:18:22,200 changes. 460 00:18:24,640 --> 00:18:25,809 No, not the cut, 461 00:18:26,900 --> 00:18:27,900 I think. 462 00:18:31,000 --> 00:18:32,000 Just. 463 00:18:34,450 --> 00:18:35,450 That's new. 464 00:18:38,650 --> 00:18:40,809 OK, is this microphone that's 465 00:18:41,920 --> 00:18:43,160 very inconvenient. 466 00:18:46,510 --> 00:18:48,639 OK, I'll I'll try to 467 00:18:48,640 --> 00:18:49,749 continue like this for now hour until 468 00:18:49,750 --> 00:18:51,159 they set up. 469 00:18:51,160 --> 00:18:52,160 Oh, no. 470 00:18:56,310 --> 00:18:57,390 Where's this coming from? 471 00:18:59,320 --> 00:19:00,320 OK. 472 00:19:12,460 --> 00:19:14,079 OK, and I. 473 00:19:14,080 --> 00:19:16,239 OK, so I'll just have to lean here 474 00:19:16,240 --> 00:19:18,729 because I have to talk and 475 00:19:18,730 --> 00:19:20,469 type at the same time. 476 00:19:20,470 --> 00:19:21,470 Sorry. 477 00:19:23,590 --> 00:19:24,609 Around here I guess. 478 00:19:24,610 --> 00:19:25,839 Is this is this OK? 479 00:19:25,840 --> 00:19:27,999 Yeah. OK, that that 480 00:19:28,000 --> 00:19:29,289 sounds great. Thank you. 481 00:19:29,290 --> 00:19:31,479 So we got a list of recent changes and 482 00:19:31,480 --> 00:19:33,160 our see prop equals 483 00:19:35,080 --> 00:19:36,700 D and 484 00:19:38,890 --> 00:19:40,959 our C show on patrol. 485 00:19:40,960 --> 00:19:42,669 We just copy everything from the API 486 00:19:42,670 --> 00:19:45,039 request we just made and see Limit 487 00:19:45,040 --> 00:19:47,139 should be Max 488 00:19:47,140 --> 00:19:49,359 and then we're going to get 489 00:19:49,360 --> 00:19:50,439 a list of these results. 490 00:19:50,440 --> 00:19:53,019 So actually for 491 00:19:53,020 --> 00:19:55,719 each result in 492 00:19:55,720 --> 00:19:57,939 the results of this and from 493 00:19:57,940 --> 00:20:00,099 there, the query 494 00:20:00,100 --> 00:20:01,990 recent changes part. 495 00:20:03,080 --> 00:20:05,229 Um, no, actually, hang on. 496 00:20:05,230 --> 00:20:06,230 We also want. 497 00:20:07,300 --> 00:20:09,219 So there's some indication here if we 498 00:20:09,220 --> 00:20:11,229 want to get more changes than we already 499 00:20:11,230 --> 00:20:13,899 have, we can continue the API request. 500 00:20:13,900 --> 00:20:16,149 And this library, this 501 00:20:16,150 --> 00:20:18,939 Python library, which we're using to, 502 00:20:18,940 --> 00:20:21,339 um, to interact 503 00:20:21,340 --> 00:20:22,389 with the API, can follow that 504 00:20:22,390 --> 00:20:24,249 automatically. So we're going to 505 00:20:25,960 --> 00:20:28,119 specify continue 506 00:20:28,120 --> 00:20:30,999 Raiche and equals true, I think. 507 00:20:31,000 --> 00:20:33,269 And then that's a list of where 508 00:20:33,270 --> 00:20:35,679 we get a list of results and then 509 00:20:35,680 --> 00:20:38,669 each of them has 510 00:20:38,670 --> 00:20:40,899 looks like this. So for 511 00:20:40,900 --> 00:20:43,809 change in results, recent 512 00:20:43,810 --> 00:20:44,810 query, 513 00:20:46,030 --> 00:20:48,339 recent changes 514 00:20:48,340 --> 00:20:50,829 and now changes one of these objects. 515 00:20:50,830 --> 00:20:53,019 And we want to just return 516 00:20:53,020 --> 00:20:54,460 their revision idea. 517 00:20:58,540 --> 00:21:00,669 And now to just try out if this 518 00:21:00,670 --> 00:21:03,099 works, we're going to write a quick 519 00:21:03,100 --> 00:21:05,319 debug method which 520 00:21:05,320 --> 00:21:07,659 returns the first element 521 00:21:07,660 --> 00:21:09,760 of these uncontrolled changes 522 00:21:10,960 --> 00:21:13,899 and make that available under 523 00:21:13,900 --> 00:21:17,199 the debug endpoint. 524 00:21:17,200 --> 00:21:19,419 And now we can open 525 00:21:19,420 --> 00:21:21,549 source, slash, debug and 526 00:21:21,550 --> 00:21:23,199 the browser and 527 00:21:24,340 --> 00:21:25,839 inch object is not callable. 528 00:21:25,840 --> 00:21:28,089 So we need to return 529 00:21:28,090 --> 00:21:29,259 a string of this. 530 00:21:29,260 --> 00:21:30,260 Actually, I think 531 00:21:31,720 --> 00:21:33,309 yes. OK, so that we have a random 532 00:21:33,310 --> 00:21:35,439 revisionary of an uncontrolled change, we 533 00:21:35,440 --> 00:21:37,599 can quickly 534 00:21:37,600 --> 00:21:39,789 look at that just to verify. 535 00:21:39,790 --> 00:21:41,709 Yes, I can make this edit as patrol so 536 00:21:41,710 --> 00:21:42,789 it's not patrolled yet. 537 00:21:42,790 --> 00:21:43,990 So that works. 538 00:21:45,460 --> 00:21:47,709 And next 539 00:21:47,710 --> 00:21:49,890 we want to have um, 540 00:21:52,810 --> 00:21:55,029 so we want the user to visit a page 541 00:21:55,030 --> 00:21:57,189 like diff and then it's going to 542 00:21:57,190 --> 00:21:58,659 be OK. You can see in my history where 543 00:21:58,660 --> 00:22:00,819 I'm going with this because as 544 00:22:00,820 --> 00:22:03,009 I said this before, so 545 00:22:03,010 --> 00:22:04,929 this dif page is going to pick a random 546 00:22:04,930 --> 00:22:06,579 recent change that's on patrol and then 547 00:22:06,580 --> 00:22:07,479 redirect to that. 548 00:22:07,480 --> 00:22:09,849 So we are going to write this endpoint 549 00:22:09,850 --> 00:22:10,850 next. 550 00:22:11,680 --> 00:22:13,869 We are going to do that somewhere up here 551 00:22:13,870 --> 00:22:15,579 just below the index HTML. 552 00:22:15,580 --> 00:22:16,630 Sorry, I wasn't 553 00:22:17,890 --> 00:22:19,329 so just below index. 554 00:22:19,330 --> 00:22:21,939 Maybe add a new route 555 00:22:21,940 --> 00:22:23,109 for diff. 556 00:22:24,120 --> 00:22:26,259 Um, we are 557 00:22:26,260 --> 00:22:28,869 going to call that method any diff and 558 00:22:28,870 --> 00:22:31,509 the just for now we take 559 00:22:31,510 --> 00:22:33,729 the first idea from these uncontrolled 560 00:22:33,730 --> 00:22:34,839 changes. 561 00:22:34,840 --> 00:22:36,849 So I lied when I said it's a random one, 562 00:22:36,850 --> 00:22:38,259 it's just we take the first one. 563 00:22:38,260 --> 00:22:41,349 That's it for now and we return 564 00:22:41,350 --> 00:22:43,149 a redirect 565 00:22:44,260 --> 00:22:46,779 to the 566 00:22:46,780 --> 00:22:49,329 u r l for a diff page 567 00:22:49,330 --> 00:22:50,619 where the ID is. 568 00:22:50,620 --> 00:22:53,079 This ID and diff 569 00:22:53,080 --> 00:22:55,209 is the next method we're going to 570 00:22:55,210 --> 00:22:57,969 return. So that's a route 571 00:22:57,970 --> 00:23:00,459 that's below slash diff slash. 572 00:23:00,460 --> 00:23:02,709 And here goes the I d. 573 00:23:06,270 --> 00:23:08,669 And for now, we're just going to return 574 00:23:08,670 --> 00:23:10,709 the string of this ID and then we will 575 00:23:10,710 --> 00:23:12,779 take care of that in a second, but if I 576 00:23:12,780 --> 00:23:15,389 now go to Jeff, then 577 00:23:15,390 --> 00:23:17,129 I've been redirected to the Jeff page for 578 00:23:17,130 --> 00:23:19,199 this, and I could just verify that this 579 00:23:19,200 --> 00:23:20,429 works. 580 00:23:20,430 --> 00:23:21,680 Hello, world. 581 00:23:22,830 --> 00:23:24,599 And if I relo this again, then I see the 582 00:23:24,600 --> 00:23:26,969 hello world here. OK, so 583 00:23:26,970 --> 00:23:29,099 now we should actually 584 00:23:29,100 --> 00:23:30,929 populate this page with something. 585 00:23:30,930 --> 00:23:33,029 And what we want to do first is just 586 00:23:33,030 --> 00:23:34,859 show that if to the user and for that 587 00:23:34,860 --> 00:23:37,529 we're going to imbeds the 588 00:23:37,530 --> 00:23:38,690 page from the wiki. 589 00:23:40,560 --> 00:23:43,019 So something like 590 00:23:43,020 --> 00:23:45,149 this page, except that there's a lot 591 00:23:45,150 --> 00:23:46,559 of clutter here that we don't really want 592 00:23:46,560 --> 00:23:48,779 to embed. There's a logo, 593 00:23:48,780 --> 00:23:50,399 there's the whole sidebar, there's my 594 00:23:50,400 --> 00:23:52,319 notifications up here. 595 00:23:52,320 --> 00:23:53,489 So we don't really want to 596 00:23:54,900 --> 00:23:56,169 show all that to the user. 597 00:23:56,170 --> 00:23:58,409 So fortunately, there's a different 598 00:23:58,410 --> 00:24:00,839 special page called 599 00:24:00,840 --> 00:24:03,119 Mobile Diff, which 600 00:24:03,120 --> 00:24:04,079 we can use. 601 00:24:04,080 --> 00:24:06,149 And if we open it on 602 00:24:06,150 --> 00:24:08,249 the mobile side, then we get 603 00:24:08,250 --> 00:24:09,659 a much more. 604 00:24:09,660 --> 00:24:12,869 I need to zoom in here a much more 605 00:24:12,870 --> 00:24:15,239 minimal representation of the difference 606 00:24:15,240 --> 00:24:16,949 with almost no clutter around the page. 607 00:24:16,950 --> 00:24:18,660 So that's what we want to embed. 608 00:24:20,730 --> 00:24:22,949 So that creates a real template for this 609 00:24:22,950 --> 00:24:23,950 page. 610 00:24:24,630 --> 00:24:26,459 The templates are here in the templates 611 00:24:26,460 --> 00:24:27,839 directory. There are some examples, 612 00:24:27,840 --> 00:24:30,989 templates from the templates 613 00:24:30,990 --> 00:24:32,489 which we can delete eventually, but for 614 00:24:32,490 --> 00:24:34,380 now we just keep them and we copy 615 00:24:35,560 --> 00:24:38,099 greeter HTML to 616 00:24:38,100 --> 00:24:40,289 Schimel and edits Stiffed 617 00:24:40,290 --> 00:24:41,339 or Schimel. 618 00:24:41,340 --> 00:24:43,529 And instead of this hello, whatever, we 619 00:24:43,530 --> 00:24:45,750 are going to embed an iFrame, 620 00:24:47,190 --> 00:24:49,379 it's going to be 621 00:24:49,380 --> 00:24:52,019 100 percent wide and 622 00:24:52,020 --> 00:24:54,359 let's say 70 percent 623 00:24:54,360 --> 00:24:56,519 of the viewport high and 624 00:24:56,520 --> 00:24:57,809 the source is going to be 625 00:24:58,980 --> 00:25:02,099 and wiki dates state-of-the-art 626 00:25:02,100 --> 00:25:04,649 special mobile diff 627 00:25:04,650 --> 00:25:06,690 and here goes the I d 628 00:25:09,570 --> 00:25:12,209 and close the iFrame again. 629 00:25:12,210 --> 00:25:14,279 And now here, instead of 630 00:25:14,280 --> 00:25:15,989 just returning the ID, we're going to 631 00:25:15,990 --> 00:25:19,739 return and template. 632 00:25:19,740 --> 00:25:21,719 The template name was different XML. 633 00:25:21,720 --> 00:25:23,909 And there's one parameter which is this 634 00:25:23,910 --> 00:25:26,189 ID and 635 00:25:26,190 --> 00:25:27,960 now we reload this and 636 00:25:29,310 --> 00:25:30,329 we should see. 637 00:25:35,470 --> 00:25:36,470 A surprise. 638 00:25:38,290 --> 00:25:41,329 OK, so when I tested this 639 00:25:41,330 --> 00:25:42,889 week, data wouldn't let me in about this 640 00:25:42,890 --> 00:25:46,069 and I had to add a whole ugly workaround, 641 00:25:46,070 --> 00:25:48,169 but apparently this 642 00:25:48,170 --> 00:25:49,359 is working now. 643 00:25:50,480 --> 00:25:52,999 So let's proceed with that and 644 00:25:53,000 --> 00:25:54,559 be happy that I don't need to spend five 645 00:25:54,560 --> 00:25:56,389 minutes on the workaround and see if it 646 00:25:56,390 --> 00:25:57,319 becomes necessary later. 647 00:25:57,320 --> 00:26:00,079 So we've embedded the different page 648 00:26:00,080 --> 00:26:02,299 right now because I'm so, so zoomed in 649 00:26:02,300 --> 00:26:03,619 by default, you can actually see the 650 00:26:03,620 --> 00:26:04,099 difference. 651 00:26:04,100 --> 00:26:06,019 But that's not going to be a problem 652 00:26:06,020 --> 00:26:07,849 later because I'm only zoomed in right 653 00:26:07,850 --> 00:26:10,999 now for the presentation. 654 00:26:11,000 --> 00:26:12,919 So real users should hopefully be able to 655 00:26:12,920 --> 00:26:15,859 see the difference here and now. 656 00:26:15,860 --> 00:26:18,049 So below this embedded iFrame, 657 00:26:18,050 --> 00:26:20,239 we're going to add a 658 00:26:20,240 --> 00:26:21,399 new row. 659 00:26:21,400 --> 00:26:23,599 So there's just some 660 00:26:23,600 --> 00:26:25,939 standard boot class 661 00:26:25,940 --> 00:26:26,940 bootstrap thing 662 00:26:28,940 --> 00:26:31,549 and no, actually not 663 00:26:31,550 --> 00:26:33,349 so outside of the row. 664 00:26:33,350 --> 00:26:35,899 So we want to add a few buttons 665 00:26:35,900 --> 00:26:37,639 so that users can do stuff and we're 666 00:26:37,640 --> 00:26:39,769 going to do that with an HMO 667 00:26:39,770 --> 00:26:42,379 form. So let's add a form and said 668 00:26:42,380 --> 00:26:44,659 it's going to post to our end 669 00:26:44,660 --> 00:26:46,939 point and then those the form 670 00:26:46,940 --> 00:26:49,189 again. And also because we're using 671 00:26:49,190 --> 00:26:52,099 a form, we need to include 672 00:26:52,100 --> 00:26:53,719 protection against cross site, request 673 00:26:53,720 --> 00:26:54,649 forgery. 674 00:26:54,650 --> 00:26:56,809 Otherwise other people on the Internet 675 00:26:56,810 --> 00:26:58,939 will be able to use our tool to make a 676 00:26:58,940 --> 00:27:00,709 random users patrol of random edits, 677 00:27:00,710 --> 00:27:01,999 which is not what we want. 678 00:27:02,000 --> 00:27:04,069 And to protect us against that, 679 00:27:04,070 --> 00:27:06,769 we can copy something from this 680 00:27:06,770 --> 00:27:09,379 Prasert HMO because that also has a form 681 00:27:09,380 --> 00:27:11,209 and there's a CSF token here. 682 00:27:11,210 --> 00:27:13,939 We just copy this whole line 683 00:27:13,940 --> 00:27:16,309 and then later we'll have to 684 00:27:16,310 --> 00:27:18,229 take care of that in our Python code. 685 00:27:18,230 --> 00:27:19,999 But most of this is already provided by 686 00:27:20,000 --> 00:27:21,649 the template as well. 687 00:27:21,650 --> 00:27:24,169 OK, now that we have that, 688 00:27:24,170 --> 00:27:25,999 we're going to have a row with three 689 00:27:26,000 --> 00:27:26,959 columns. 690 00:27:26,960 --> 00:27:29,269 So that's a column 691 00:27:29,270 --> 00:27:31,339 as M and 692 00:27:31,340 --> 00:27:33,319 inside the column, there's going to be a 693 00:27:33,320 --> 00:27:35,479 button, which is a 694 00:27:35,480 --> 00:27:38,479 bootstrap button, primary one. 695 00:27:38,480 --> 00:27:41,539 And it's this is going to be called Skip. 696 00:27:41,540 --> 00:27:43,489 So that's the most important button. 697 00:27:43,490 --> 00:27:45,349 If the user doesn't understand 698 00:27:46,490 --> 00:27:48,109 this edits, we don't want to force them 699 00:27:48,110 --> 00:27:50,479 to do anything. So Skip should be 700 00:27:50,480 --> 00:27:51,679 definitely the first option. 701 00:27:51,680 --> 00:27:53,959 They have to just go to the next edit. 702 00:27:53,960 --> 00:27:56,450 And this is going to post to 703 00:27:57,530 --> 00:27:59,749 skip and point. 704 00:27:59,750 --> 00:28:02,179 And then we copy this two more times, 705 00:28:02,180 --> 00:28:04,549 once for a patrol 706 00:28:04,550 --> 00:28:06,709 button and once for a rollback 707 00:28:06,710 --> 00:28:08,869 button, which go to roll back 708 00:28:08,870 --> 00:28:09,870 and 709 00:28:11,720 --> 00:28:14,179 patrol respectively as well. 710 00:28:14,180 --> 00:28:16,609 And also I forgot something, Ardeo. 711 00:28:16,610 --> 00:28:18,799 And so we don't want this patrol or 712 00:28:18,800 --> 00:28:21,289 rollback button to be enabled 713 00:28:21,290 --> 00:28:22,639 if the user doesn't actually have 714 00:28:22,640 --> 00:28:24,689 permissions to patrol or back or a 715 00:28:24,690 --> 00:28:26,989 specifically rollback is 716 00:28:26,990 --> 00:28:29,449 limited to a few hundred users, 717 00:28:29,450 --> 00:28:30,349 I think, on key data. 718 00:28:30,350 --> 00:28:32,599 So most users of our tool 719 00:28:32,600 --> 00:28:33,919 will probably not be allowed to roll 720 00:28:33,920 --> 00:28:35,209 back. So we don't want to show them this 721 00:28:35,210 --> 00:28:36,979 button, which would be misleading. 722 00:28:38,300 --> 00:28:40,129 So we will want to disable that. 723 00:28:40,130 --> 00:28:42,349 So for that, we need to make some more 724 00:28:42,350 --> 00:28:44,539 API calls to figure out if the user is 725 00:28:44,540 --> 00:28:46,369 actually allowed to patrol. 726 00:28:46,370 --> 00:28:49,069 So let's go back to the API sandbox 727 00:28:49,070 --> 00:28:51,380 and we still want to create something, 728 00:28:52,640 --> 00:28:54,949 but this time we want to query some meta 729 00:28:54,950 --> 00:28:57,229 information, specifically user info. 730 00:28:57,230 --> 00:28:58,579 Oops, that didn't work. 731 00:29:00,410 --> 00:29:02,539 And what we want of the user is the 732 00:29:02,540 --> 00:29:04,129 user's rights. 733 00:29:04,130 --> 00:29:06,679 And if I make this request, we see 734 00:29:06,680 --> 00:29:08,749 I have this rollback rights. 735 00:29:08,750 --> 00:29:09,829 It's even at the top of the list, 736 00:29:09,830 --> 00:29:10,879 apparently. 737 00:29:10,880 --> 00:29:13,069 And so we want to get this list of 738 00:29:13,070 --> 00:29:14,599 all the rights which the user has and 739 00:29:14,600 --> 00:29:15,709 check. 740 00:29:15,710 --> 00:29:17,209 Can they actually roll back? 741 00:29:17,210 --> 00:29:18,919 And if they can, then we just disable 742 00:29:18,920 --> 00:29:21,049 that button. So first 743 00:29:21,050 --> 00:29:23,030 we're going to add a method here, 744 00:29:25,790 --> 00:29:28,099 def user rights. 745 00:29:28,100 --> 00:29:30,499 So again, we get an authenticated 746 00:29:30,500 --> 00:29:32,959 session and then we return 747 00:29:32,960 --> 00:29:35,719 session gets 748 00:29:35,720 --> 00:29:37,879 action query and 749 00:29:37,880 --> 00:29:38,880 what was it, 750 00:29:41,420 --> 00:29:43,039 user info and 751 00:29:44,090 --> 00:29:46,249 UI properties rights. 752 00:29:47,630 --> 00:29:49,939 And from the response we want 753 00:29:49,940 --> 00:29:52,189 the query remember, 754 00:29:52,190 --> 00:29:53,359 and then the 755 00:29:54,650 --> 00:29:57,319 user info member and then the rights 756 00:29:57,320 --> 00:29:59,599 member. And that should return us this 757 00:29:59,600 --> 00:30:01,429 area of user rights. 758 00:30:01,430 --> 00:30:03,529 And we want to have a helper 759 00:30:03,530 --> 00:30:06,289 method just user can control, 760 00:30:06,290 --> 00:30:08,509 which just checks if 761 00:30:08,510 --> 00:30:10,699 petrol is in 762 00:30:10,700 --> 00:30:12,289 user rights. 763 00:30:12,290 --> 00:30:14,239 And copy that again for 764 00:30:15,920 --> 00:30:18,139 patrol instead of roll back 765 00:30:18,140 --> 00:30:19,789 instead of patrol. 766 00:30:19,790 --> 00:30:21,499 And these two should also be available in 767 00:30:21,500 --> 00:30:24,329 the templates templates 768 00:30:24,330 --> 00:30:25,639 lobal. We're going to see that in a 769 00:30:25,640 --> 00:30:26,749 second. 770 00:30:26,750 --> 00:30:27,739 What that does. 771 00:30:27,740 --> 00:30:29,789 And it's tested with debug method, which 772 00:30:29,790 --> 00:30:31,499 you already have here. So let's return 773 00:30:31,500 --> 00:30:34,009 the string of user rights. 774 00:30:35,070 --> 00:30:37,349 And a space ring of yours 775 00:30:37,350 --> 00:30:38,609 can patrol. 776 00:30:41,190 --> 00:30:43,409 Straying from user can 777 00:30:43,410 --> 00:30:44,410 roll back 778 00:30:45,600 --> 00:30:48,419 and go back to the trail, 779 00:30:48,420 --> 00:30:50,549 back to Dybbuk, 780 00:30:50,550 --> 00:30:52,439 and we see here's the gist of my rights 781 00:30:52,440 --> 00:30:54,389 and I can patrol and I can roll back. 782 00:30:54,390 --> 00:30:57,419 So those methods seem to work great. 783 00:30:57,420 --> 00:30:59,549 And now in here, we want 784 00:30:59,550 --> 00:31:01,079 to make something conditional. 785 00:31:01,080 --> 00:31:03,209 If not, the user can 786 00:31:03,210 --> 00:31:04,319 patrol. 787 00:31:04,320 --> 00:31:06,029 So this method is now available here 788 00:31:06,030 --> 00:31:08,219 because we've made it and we've declared 789 00:31:08,220 --> 00:31:09,629 it as a template. 790 00:31:09,630 --> 00:31:11,429 And if the user can patrol, then we just 791 00:31:11,430 --> 00:31:13,469 say this button is disabled 792 00:31:15,390 --> 00:31:17,669 and we do exactly the same thing 793 00:31:17,670 --> 00:31:19,799 down here with the 794 00:31:19,800 --> 00:31:21,929 rollback button. 795 00:31:21,930 --> 00:31:24,089 I accept the method is, of course, now 796 00:31:24,090 --> 00:31:26,579 user can roll back. 797 00:31:26,580 --> 00:31:29,339 And now if we reload 798 00:31:29,340 --> 00:31:31,319 this page again, we should see the three 799 00:31:31,320 --> 00:31:33,449 buttons and 800 00:31:33,450 --> 00:31:35,159 oh, they're still all three primary 801 00:31:35,160 --> 00:31:37,559 buttons. Let's fix that. This is 802 00:31:37,560 --> 00:31:39,719 a success button, I think, and this 803 00:31:39,720 --> 00:31:41,640 is a dangerous button. 804 00:31:43,350 --> 00:31:44,729 And now they all have three different 805 00:31:44,730 --> 00:31:45,659 colors, which is nice. 806 00:31:45,660 --> 00:31:47,819 And apparently there's something here. 807 00:31:47,820 --> 00:31:48,929 Looks like a typo. 808 00:31:48,930 --> 00:31:50,699 Yeah, they're OK. 809 00:31:50,700 --> 00:31:53,129 And the buttons aren't centered yet. 810 00:31:53,130 --> 00:31:54,629 Or we could change the design further. 811 00:31:54,630 --> 00:31:56,729 But for now, this is just enough for 812 00:31:56,730 --> 00:31:58,019 me at least. 813 00:31:58,020 --> 00:32:00,089 And now we need to actually 814 00:32:00,090 --> 00:32:02,249 deal with what happens if users do 815 00:32:02,250 --> 00:32:03,189 something with these buttons. 816 00:32:03,190 --> 00:32:05,309 So if I click Skip and it's going to 817 00:32:05,310 --> 00:32:07,319 go to Skip and the server is going to 818 00:32:07,320 --> 00:32:09,419 say, I don't know what that means, so 819 00:32:09,420 --> 00:32:11,099 we're going to implement that. 820 00:32:11,100 --> 00:32:13,199 And we start with Skip, which 821 00:32:13,200 --> 00:32:14,339 is fairly easy. 822 00:32:14,340 --> 00:32:16,439 So we go back where we already 823 00:32:16,440 --> 00:32:18,929 had this thing 824 00:32:18,930 --> 00:32:21,179 end point and now we're going to define 825 00:32:21,180 --> 00:32:22,180 Skip. 826 00:32:22,890 --> 00:32:24,689 And the route is 827 00:32:25,830 --> 00:32:28,079 if the ID is still there 828 00:32:28,080 --> 00:32:30,569 and then skip and this only 829 00:32:30,570 --> 00:32:32,789 accepts post requests, 830 00:32:32,790 --> 00:32:33,960 not get requests. 831 00:32:36,390 --> 00:32:38,459 And we're going to first 832 00:32:38,460 --> 00:32:39,779 of all, we should check if this is a 833 00:32:39,780 --> 00:32:40,739 valid request or not. 834 00:32:40,740 --> 00:32:42,540 So to protect ourselves against 835 00:32:44,280 --> 00:32:46,499 see our. So there's a method down here 836 00:32:46,500 --> 00:32:48,629 called submitted request valid. 837 00:32:48,630 --> 00:32:50,099 And we're just going to say, 838 00:32:51,390 --> 00:32:54,539 if that's not the case, then we return 839 00:32:54,540 --> 00:32:56,189 just the same bowstring, saying C is our 840 00:32:56,190 --> 00:32:58,529 F error and a generic 841 00:32:58,530 --> 00:33:00,899 blind error as the status 842 00:33:00,900 --> 00:33:03,539 code. And we can later perhaps 843 00:33:03,540 --> 00:33:04,979 turn that into a nicer page. 844 00:33:04,980 --> 00:33:06,029 But for now, that's good enough. 845 00:33:06,030 --> 00:33:07,979 And now we know it's a real request. 846 00:33:07,980 --> 00:33:10,919 So we should, um. 847 00:33:10,920 --> 00:33:12,659 So what we should actually do when the 848 00:33:12,660 --> 00:33:15,059 user says, I want to skip this edits, 849 00:33:15,060 --> 00:33:17,309 we want to load the next one, but if 850 00:33:17,310 --> 00:33:19,709 we just do that and nothing else, then 851 00:33:19,710 --> 00:33:21,899 we'll just load the same edits again 852 00:33:21,900 --> 00:33:24,389 and again, because that's still the most 853 00:33:24,390 --> 00:33:26,519 recent omeprazole edits. 854 00:33:26,520 --> 00:33:28,919 And so we need to start somewhere 855 00:33:28,920 --> 00:33:31,289 that the user has already 856 00:33:32,310 --> 00:33:33,510 wanted to skip this 857 00:33:34,860 --> 00:33:36,419 change of this idea. 858 00:33:36,420 --> 00:33:37,949 So we're going to store that in the user 859 00:33:37,950 --> 00:33:39,359 session. 860 00:33:39,360 --> 00:33:41,189 So we're going to get a list of skipped 861 00:33:41,190 --> 00:33:42,539 ideas from the 862 00:33:44,190 --> 00:33:47,299 session, which gives us 863 00:33:47,300 --> 00:33:49,289 under the key script IDs. 864 00:33:49,290 --> 00:33:51,119 And if it's not in the session yet, 865 00:33:51,120 --> 00:33:53,729 because we've never put it there, 866 00:33:53,730 --> 00:33:55,829 we fall back to an empty list and 867 00:33:55,830 --> 00:33:58,169 now we open to that list, 868 00:33:58,170 --> 00:33:59,549 the ID, which we have, 869 00:34:01,410 --> 00:34:02,669 and then we 870 00:34:03,930 --> 00:34:04,829 start again. 871 00:34:04,830 --> 00:34:07,079 Session skipped IDs 872 00:34:07,080 --> 00:34:08,999 is skipped. It is. 873 00:34:09,000 --> 00:34:10,170 And then we return 874 00:34:11,310 --> 00:34:13,859 actually the same thing as 875 00:34:13,860 --> 00:34:15,448 of here. 876 00:34:15,449 --> 00:34:17,399 No, not quite the same thing. 877 00:34:17,400 --> 00:34:19,799 And we return a first 878 00:34:19,800 --> 00:34:20,800 year, 879 00:34:22,620 --> 00:34:24,779 a redirect for 880 00:34:24,780 --> 00:34:27,149 the year, l for the 881 00:34:27,150 --> 00:34:29,399 any diff and point which is different up 882 00:34:29,400 --> 00:34:31,379 here. So you're L for always take the 883 00:34:31,380 --> 00:34:33,448 method name and that doesn't need any 884 00:34:33,449 --> 00:34:35,099 parameters. 885 00:34:35,100 --> 00:34:37,319 So let's 886 00:34:37,320 --> 00:34:39,749 hope that this works. 887 00:34:39,750 --> 00:34:41,789 Let's just reload this. 888 00:34:41,790 --> 00:34:42,869 Oops. 889 00:34:42,870 --> 00:34:44,459 No I think I just need to reload. 890 00:34:44,460 --> 00:34:45,629 That's, that happens. 891 00:34:45,630 --> 00:34:48,029 I think if it's partially loaded 892 00:34:48,030 --> 00:34:50,369 I have a secure kookiest object 893 00:34:50,370 --> 00:34:51,370 is not callable. 894 00:34:53,699 --> 00:34:55,769 Oh right. OK, so we 895 00:34:55,770 --> 00:34:57,149 can actually try out this in browser 896 00:34:57,150 --> 00:34:58,469 debugger which you get which is really 897 00:34:58,470 --> 00:35:00,959 convenient if you use flask. 898 00:35:00,960 --> 00:35:03,269 So we just need to pick out the pin 899 00:35:03,270 --> 00:35:05,009 from the output of the server process. 900 00:35:05,010 --> 00:35:07,199 It's right here and then 901 00:35:07,200 --> 00:35:08,200 we can actually 902 00:35:09,300 --> 00:35:11,639 try out to run some code against this 903 00:35:11,640 --> 00:35:13,949 in our 904 00:35:13,950 --> 00:35:15,120 browser. So 905 00:35:16,560 --> 00:35:18,659 I could say, 906 00:35:18,660 --> 00:35:20,759 um, what is the idea of this request, 907 00:35:20,760 --> 00:35:21,689 for example? 908 00:35:21,690 --> 00:35:23,819 Um, so 909 00:35:23,820 --> 00:35:25,049 that's really convenient. But in this 910 00:35:25,050 --> 00:35:26,579 case, we don't really know what this 911 00:35:26,580 --> 00:35:27,989 should not be for last session. 912 00:35:27,990 --> 00:35:30,090 This should be for last session. 913 00:35:31,110 --> 00:35:32,129 DOT gets. 914 00:35:32,130 --> 00:35:33,300 So let's reload. 915 00:35:36,020 --> 00:35:38,089 And now it seems to be working OK? 916 00:35:38,090 --> 00:35:41,269 We're now at this edit and 917 00:35:41,270 --> 00:35:42,860 let's skip this 918 00:35:43,910 --> 00:35:44,910 and. 919 00:35:46,850 --> 00:35:48,539 I'm not sure if this is the same or 920 00:35:48,540 --> 00:35:51,119 different one, it ends in age eight 921 00:35:51,120 --> 00:35:53,489 and oh, OK, 922 00:35:53,490 --> 00:35:55,889 no, we've sort of right now we're just 923 00:35:55,890 --> 00:35:57,779 adding to this list of script ideas again 924 00:35:57,780 --> 00:35:59,609 and again, but we're not using it. 925 00:35:59,610 --> 00:36:01,619 So up here, in the end, if we shouldn't 926 00:36:01,620 --> 00:36:03,239 just take the first uncontrolled change, 927 00:36:03,240 --> 00:36:04,240 instead, we should 928 00:36:05,640 --> 00:36:07,649 iterate over them in uncontrolled 929 00:36:07,650 --> 00:36:09,419 changes. 930 00:36:09,420 --> 00:36:11,579 If so, 931 00:36:11,580 --> 00:36:13,019 we get these script ideas from the 932 00:36:13,020 --> 00:36:15,050 session again, just like down here. 933 00:36:17,040 --> 00:36:19,169 And if the idea is 934 00:36:19,170 --> 00:36:21,449 in the script ideas, then we 935 00:36:21,450 --> 00:36:23,309 continue with the next idea. 936 00:36:23,310 --> 00:36:25,769 Otherwise we 937 00:36:25,770 --> 00:36:27,839 return this redirect. 938 00:36:27,840 --> 00:36:29,579 So now we go through the recent changes 939 00:36:29,580 --> 00:36:31,259 until we find one that we don't want to 940 00:36:31,260 --> 00:36:33,329 skip yet and we can optimize this 941 00:36:33,330 --> 00:36:34,330 in the future. Like 942 00:36:35,640 --> 00:36:37,919 right now, we're never, ever removing 943 00:36:37,920 --> 00:36:39,089 any ideas from script ideas. 944 00:36:39,090 --> 00:36:40,529 So the list will just grow to infinity. 945 00:36:40,530 --> 00:36:43,199 But we can take care of that later. 946 00:36:43,200 --> 00:36:45,479 But let's try to skip this now and 947 00:36:45,480 --> 00:36:47,939 now. We should see a different edit 948 00:36:47,940 --> 00:36:50,039 and try it again. 949 00:36:50,040 --> 00:36:52,259 We see again a different 950 00:36:52,260 --> 00:36:53,949 one. Yeah. 951 00:36:53,950 --> 00:36:56,639 OK, so that's SERP taken care of 952 00:36:56,640 --> 00:36:58,989 and next would be the patrol button. 953 00:37:00,150 --> 00:37:01,739 So if the user 954 00:37:02,760 --> 00:37:03,989 wants to 955 00:37:05,790 --> 00:37:07,979 patrol and edit, that's going 956 00:37:07,980 --> 00:37:09,600 to be almost the same branch. 957 00:37:10,710 --> 00:37:13,559 If I'd 958 00:37:13,560 --> 00:37:15,899 just patrol instead of skip, it's still 959 00:37:15,900 --> 00:37:18,689 just for post requests. 960 00:37:18,690 --> 00:37:20,849 And we also need to check if the request 961 00:37:20,850 --> 00:37:22,739 is actually valid and otherwise return an 962 00:37:22,740 --> 00:37:23,969 error. 963 00:37:23,970 --> 00:37:26,129 And now we need to make an API 964 00:37:26,130 --> 00:37:28,889 request to the meta wiki API. 965 00:37:28,890 --> 00:37:31,049 So let's go again to the trusty 966 00:37:31,050 --> 00:37:32,459 API sandbox. 967 00:37:32,460 --> 00:37:34,109 And this time we don't want to get a list 968 00:37:34,110 --> 00:37:36,629 of anything. We want to 969 00:37:36,630 --> 00:37:38,459 patrol the change. So let's check if 970 00:37:38,460 --> 00:37:40,679 there is just an action called 971 00:37:40,680 --> 00:37:42,869 patrol. And in fact there is, 972 00:37:42,870 --> 00:37:44,609 which is very nice. 973 00:37:44,610 --> 00:37:46,769 And this action just needs 974 00:37:46,770 --> 00:37:49,379 the revision idea, which we have 975 00:37:49,380 --> 00:37:51,329 and a token. 976 00:37:51,330 --> 00:37:53,399 So we're going to need to 977 00:37:53,400 --> 00:37:55,349 supply this token. So first, we need an 978 00:37:55,350 --> 00:37:57,479 API request, so 979 00:37:57,480 --> 00:37:59,849 we need the session authenticated 980 00:37:59,850 --> 00:38:01,919 session and we first need to make 981 00:38:01,920 --> 00:38:03,899 a request to get this token for the media 982 00:38:03,900 --> 00:38:06,209 wiki API. So 983 00:38:06,210 --> 00:38:08,939 session gets it says 984 00:38:08,940 --> 00:38:10,959 action query meter equals tokens. 985 00:38:10,960 --> 00:38:12,719 Let's go back to the sandbox 986 00:38:14,820 --> 00:38:16,529 because we don't actually need a standard 987 00:38:16,530 --> 00:38:18,659 token. We need a special 988 00:38:18,660 --> 00:38:20,549 patrol token. 989 00:38:20,550 --> 00:38:23,040 So the request we need is action query. 990 00:38:26,110 --> 00:38:27,969 Um, yeah, 991 00:38:29,590 --> 00:38:31,119 Mr equals tokens, 992 00:38:33,550 --> 00:38:35,919 and the type is 993 00:38:35,920 --> 00:38:38,049 we want a patrol token and then 994 00:38:38,050 --> 00:38:40,119 in the response we want Creevey tokens, 995 00:38:40,120 --> 00:38:41,120 patrol objects. 996 00:38:44,540 --> 00:38:46,429 Patrol talking, sorry. 997 00:38:46,430 --> 00:38:48,889 So there we should have a token, and 998 00:38:48,890 --> 00:38:50,449 now that we have that, we will be able to 999 00:38:50,450 --> 00:38:52,759 insert that here and in the 1000 00:38:52,760 --> 00:38:54,019 sandbox. We can just fill it 1001 00:38:54,020 --> 00:38:56,989 automatically. But to us, that's 1002 00:38:56,990 --> 00:38:59,149 in the tool we need to do it ourselves. 1003 00:38:59,150 --> 00:39:01,639 And now we can just 1004 00:39:01,640 --> 00:39:03,019 so we don't want to make this request 1005 00:39:03,020 --> 00:39:04,099 here right now because I haven't filled 1006 00:39:04,100 --> 00:39:07,309 this in. But basically, we will need 1007 00:39:07,310 --> 00:39:09,399 to post to the session with action 1008 00:39:09,400 --> 00:39:11,539 being patrol and the 1009 00:39:11,540 --> 00:39:13,609 ref RFID is 1010 00:39:13,610 --> 00:39:15,889 the ID we have and 1011 00:39:15,890 --> 00:39:18,919 that token is the token we have. 1012 00:39:18,920 --> 00:39:21,319 And if that was successful, 1013 00:39:21,320 --> 00:39:22,899 we just want to redirect to the next 1014 00:39:22,900 --> 00:39:25,399 step. So just like here, 1015 00:39:25,400 --> 00:39:26,570 we do the same thing. 1016 00:39:27,860 --> 00:39:30,079 So let's go back to the speed 1017 00:39:30,080 --> 00:39:31,429 patrolling tool. 1018 00:39:31,430 --> 00:39:33,619 Um, and let's 1019 00:39:33,620 --> 00:39:35,629 just get a new dif oops. 1020 00:39:35,630 --> 00:39:36,949 Uh huh. That's uh. 1021 00:39:36,950 --> 00:39:38,509 That should be method's equals post. 1022 00:39:38,510 --> 00:39:39,510 Sorry. 1023 00:39:42,070 --> 00:39:44,619 Um, let me go change 1024 00:39:44,620 --> 00:39:46,659 claim website username, so it used to be 1025 00:39:46,660 --> 00:39:48,879 just ATSE and now it's at 1026 00:39:48,880 --> 00:39:49,849 Backup's. 1027 00:39:49,850 --> 00:39:52,869 So, um, 1028 00:39:52,870 --> 00:39:54,009 I don't want to patrol that. 1029 00:39:54,010 --> 00:39:54,969 I want to skip that. 1030 00:39:54,970 --> 00:39:57,039 Um, let's hope I can find an edit that I 1031 00:39:57,040 --> 00:39:58,040 want to patrol quickly. 1032 00:39:59,110 --> 00:40:02,089 So the Spanish description was changed. 1033 00:40:02,090 --> 00:40:03,459 No, no, no. 1034 00:40:03,460 --> 00:40:04,800 I don't want to patrol that either. 1035 00:40:09,550 --> 00:40:11,709 No, come on, give me some 1036 00:40:11,710 --> 00:40:12,710 good at it, 1037 00:40:14,000 --> 00:40:15,429 OK, this sounds great. 1038 00:40:15,430 --> 00:40:17,139 So here are links to German Wikipedia 1039 00:40:17,140 --> 00:40:19,689 edits for Davnie 1040 00:40:19,690 --> 00:40:21,519 or Stephanie Carr. I'm not sure. 1041 00:40:21,520 --> 00:40:22,959 And this is supposed to a Wikimedia 1042 00:40:22,960 --> 00:40:25,059 disambiguation page and this is also 1043 00:40:25,060 --> 00:40:27,009 a disintegration page. 1044 00:40:27,010 --> 00:40:28,959 So I think this is a good edit. 1045 00:40:28,960 --> 00:40:30,069 This makes sense. 1046 00:40:30,070 --> 00:40:32,349 So I'm going to put 1047 00:40:32,350 --> 00:40:34,719 actually let's just quickly 1048 00:40:34,720 --> 00:40:36,510 open this diff here. 1049 00:40:38,530 --> 00:40:40,629 So currently I could still market this 1050 00:40:40,630 --> 00:40:42,069 patrol here because it hasn't been marked 1051 00:40:42,070 --> 00:40:43,209 as patrolled yet. 1052 00:40:43,210 --> 00:40:45,460 And now we try to patrol it from here 1053 00:40:47,110 --> 00:40:48,969 and there's no error. 1054 00:40:48,970 --> 00:40:51,069 And if we reload the page here, 1055 00:40:51,070 --> 00:40:52,389 then this link is gone because we've 1056 00:40:52,390 --> 00:40:54,609 already patrolled. So that works 1057 00:40:54,610 --> 00:40:55,610 as well. 1058 00:40:56,200 --> 00:40:58,929 So the missing step would be 1059 00:40:58,930 --> 00:40:59,859 rollback. 1060 00:40:59,860 --> 00:41:02,019 Unfortunately, there's actually or 1061 00:41:02,020 --> 00:41:03,939 there seems to be a bug in media wiki. 1062 00:41:03,940 --> 00:41:05,709 I couldn't figure out how to make a 1063 00:41:05,710 --> 00:41:07,779 rollback via the API work. 1064 00:41:07,780 --> 00:41:10,059 So we're just going to skip that for now 1065 00:41:10,060 --> 00:41:12,309 and have a few more minutes instead, 1066 00:41:13,600 --> 00:41:15,729 because now the first version of the tool 1067 00:41:15,730 --> 00:41:17,829 is more or less done. 1068 00:41:17,830 --> 00:41:19,989 All we need to do now is to patrol this 1069 00:41:19,990 --> 00:41:21,849 on we a tool forge. 1070 00:41:21,850 --> 00:41:23,799 So we already created this tool account 1071 00:41:23,800 --> 00:41:26,139 and we should be able to 1072 00:41:26,140 --> 00:41:28,899 go into Tool Forge 1073 00:41:28,900 --> 00:41:31,119 and oops, I need to enter 1074 00:41:31,120 --> 00:41:32,109 my HQ. 1075 00:41:32,110 --> 00:41:34,149 I hope no one can get the password from 1076 00:41:34,150 --> 00:41:36,219 the keystroke sounds that we 1077 00:41:36,220 --> 00:41:38,619 are and we want to become this 1078 00:41:38,620 --> 00:41:39,620 speed 1079 00:41:41,050 --> 00:41:43,259 patrolling account 1080 00:41:43,260 --> 00:41:44,889 that doesn't look good. 1081 00:41:44,890 --> 00:41:47,019 I'm not a member of the group. 1082 00:41:47,020 --> 00:41:48,020 I'm 1083 00:41:49,660 --> 00:41:50,889 do not create the tool 1084 00:41:52,150 --> 00:41:53,500 speed minus patrolling. 1085 00:41:56,320 --> 00:41:58,559 Uh, does 1086 00:41:58,560 --> 00:42:00,630 it really take this long to propagate? 1087 00:42:02,640 --> 00:42:03,640 Uh, 1088 00:42:07,800 --> 00:42:10,229 so I'm in 1089 00:42:10,230 --> 00:42:12,619 some tools, but not. 1090 00:42:12,620 --> 00:42:13,620 Oh. 1091 00:42:15,420 --> 00:42:16,409 Oh dear. 1092 00:42:16,410 --> 00:42:18,359 Uh huh, uh huh. 1093 00:42:18,360 --> 00:42:20,639 I created this, uh, using my volunteer 1094 00:42:20,640 --> 00:42:22,229 account, but there's actually my work 1095 00:42:22,230 --> 00:42:24,329 laptop. So this I'm logged in 1096 00:42:24,330 --> 00:42:26,909 here as my work account. 1097 00:42:26,910 --> 00:42:28,439 Oh, damn. 1098 00:42:29,560 --> 00:42:30,560 OK, 1099 00:42:33,430 --> 00:42:34,509 OK. 1100 00:42:34,510 --> 00:42:37,259 I think I can fix this. 1101 00:42:37,260 --> 00:42:40,319 Let's age into my computer at home 1102 00:42:40,320 --> 00:42:42,539 and uh, from 1103 00:42:42,540 --> 00:42:44,819 there we should be able to access 1104 00:42:44,820 --> 00:42:45,900 to forge 1105 00:42:48,030 --> 00:42:50,129 and then yes, I 1106 00:42:50,130 --> 00:42:52,529 need to enter the passphrase again 1107 00:42:52,530 --> 00:42:54,389 and please just ignore what my computers 1108 00:42:54,390 --> 00:42:56,459 are called. It's a silly scheme and here 1109 00:42:56,460 --> 00:42:59,039 I can become speed patrolling. 1110 00:42:59,040 --> 00:43:00,350 Yes. OK, 1111 00:43:02,250 --> 00:43:04,349 and so we need uh. 1112 00:43:04,350 --> 00:43:06,539 So we I think 1113 00:43:06,540 --> 00:43:07,919 there are some instructions for this on 1114 00:43:07,920 --> 00:43:09,599 the index page. Right. 1115 00:43:09,600 --> 00:43:10,889 So I don't need to remember this. 1116 00:43:10,890 --> 00:43:12,779 Yes. Deploy. 1117 00:43:12,780 --> 00:43:14,249 So we've done create a troll account when 1118 00:43:14,250 --> 00:43:16,259 we can get to forge, we are just going to 1119 00:43:16,260 --> 00:43:17,669 skip the source code repository step 1120 00:43:17,670 --> 00:43:19,889 because that takes even longer and 1121 00:43:19,890 --> 00:43:22,289 instead we're going to create 1122 00:43:22,290 --> 00:43:23,940 the base directory of the tool. 1123 00:43:24,960 --> 00:43:27,059 And now we need to 1124 00:43:27,060 --> 00:43:28,589 get the source code on here and we're 1125 00:43:28,590 --> 00:43:30,869 just going to copy all the files 1126 00:43:30,870 --> 00:43:33,539 and then I'll take care of it later. 1127 00:43:33,540 --> 00:43:34,860 So for now, we 1128 00:43:36,750 --> 00:43:39,399 just create a tar ball, creates 1129 00:43:39,400 --> 00:43:41,999 zipped for both of 1130 00:43:42,000 --> 00:43:44,159 us in the file, some speed 1131 00:43:44,160 --> 00:43:46,499 patrolling the target 1132 00:43:46,500 --> 00:43:48,779 sets of all 1133 00:43:48,780 --> 00:43:49,780 the files. Yeah. 1134 00:43:51,870 --> 00:43:54,029 Uh, are there 1135 00:43:54,030 --> 00:43:55,079 any hidden files? 1136 00:43:55,080 --> 00:43:57,510 No. OK, so I can just use this hopefully. 1137 00:43:59,220 --> 00:44:01,439 And now I can copy this speed 1138 00:44:01,440 --> 00:44:03,389 patrolling through my 1139 00:44:05,010 --> 00:44:08,219 computer at home and now from there 1140 00:44:08,220 --> 00:44:10,169 I can copy it 1141 00:44:11,310 --> 00:44:14,010 onto Tool Forge. 1142 00:44:16,470 --> 00:44:18,659 And now I actually need to close 1143 00:44:18,660 --> 00:44:20,729 this shell I think because it's so it's 1144 00:44:20,730 --> 00:44:22,919 now in my home directory of the look 1145 00:44:22,920 --> 00:44:25,079 of my user and I'm 1146 00:44:25,080 --> 00:44:27,209 going to copy speed petroleum charges 1147 00:44:27,210 --> 00:44:29,669 that into the home directory of tools 1148 00:44:29,670 --> 00:44:32,009 DOT what was it called 1149 00:44:32,010 --> 00:44:34,260 here. Speed patrolling 1150 00:44:36,180 --> 00:44:38,369 and now become that user 1151 00:44:38,370 --> 00:44:39,370 again. 1152 00:44:40,110 --> 00:44:42,029 And now we have the speed patrolling here 1153 00:44:42,030 --> 00:44:44,639 and we just want in 1154 00:44:46,350 --> 00:44:49,349 we in the python, we want to 1155 00:44:49,350 --> 00:44:51,599 create a source directory, go 1156 00:44:51,600 --> 00:44:55,319 there and extract, 1157 00:44:55,320 --> 00:44:56,320 um, 1158 00:44:58,380 --> 00:45:00,809 um, SP's 1159 00:45:00,810 --> 00:45:02,010 petroleum charges that 1160 00:45:03,630 --> 00:45:06,179 we go now. We have all the code here 1161 00:45:06,180 --> 00:45:08,369 instead of doing a Gitlow, 1162 00:45:08,370 --> 00:45:11,609 OK, and we need to 1163 00:45:11,610 --> 00:45:13,739 get a shell in 1164 00:45:13,740 --> 00:45:14,940 with the right Python version, 1165 00:45:16,230 --> 00:45:18,329 and then we need to set 1166 00:45:18,330 --> 00:45:20,399 up a virtual environment where 1167 00:45:20,400 --> 00:45:21,299 we're going to install all the 1168 00:45:21,300 --> 00:45:23,459 dependencies so that 1169 00:45:23,460 --> 00:45:25,589 we don't need to worry about which 1170 00:45:25,590 --> 00:45:27,509 version of whatever libraries installed 1171 00:45:27,510 --> 00:45:27,929 globally. 1172 00:45:27,930 --> 00:45:30,539 We just get our own environment and 1173 00:45:30,540 --> 00:45:31,540 we want to 1174 00:45:33,450 --> 00:45:34,860 copy this thing 1175 00:45:36,060 --> 00:45:37,060 and 1176 00:45:38,280 --> 00:45:41,039 upgrade PIP itself, apparently. 1177 00:45:41,040 --> 00:45:43,100 Let's hope that doesn't take too long. 1178 00:45:45,580 --> 00:45:46,509 OK. 1179 00:45:46,510 --> 00:45:48,819 And then we want to install all the 1180 00:45:48,820 --> 00:45:50,949 requirements which we have, so 1181 00:45:50,950 --> 00:45:53,079 Flask and the library to talk to the 1182 00:45:53,080 --> 00:45:55,209 media, API and 1183 00:45:55,210 --> 00:45:56,210 everything else, 1184 00:45:57,700 --> 00:46:00,069 and that might take a little 1185 00:46:00,070 --> 00:46:02,059 while. I hope not too long. 1186 00:46:02,060 --> 00:46:04,389 Yeah. So it's every library to 1187 00:46:04,390 --> 00:46:07,149 talk to all of and all kinds of things. 1188 00:46:07,150 --> 00:46:09,099 Downloading and stalling. 1189 00:46:09,100 --> 00:46:10,899 Looks like we're going to be done very 1190 00:46:10,900 --> 00:46:11,900 soon. 1191 00:46:15,390 --> 00:46:17,399 OK, now it's still has to install all of 1192 00:46:17,400 --> 00:46:18,419 them. 1193 00:46:18,420 --> 00:46:20,999 OK, now we're done and 1194 00:46:21,000 --> 00:46:22,590 we can exit this again. 1195 00:46:24,820 --> 00:46:26,969 Now all we need to do is start the 1196 00:46:26,970 --> 00:46:28,199 Web servers. 1197 00:46:28,200 --> 00:46:29,200 Oops. 1198 00:46:31,510 --> 00:46:33,669 And now we should be able to 1199 00:46:33,670 --> 00:46:36,069 go to school, 1200 00:46:36,070 --> 00:46:38,319 so we have let's start our speeds 1201 00:46:38,320 --> 00:46:40,719 minus puch, trolling 1202 00:46:41,860 --> 00:46:43,959 us stiff because the index page 1203 00:46:43,960 --> 00:46:46,479 is still the default thing. 1204 00:46:46,480 --> 00:46:48,939 But OK, 1205 00:46:48,940 --> 00:46:50,799 and usually it can take a few more 1206 00:46:50,800 --> 00:46:52,689 seconds after starting or restarting the 1207 00:46:52,690 --> 00:46:54,099 server until it works. So let's just 1208 00:46:54,100 --> 00:46:55,179 retry. 1209 00:46:55,180 --> 00:46:57,579 Uh, there's an internal server error. 1210 00:46:59,410 --> 00:47:00,729 Why is that? 1211 00:47:02,410 --> 00:47:03,429 Let's check the log. 1212 00:47:03,430 --> 00:47:04,539 So this is the part that I didn't 1213 00:47:04,540 --> 00:47:06,129 practice because you can only create the 1214 00:47:06,130 --> 00:47:07,509 ones. So of course not. 1215 00:47:07,510 --> 00:47:09,339 That's what doesn't work. 1216 00:47:09,340 --> 00:47:10,340 Um, 1217 00:47:11,710 --> 00:47:12,919 anything here? Uh 1218 00:47:14,020 --> 00:47:16,269 oh. Of course, I didn't log in. 1219 00:47:16,270 --> 00:47:18,429 So it's unable to 1220 00:47:19,780 --> 00:47:21,639 get a list of recent changes. 1221 00:47:21,640 --> 00:47:23,349 And ideally, there should be better error 1222 00:47:23,350 --> 00:47:25,089 handling for this. But I was just too 1223 00:47:25,090 --> 00:47:27,369 lazy. So that's log in. 1224 00:47:28,480 --> 00:47:30,069 And this time we will not have to mess 1225 00:47:30,070 --> 00:47:31,419 with the callback there. 1226 00:47:31,420 --> 00:47:33,639 We are locked in and now 1227 00:47:33,640 --> 00:47:36,069 we can go to diff and 1228 00:47:36,070 --> 00:47:37,089 here we are. 1229 00:47:37,090 --> 00:47:39,379 And that's a tool running on. 1230 00:47:39,380 --> 00:47:41,589 We can be a tool for in apparently 1231 00:47:41,590 --> 00:47:43,420 around forty five minutes or a. 1232 00:47:48,680 --> 00:47:50,899 Which means we actually have at least 1233 00:47:50,900 --> 00:47:53,059 15 minutes for questions, which I did 1234 00:47:53,060 --> 00:47:55,219 not expect at all, so I probably went 1235 00:47:55,220 --> 00:47:56,189 way too fast here. 1236 00:47:56,190 --> 00:47:58,219 I'm sorry. I was not sure if this would 1237 00:47:58,220 --> 00:48:00,499 work, but do you have 1238 00:48:00,500 --> 00:48:01,500 any questions? 1239 00:48:06,150 --> 00:48:07,150 Come on. 1240 00:48:07,770 --> 00:48:09,989 And otherwise, as I mentioned, 1241 00:48:09,990 --> 00:48:11,699 if you want to do any of this yourself, 1242 00:48:11,700 --> 00:48:13,349 this was not a complete introduction to 1243 00:48:13,350 --> 00:48:14,549 how to build a tool. 1244 00:48:14,550 --> 00:48:16,829 But if you need help with any step, 1245 00:48:16,830 --> 00:48:19,109 then I will be in the kitchen area 1246 00:48:19,110 --> 00:48:21,179 for the next, I think, hour or 1247 00:48:21,180 --> 00:48:23,279 so. And there we can discuss 1248 00:48:23,280 --> 00:48:25,509 anything you want if there 1249 00:48:25,510 --> 00:48:27,560 really aren't any questions right now, 1250 00:48:29,580 --> 00:48:30,899 OK? 1251 00:48:30,900 --> 00:48:32,609 Was that a question? 1252 00:48:32,610 --> 00:48:33,610 No. OK. 1253 00:48:35,890 --> 00:48:38,139 Then I guess we're done already. 1254 00:48:38,140 --> 00:48:39,140 Thank you very much.