1515:
1525:
This script requires R to be installed. The best way to use this script is to put it in a text file located in the directory of your R workspace. For example, if you named your file
30:
script for visualizing the byte sizes of
Knowledge (XXG) pages over time. I originally wrote this for an assignment for my
1563:
36:
class, but I have decided to release it to the public. Other
Wikipedians are welcome to improve it as they see fit.
27:
1514:
1557:
17:
1519:
32:
724:'<span class="history-size">(\\(+\\))</span>'
490:# complete list available at http://meta.wikimedia.org/List_of_Wikipedias
1513:
1543:
1542:
Certain characters are not processed correctly. For example, "
8:
301:# create "Revisions" text field
100:'Knowledge (XXG) revision sizes'
751:'.wikipedia.org/search/?title='
1529:, you can run the script by entering
7:
178:# create "Page" text field
886:'This page does not exist!'
1270:'Revision size of \"'
24:
49:# last update: November 19, 2009
1:
847:'no revision history'
793:'&action=history'
1580:
1518:The last 500 revisions of
1282:'\" (bytes)'
502:# get page revision sizes
52:# load the Tcl/Tk library
1252:'Revision index'
46:# current version: 1.2.0
43:
1522:
697:'match.length'
127:# create Tcl variables
1564:Knowledge (XXG) tools
1546:" must be entered as
1531:source('wpgraph.txt')
1517:
769:'&limit='
1480:# pack bottom frame
634:# fix space parsing
424:# pack GUI elements
346:'Revisions'
106:# create main frame
1533:in the R console.
1523:
739:'http://'
67:# create main GUI
1571:
1505:
1502:
1501:'bottom'
1499:
1496:
1493:
1490:
1487:
1484:
1481:
1478:
1475:
1472:
1469:
1466:
1463:
1460:
1457:
1454:
1451:
1448:
1445:
1442:
1439:
1436:
1433:
1430:
1427:
1424:
1421:
1418:
1415:
1412:
1409:
1406:
1403:
1400:
1397:
1394:
1391:
1388:
1385:
1382:
1379:
1376:
1373:
1370:
1367:
1364:
1361:
1358:
1355:
1352:
1351:# create buttons
1349:
1346:
1343:
1340:
1337:
1334:
1331:
1328:
1325:
1322:
1319:
1316:
1313:
1310:
1307:
1304:
1301:
1298:
1295:
1292:
1289:
1286:
1283:
1280:
1277:
1274:
1271:
1268:
1265:
1262:
1259:
1256:
1253:
1250:
1247:
1244:
1241:
1238:
1235:
1232:
1229:
1226:
1223:
1220:
1217:
1214:
1211:
1208:
1205:
1202:
1199:
1196:
1193:
1190:
1187:
1184:
1181:
1178:
1175:
1172:
1169:
1166:
1163:
1160:
1157:
1154:
1151:
1148:
1145:
1142:
1139:
1136:
1133:
1130:
1127:
1124:
1121:
1118:
1115:
1112:
1109:
1106:
1103:
1100:
1097:
1094:
1091:
1088:
1085:
1082:
1079:
1076:
1073:
1070:
1067:
1064:
1061:
1058:
1055:
1052:
1049:
1046:
1043:
1040:
1037:
1034:
1031:
1028:
1025:
1022:
1019:
1016:
1013:
1010:
1007:
1004:
1001:
998:
995:
992:
989:
986:
983:
980:
977:
974:
971:
968:
965:
962:
959:
956:
953:
950:
947:
944:
941:
938:
935:
932:
929:
926:
923:
920:
917:
914:
911:
908:
905:
902:
899:
896:
893:
890:
887:
884:
881:
878:
875:
872:
869:
866:
863:
860:
857:
854:
851:
848:
845:
842:
839:
836:
833:
830:
827:
824:
821:
818:
815:
812:
809:
806:
803:
800:
797:
794:
791:
788:
785:
782:
779:
776:
773:
770:
767:
764:
761:
758:
755:
752:
749:
746:
743:
740:
737:
734:
731:
728:
725:
722:
719:
716:
713:
710:
707:
704:
701:
698:
695:
692:
689:
686:
683:
680:
677:
674:
671:
668:
665:
662:
659:
656:
653:
650:
647:
644:
641:
638:
635:
632:
629:
626:
623:
620:
617:
614:
611:
608:
605:
602:
599:
596:
593:
590:
587:
584:
581:
578:
575:
572:
569:
566:
563:
560:
557:
554:
551:
548:
545:
542:
539:
536:
533:
530:
527:
524:
521:
518:
515:
512:
509:
506:
503:
500:
497:
494:
491:
488:
485:
482:
479:
476:
473:
470:
467:
464:
461:
458:
455:
452:
449:
446:
443:
440:
437:
434:
431:
428:
425:
422:
419:
416:
413:
410:
407:
404:
401:
398:
395:
392:
389:
386:
383:
380:
377:
374:
371:
368:
365:
362:
359:
356:
353:
350:
347:
344:
341:
338:
335:
332:
329:
326:
323:
320:
317:
314:
311:
308:
305:
302:
299:
296:
293:
290:
287:
284:
281:
278:
275:
272:
269:
266:
263:
260:
257:
254:
251:
248:
245:
242:
239:
236:
233:
230:
227:
224:
221:
218:
215:
212:
209:
206:
203:
200:
197:
194:
191:
188:
185:
182:
179:
176:
173:
170:
167:
164:
161:
158:
155:
152:
149:
146:
143:
140:
137:
134:
131:
128:
125:
122:
119:
116:
113:
110:
107:
104:
101:
98:
95:
92:
89:
86:
83:
80:
77:
74:
71:
68:
65:
62:
59:
56:
53:
50:
47:
35:
1579:
1578:
1574:
1573:
1572:
1570:
1569:
1568:
1554:
1553:
1539:
1512:
1507:
1506:
1503:
1500:
1497:
1494:
1491:
1488:
1485:
1482:
1479:
1476:
1474:'right'
1473:
1470:
1467:
1464:
1461:
1458:
1455:
1452:
1449:
1446:
1443:
1440:
1437:
1434:
1431:
1428:
1425:
1422:
1419:
1416:
1413:
1410:
1407:
1404:
1401:
1398:
1395:
1392:
1389:
1386:
1383:
1380:
1377:
1374:
1371:
1368:
1365:
1362:
1359:
1356:
1353:
1350:
1347:
1344:
1341:
1338:
1335:
1332:
1329:
1326:
1323:
1320:
1317:
1314:
1311:
1308:
1305:
1302:
1299:
1296:
1293:
1290:
1287:
1284:
1281:
1278:
1275:
1272:
1269:
1266:
1263:
1260:
1257:
1254:
1251:
1248:
1245:
1242:
1239:
1236:
1233:
1230:
1227:
1224:
1221:
1218:
1215:
1212:
1209:
1206:
1203:
1200:
1197:
1194:
1191:
1188:
1185:
1182:
1179:
1176:
1173:
1170:
1167:
1164:
1161:
1158:
1155:
1152:
1149:
1146:
1143:
1140:
1137:
1134:
1131:
1128:
1125:
1122:
1120:'empty'
1119:
1116:
1113:
1110:
1107:
1104:
1101:
1098:
1095:
1092:
1089:
1086:
1083:
1080:
1077:
1074:
1071:
1068:
1065:
1062:
1059:
1056:
1053:
1050:
1047:
1044:
1041:
1038:
1035:
1032:
1029:
1026:
1023:
1020:
1017:
1014:
1011:
1008:
1005:
1002:
999:
996:
993:
990:
987:
984:
981:
978:
975:
972:
969:
966:
963:
960:
957:
954:
951:
948:
945:
942:
939:
936:
933:
930:
927:
924:
921:
918:
915:
912:
909:
906:
903:
900:
897:
894:
891:
888:
885:
882:
879:
876:
874:'Error'
873:
870:
867:
864:
861:
858:
855:
852:
849:
846:
843:
840:
837:
834:
831:
828:
825:
822:
819:
816:
813:
810:
807:
804:
801:
798:
795:
792:
789:
786:
783:
780:
777:
774:
771:
768:
765:
762:
759:
756:
753:
750:
747:
744:
741:
738:
735:
732:
729:
726:
723:
720:
717:
714:
711:
708:
705:
702:
699:
696:
693:
690:
687:
684:
681:
678:
675:
672:
669:
666:
663:
660:
657:
654:
651:
648:
645:
642:
639:
636:
633:
630:
627:
624:
621:
618:
615:
612:
609:
606:
603:
600:
597:
594:
591:
588:
585:
582:
579:
576:
573:
570:
567:
564:
561:
558:
555:
552:
549:
546:
543:
540:
537:
534:
531:
528:
525:
522:
519:
516:
513:
510:
507:
504:
501:
498:
495:
492:
489:
487:# language code
486:
483:
480:
477:
474:
471:
468:
465:
462:
459:
456:
453:
450:
447:
444:
441:
438:
435:
432:
429:
426:
423:
420:
417:
414:
411:
408:
405:
402:
399:
396:
393:
390:
387:
384:
381:
378:
375:
372:
369:
366:
363:
360:
357:
354:
351:
348:
345:
342:
339:
336:
333:
330:
327:
324:
321:
318:
315:
312:
309:
306:
303:
300:
297:
294:
291:
288:
285:
282:
279:
276:
273:
270:
267:
264:
261:
258:
255:
252:
249:
246:
243:
240:
237:
234:
231:
228:
225:
222:
219:
216:
213:
210:
207:
204:
201:
198:
195:
192:
189:
186:
183:
180:
177:
174:
171:
168:
165:
162:
159:
156:
153:
150:
147:
144:
141:
138:
135:
132:
129:
126:
123:
120:
117:
114:
111:
108:
105:
102:
99:
96:
93:
90:
87:
84:
81:
78:
75:
72:
69:
66:
63:
60:
57:
54:
51:
48:
45:
42:
31:
22:
21:
20:
12:
11:
5:
1577:
1575:
1567:
1566:
1556:
1555:
1552:
1551:
1549:
1538:
1535:
1532:
1528:
1511:
1508:
1450:'Quit'
1420:'left'
1318:# quit program
418:'left'
358:'left'
295:'left'
235:'left'
223:'Page'
44:
41:
38:
23:
15:
14:
13:
10:
9:
6:
4:
3:
2:
1576:
1565:
1562:
1561:
1559:
1547:
1545:
1541:
1540:
1536:
1534:
1530:
1526:
1521:
1516:
1509:
1396:'Run'
937:'\\1'
469:'top'
445:'top'
39:
37:
34:
29:
19:
1524:
1240:revisiondata
1228:revisiondata
1216:revisiondata
1192:revisiondata
1174:revisiondata
1168:revisiondata
1144:revisiondata
1129:revisiondata
1114:revisiondata
1099:revisiondata
1069:revisiondata
1045:revisiondata
1039:revisiondata
1021:revisiondata
913:revisiondata
898:'ok'
862:tkmessageBox
499:'en'
394:textvariable
271:textvariable
25:
1537:Limitations
1527:wpgraph.txt
1306:'l'
1135:'0'
823:historylink
727:historylink
622:'_'
616:' '
40:Source code
26:This is an
18:User:Ixfd64
1294:''
1162:''
1156:''
1063:''
1057:''
805:''
172:''
148:''
76:tktoplevel
1520:Milky Way
1339:tkdestroy
1033:character
817:readLines
787:revisions
781:character
661:substring
574:character
550:revisions
526:revisions
400:revisions
130:revisions
1558:Category
1432:tkbutton
1378:tkbutton
1327:function
961:gregexpr
643:function
580:tclvalue
544:tclvalue
511:function
33:Stat 133
1462:destroy
1456:command
1408:getpage
1402:command
1360:tkframe
1321:destroy
1186:numeric
979:history
955:history
880:message
853:history
811:history
538:numeric
505:getpage
370:tkentry
328:tklabel
310:tkframe
247:tkentry
205:tklabel
187:tkframe
115:tkframe
55:require
1483:tkpack
1426:tkpack
1372:tkpack
1198:ignore
1093:length
1003:ignore
985:ignore
943:mapply
475:tkpack
451:tkpack
427:tkpack
364:tkpack
322:tkpack
241:tkpack
199:tkpack
166:tclVar
142:tclVar
1548:1%2B1
1510:Usage
1264:paste
868:title
733:paste
382:width
259:width
88:title
61:tcltk
16:<
1495:side
1489:bfrm
1468:side
1444:text
1438:bfrm
1414:side
1390:text
1384:bfrm
1366:base
1354:bfrm
1345:base
1300:type
1276:page
1258:ylab
1246:xlab
1234:plot
1210:TRUE
1150:gsub
1051:gsub
1015:TRUE
1009:case
997:TRUE
991:case
967:byte
925:byte
919:gsub
907:else
892:type
841:grep
757:page
745:lang
712:byte
685:attr
628:page
610:gsub
598:page
586:page
562:page
493:lang
481:nfrm
463:side
439:side
412:side
352:side
340:text
316:nfrm
289:side
277:page
229:side
217:text
193:nfrm
154:page
121:base
109:nfrm
94:base
82:tkwm
70:base
1544:1+1
1333:...
1288:sep
1222:rev
1075:for
1000:)),
973:pat
931:pat
856:)))
835:any
799:sep
763:loc
718:pat
604:loc
592:tcl
556:tcl
517:...
406:tcl
283:tcl
160:tcl
136:tcl
1560::
1465:),
1411:),
1297:),
1204:na
1180:as
1117:==
1108:if
1102:))
1084:in
1027:as
949:ge
829:if
790:),
775:as
637:ge
595:))
568:as
559:))
532:as
457:f2
433:f1
409:),
376:f2
349:),
334:f2
304:f2
286:),
265:25
253:f1
226:),
211:f1
181:f1
79:()
1550:.
1504:)
1498:=
1492:,
1486:(
1477:)
1471:=
1459:=
1453:,
1447:=
1441:,
1435:(
1429:(
1423:)
1417:=
1405:=
1399:,
1393:=
1387:,
1381:(
1375:(
1369:)
1363:(
1357:=
1348:)
1342:(
1336:)
1330:(
1324:=
1315:}
1312:}
1309:)
1303:=
1291:=
1285:,
1279:,
1273:,
1267:(
1261:=
1255:,
1249:=
1243:,
1237:(
1231:)
1225:(
1219:=
1213:)
1207:=
1201:.
1195:,
1189:(
1183:.
1177:=
1171:)
1165:,
1159:,
1153:(
1147:=
1141:}
1138:}
1132:=
1126:{
1123:)
1111:(
1105:{
1096:(
1090::
1087:1
1081:a
1078:(
1072:)
1066:,
1060:,
1054:(
1048:=
1042:)
1036:(
1030:.
1024:=
1018:)
1012:=
1006:.
994:=
988:.
982:,
976:,
970:.
964:(
958:,
952:,
946:(
940:,
934:,
928:.
922:(
916:=
910:{
904:}
901:)
895:=
889:,
883:=
877:,
871:=
865:(
859:{
850:,
844:(
838:(
832:(
826:)
820:(
814:=
808:)
802:=
796:,
784:(
778:.
772:,
766:,
760:.
754:,
748:,
742:,
736:(
730:=
721:=
715:.
709:)
706:1
703:-
700:)
694:,
691:g
688:(
682:+
679:g
676:,
673:g
670:,
667:s
664:(
658:)
655:g
652:,
649:s
646:(
640:=
631:)
625:,
619:,
613:(
607:=
601:.
589:.
583:(
577:(
571:.
565:=
553:.
547:(
541:(
535:.
529:=
523:{
520:)
514:(
508:=
496:=
484:)
478:(
472:)
466:=
460:,
454:(
448:)
442:=
436:,
430:(
421:)
415:=
403:.
397:=
391:,
388:8
385:=
379:,
373:(
367:(
361:)
355:=
343:=
337:,
331:(
325:(
319:)
313:(
307:=
298:)
292:=
280:.
274:=
268:,
262:=
256:,
250:(
244:(
238:)
232:=
220:=
214:,
208:(
202:(
196:)
190:(
184:=
175:)
169:(
163:=
157:.
151:)
145:(
139:=
133:.
124:)
118:(
112:=
103:)
97:,
91:(
85:.
73:=
64:)
58:(
28:R
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.