Knowledge

talk:Lua - Knowledge

Source đź“ť

187: 153: 89: 117: 31: 1016:
The main thing i am struggling with is that the the regnal citations for uk acts last happened in 1962, so that's how it's been set up but the regnal citation for NI acts last happened in 1942. When I say "regnal citation" I mean, "10 & 11 Geo. 5. No. 1" or "14 Geo. 6. c. 1" or "13 & 14 Geo.
592:
in pywikipediabot which counts ALL parser functions. In theory, that could be changed to count expensive parser functions. Then you need another script to get all templates used on a page. That would result in a list of pages with their maximum possible expensive parser function counts. (some of
360:
via a url param that is passed to it, and then processing the output of the search? I would like to be able to pass this url to a Module, have it execute the search, and return the total number of results by scraping it out of the content. For example, it should return value
1064:
Sorry, I'm not going anywhere near that mess. The author(s) couldn't be bothered to document the code (shame. shame. shame.), couldn't be bothered to use meaningful variable names, couldn't be bothered to organize all of that text in a data
882:
Have just realised that the function that contains this appears to be completely unused, and it is also not documented. So it is simplest if I just remove this function from the module and the error disappears — Martin
900:
Sorry Aidan, just noticed your edit to the sandbox. I had not noticed the extra space between the pipes, so that makes sense. If it turns out the function is being used, then I will put your version back in — Martin
589: 370: 351: 448: 371:
https://en.wikipedia.org/search/?search=Draft%3A+hastemplate%3AOKA++hastemplate%3AAfC_submission%2Fdraft&title=Special:Search&profile=default&fulltext=1
1069: 768: 555: 473: 167: 442: 663: 1010: 761: 401: 515: 832:
Is there anyway this can be coded which prevents the warning? At the moment you get a warning every time you try to save the page — Martin
60: 468: 653: 411:
and modules cannot access special pages which are not based on wikitext. I don't know what API may be available for use by JavaScript.
95: 454: 1048:
Mainly I just don't know how to adjust the module in the correct way to apply the citation system it uses for the NI acts properly.
392:
The module should be capable of handling any url that represents an advanced search, and find the total results. Is that possible?
99: 138: 804:
It seems the syntax highlighter is pointing out that the escape sequence doesn't make any sense (it's expecting something like
17: 304: 865:
That would render the gsub completely redundant/useless, so maybe this is not doing what it was supposed to do ... — Martin
994: 684: 563: 1042: 1091: 1077: 309: 581: 799: 776: 708: 294: 289: 284: 279: 274: 737: 1057: 643: 602: 434: 420: 264: 259: 254: 913: 895: 877: 860: 844: 827: 249: 244: 239: 234: 229: 224: 219: 214: 209: 616: 1073: 962: 947: 930: 772: 753: 559: 725:
This is being identified as an error when you try to save it, but not exactly sure how to fix. — Martin
1007: 988: 702: 1021: 551:
is used internally by MediaWiki functions to bump the counter when an expensive function is executed.
357: 162: 136:
on 5 February 2016. For the contribution history and old versions of the redirected page, please see
593:
those parser functions are guarded with if statements, which the script would not take account for)
377:
The resulting Html contains the following which looks easily scrapable, if a module can access it:
670: 55: 124: 1003: 569: 382:<div class="results-info" data-mw-num-results-offset="0" data-mw-num-results-total="4": --> 1013:
does not fit into the module there are a couple aspects that I am not sure on how too change
1030:
The pseudocode for the idea I am trying to implement is something like changing ``year : -->
152: 75: 999: 634: 506: 464: 8: 855: 822: 760:
Umm, pipe isn't a special character in lua patterns so does not need to be escaped. See
536:
to increment the count but none (documented) to fetch the current count. I suspect that
484: 158: 50: 612: 598: 1087: 1053: 1038: 430: 416: 397: 67: 958: 926: 749: 714: 129: 576: 449:
Knowledge:Village_pump_(technical)#Request_for_Lua_code_review:_New_language_module
341: 849:
Just remove the \, since "\|" and "|" are the same in lua (e.g. try printing it).
630: 502: 460: 659: 607:
You could also do the same with getContent() in lua, with the same limitations.
984: 942: 935:
I think I did, but it doesn't make the syntax highlighter any happier — Martin
908: 890: 872: 850: 839: 817: 794: 732: 697: 638: 510: 494: 408: 608: 594: 320: 1083: 1049: 1034: 625:
that I can easily query inside a lua loop to know when to break out of it.
426: 412: 393: 186: 103: 35: 30: 425:
Thanks. I suspected as much, but wasn't sure. I'll look into other avenues.
954: 922: 745: 479: 690:
Thanks for letting us know. Sounds as though it could be useful — Martin
573: 324: 326: 88: 980: 938: 904: 886: 868: 835: 790: 728: 693: 678: 322: 45: 521:
Not that I know of. It is interesting that there is a function
327: 812:), but it's still legal code, and just gets interpreted as 952:
It gets rid of the error messages on the lines for me.  —
352:
Executing and scraping results from an advanced search url
1082:
If it were documented, I wouldn't be asking for help.
676:
to make it less expensive/less error-prone/substable?
588:
If you are willing to look further than lua, there is
787:
Perhaps it is the pipe which needs escaping — Martin
762:
mw:Extension:Scribunto/Lua_reference_manual#Patterns
474:
Is there an expensive-parser-function-count counter?
180: 1011:List of acts of the Parliament of Northern Ireland 816:since a pipe has no special meaning when escaped. 781:If you look at the code in the module you will see 98:discussions and keep related topics together, all 572:, but that's almost certainly not what you want. 447:Reposting this village pump post for visibility: 443:Request for Lua code review: New language module 1033:1942 and jurisdiction = "northern ireland")``. 920:Did you try using %| as I suggested above?  — 497:remains at any given time during execution. 666:. Would someone be able to implement this at 335:This page has archives. Sections older than 721:res = mw.ustring.gsub( res,'\| \|', '| |' ) 664:can now detect the categories used on a page 1027:The citation happens at line 124, I think. 621:Thanks, but I'm looking for something like 784:Error: invalid escape sequence near '\|' 658:After 11 years in Phabricator purgatory, 493:It would be very useful to know how much 654:Category detection (using new feature!) 14: 743:Use % as the Lua escape character.  — 356:Is a module capable of executing an 345:when more than 1 section is present. 147: 111: 83: 24: 100:Knowledge:Lua subpages' talk pages 25: 1105: 995:Legislationuk / Legislationlistuk 568:There is the extremely ugly hack 339:may be automatically archived by 662:has now been completed, and Lua 185: 151: 115: 87: 29: 545:incrementExpensiveFunctionCount 530:incrementExpensiveFunctionCount 1092:16:01, 20 September 2024 (UTC) 1078:14:40, 20 September 2024 (UTC) 1058:00:59, 20 September 2024 (UTC) 1043:00:57, 20 September 2024 (UTC) 979:(Lua patterns are not regex.) 623:mw.getExpensiveFunctionCount() 165:on 21 May 2015. The result of 13: 1: 709:Problem with escape character 7: 989:19:07, 22 August 2024 (UTC) 963:08:46, 23 August 2024 (UTC) 948:08:31, 23 August 2024 (UTC) 931:08:27, 23 August 2024 (UTC) 914:08:30, 23 August 2024 (UTC) 896:08:26, 23 August 2024 (UTC) 878:08:19, 23 August 2024 (UTC) 861:08:09, 23 August 2024 (UTC) 845:08:04, 23 August 2024 (UTC) 828:08:01, 23 August 2024 (UTC) 800:06:18, 23 August 2024 (UTC) 777:16:39, 22 August 2024 (UTC) 754:16:34, 22 August 2024 (UTC) 738:16:28, 22 August 2024 (UTC) 703:16:29, 22 August 2024 (UTC) 685:15:23, 16 August 2024 (UTC) 644:10:41, 17 August 2024 (UTC) 617:09:03, 17 August 2024 (UTC) 603:09:01, 17 August 2024 (UTC) 582:00:27, 11 August 2024 (UTC) 564:14:48, 10 August 2024 (UTC) 516:14:20, 10 August 2024 (UTC) 10: 1110: 1020:The module uses data from 1008:Template:Legislationlistuk 477: 65: 1022:Module:Legislationuk/data 537: 522: 469:15:27, 25 July 2024 (UTC) 590:parser_function_count.py 453:Feedback welcome on the 435:08:06, 6 July 2024 (UTC) 421:08:01, 6 July 2024 (UTC) 402:07:04, 6 July 2024 (UTC) 383:Results <strong: --> 1031:1962`` to ``year : --> 1004:Template:Legislationuk 570:Module:Preview expense 125:Knowledge:Lua/Requests 18:Knowledge:Lua requests 384:1 – 4</strong: --> 122:The contents of the 1000:Module:Legislationuk 1032:1962 or (year : --> 407:No. Searching uses 305:Requests discussion 270:Requests archives: 159:Knowledge:Lua/To do 385:of <strong: --> 358:WP:Advanced search 205:Current archives: 161:was nominated for 134:Knowledge talk:Lua 1070:Trappist the monk 1017:5. c. 7 (N.I.)". 946: 912: 894: 876: 843: 798: 769:Trappist the monk 736: 715:Module:Chessboard 701: 556:Trappist the monk 386:4</strong: --> 349: 348: 179: 178: 146: 145: 110: 109: 16:(Redirected from 1101: 961: 936: 929: 902: 884: 866: 833: 815: 811: 807: 788: 752: 726: 722: 691: 683: 681: 675: 669: 642: 624: 550: 549: 546: 543: 540: 535: 534: 531: 528: 525: 514: 489: 487: 388: 373: 365:given this url: 364: 344: 328: 310:To do discussion 189: 181: 155: 148: 141: 119: 118: 112: 91: 84: 78: 63: 61:Reference manual 58: 53: 48: 43: 38: 34: 33: 21: 1109: 1108: 1104: 1103: 1102: 1100: 1099: 1098: 997: 953: 921: 859: 826: 813: 809: 805: 744: 720: 711: 679: 677: 673: 667: 656: 629: 622: 579: 578:it has begun... 547: 544: 541: 538: 532: 529: 526: 523: 501: 491: 485: 483: 476: 455:talk page here. 445: 381: 369: 362: 354: 340: 329: 323: 314: 194: 137: 116: 82: 81: 74: 70: 64: 59: 54: 49: 44: 39: 28: 27: 23: 22: 15: 12: 11: 5: 1107: 1097: 1096: 1095: 1094: 1066: 1062: 1060: 996: 993: 992: 991: 977: 976: 975: 974: 973: 972: 971: 970: 969: 968: 967: 966: 965: 918: 917: 916: 898: 880: 853: 820: 785: 782: 765: 758: 756: 710: 707: 706: 705: 671:If in category 655: 652: 651: 650: 649: 648: 647: 646: 586: 585: 584: 577: 552: 490: 482: 475: 472: 444: 441: 440: 439: 438: 437: 409:Special:Search 390: 389: 375: 374: 353: 350: 347: 346: 334: 331: 330: 325: 321: 319: 316: 315: 313: 312: 307: 298: 297: 292: 287: 282: 277: 268: 267: 262: 257: 252: 247: 242: 237: 232: 227: 222: 217: 212: 203: 200: 199: 196: 195: 190: 184: 177: 176: 168:the discussion 156: 144: 143: 120: 108: 107: 106:redirect here. 92: 80: 79: 71: 66: 26: 9: 6: 4: 3: 2: 1106: 1093: 1089: 1085: 1081: 1080: 1079: 1075: 1071: 1067: 1063: 1061: 1059: 1055: 1051: 1047: 1046: 1045: 1044: 1040: 1036: 1028: 1025: 1023: 1018: 1014: 1012: 1009: 1005: 1001: 990: 986: 982: 978: 964: 960: 956: 951: 950: 949: 944: 940: 934: 933: 932: 928: 924: 919: 915: 910: 906: 899: 897: 892: 888: 881: 879: 874: 870: 864: 863: 862: 857: 852: 848: 847: 846: 841: 837: 831: 830: 829: 824: 819: 803: 802: 801: 796: 792: 786: 783: 780: 779: 778: 774: 770: 766: 763: 759: 757: 755: 751: 747: 742: 741: 740: 739: 734: 730: 723: 718: 716: 713:This is from 704: 699: 695: 689: 688: 687: 686: 682: 672: 665: 661: 645: 640: 636: 632: 628: 620: 619: 618: 614: 610: 606: 605: 604: 600: 596: 591: 587: 583: 580: 575: 571: 567: 566: 565: 561: 557: 553: 520: 519: 518: 517: 512: 508: 504: 500: 496: 488: 481: 471: 470: 466: 462: 457: 456: 451: 450: 436: 432: 428: 424: 423: 422: 418: 414: 410: 406: 405: 404: 403: 399: 395: 387:</div: --> 380: 379: 378: 372: 368: 367: 366: 359: 343: 338: 333: 332: 318: 317: 311: 308: 306: 303: 302: 301: 296: 293: 291: 288: 286: 283: 281: 278: 276: 273: 272: 271: 266: 263: 261: 258: 256: 253: 251: 248: 246: 243: 241: 238: 236: 233: 231: 228: 226: 223: 221: 218: 216: 213: 211: 208: 207: 206: 202: 201: 198: 197: 193: 188: 183: 182: 174: 170: 169: 164: 160: 157: 154: 150: 149: 140: 135: 131: 127: 126: 121: 114: 113: 105: 104:Help talk:Lua 101: 97: 93: 90: 86: 85: 77: 73: 72: 69: 62: 57: 52: 47: 42: 37: 32: 19: 1029: 1026: 1019: 1015: 1006:is used by 998: 724: 719: 712: 657: 626: 498: 492: 486:Task T177567 458: 452: 446: 391: 376: 355: 336: 299: 269: 204: 191: 172: 166: 133: 123: 40: 1002:is used by 480:Phabricator 478:Tracked in 342:ClueBot III 139:its history 631:Tom.Reding 574:* Pppery * 503:Tom.Reding 461:Nonabelian 128:page were 96:centralise 851:Aidan9382 818:Aidan9382 56:Resources 1084:DotCoder 1050:DotCoder 1035:DotCoder 495:overhead 427:Mathglot 413:Johnuniq 394:Mathglot 192:Archives 163:deletion 94:To help 68:Shortcut 1065:module. 955:Jts1882 923:Jts1882 746:Jts1882 337:90 days 300:Other: 660:T50175 609:Snævar 595:Snævar 130:merged 76:WT:LUA 41:(talk) 36:WP:Lua 132:into 51:To do 1088:talk 1074:talk 1054:talk 1039:talk 985:talk 981:Izno 959:talk 943:talk 939:MSGJ 927:talk 909:talk 905:MSGJ 891:talk 887:MSGJ 873:talk 869:MSGJ 856:talk 840:talk 836:MSGJ 823:talk 806:\120 795:talk 791:MSGJ 773:talk 750:talk 733:talk 729:MSGJ 698:talk 694:MSGJ 680:Sdkb 639:dgaf 635:talk 613:talk 599:talk 560:talk 511:dgaf 507:talk 465:talk 431:talk 417:talk 398:talk 173:keep 171:was 102:and 46:Help 808:or 1090:) 1076:) 1056:) 1041:) 1024:. 987:) 941:· 907:· 889:· 871:· 838:· 810:\n 793:· 775:) 731:· 717:: 696:· 674:}} 668:{{ 615:) 601:) 562:) 548:() 539:mw 533:() 524:mw 467:) 459:-- 433:) 419:) 400:) 265:12 260:11 255:10 1086:( 1072:( 1068:— 1052:( 1037:( 983:( 957:| 945:) 937:( 925:| 911:) 903:( 893:) 885:( 875:) 867:( 858:) 854:( 842:) 834:( 825:) 821:( 814:| 797:) 789:( 771:( 767:— 764:. 748:| 735:) 727:( 700:) 692:( 641:) 637:⋅ 633:( 627:~ 611:( 597:( 558:( 554:— 542:. 527:. 513:) 509:⋅ 505:( 499:~ 463:( 429:( 415:( 396:( 363:4 295:5 290:4 285:3 280:2 275:1 250:9 245:8 240:7 235:6 230:5 225:4 220:3 215:2 210:1 175:. 142:. 20:)

Index

Knowledge:Lua requests

WP:Lua
(talk)
Help
To do
Resources
Reference manual
Shortcut
WT:LUA

centralise
Knowledge:Lua subpages' talk pages
Help talk:Lua
Knowledge:Lua/Requests
merged
Knowledge talk:Lua
its history
Miscellany for deletion
Knowledge:Lua/To do
deletion
the discussion

1
2
3
4
5
6
7

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑