Libraryless. Click here for Pure Java version (1548L/10K/36K).
!7 p { S encoding = "ISO-8859-1"; File outDir = new File("/home/stefan/dev/woody/web-out"); for (File f : listFiles("/home/stefan/dev/woody/web")) pcall { if (!f.getName().endsWith(".php")) continue; print(f); S text = loadTextFileWithEncoding(f, encoding); L<S> lines = lines(text); lines.add(0, [[<? include("bot.inc.php"); ?>]]); int idx = indexOfElementThatContains(lines, " BOTFELD "); if (idx < 0) { print("no botfeld"); continue; } assertTrue(cic(lines.get(idx+1), "<TD")); int j = indexOfElementThatContains(lines, idx+2, "</TD"); if (j < 0) { print("huh"); continue; } lines.set(idx+1, lines.get(idx+1) + "\n<? bot(); ?>" + "\n<!--"); lines.set(j, "-->" + lines.get(j)); saveTextFileWithEncoding(new File(outDir, f.getName()), lines(lines), encoding); } }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1009007 |
Snippet name: | Integrate Bot |
Eternal ID of this version: | #1009007/3 |
Text MD5: | f4b24000c1d345d478a9b007db111ac3 |
Transpilation MD5: | 1a4c7f8d9f39c20f7e74d752302030d5 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-06-26 17:50:51 |
Source code size: | 852 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 550 / 627 |
Version history: | 2 change(s) |
Referenced in: | [show references] |