Index: trunk/tools/wmib/DumpHtm.cs |
— | — | @@ -96,6 +96,28 @@ |
97 | 97 | } |
98 | 98 | |
99 | 99 | /// <summary> |
| 100 | + /// Insert another table row |
| 101 | + /// </summary> |
| 102 | + /// <param name="name"></param> |
| 103 | + /// <param name="value"></param> |
| 104 | + /// <returns></returns> |
| 105 | + public string AddLink(string name, string value) |
| 106 | + { |
| 107 | + return "<tr><td>" + Encode(name) + "</td><td><a href=\"#" + Encode(value) +"\">" + Encode(value) + "</a></td></tr>\n"; |
| 108 | + } |
| 109 | + |
| 110 | + /// <summary> |
| 111 | + /// Insert another table row |
| 112 | + /// </summary> |
| 113 | + /// <param name="name"></param> |
| 114 | + /// <param name="value"></param> |
| 115 | + /// <returns></returns> |
| 116 | + public string AddKey(string name, string value) |
| 117 | + { |
| 118 | + return "<tr id=\"" + Encode(name) + "\"><td>" + Encode(name) + "</td><td>" + Encode(value) + "</td></tr>\n"; |
| 119 | + } |
| 120 | + |
| 121 | + /// <summary> |
100 | 122 | /// Generate a dump file |
101 | 123 | /// </summary> |
102 | 124 | public void Make() |
— | — | @@ -104,20 +126,20 @@ |
105 | 127 | { |
106 | 128 | string text = CreateHeader(); |
107 | 129 | text = text + "<h4>Infobot</h4>\n"; |
108 | | - text = text + "<table border=1 width=100%>\n<tr><td width=10%>Key</td><td>Value</td></tr>\n"; |
| 130 | + text = text + "<table border=1 width=100%>\n<tr><th width=10%>Key</th><th>Value</th></tr>\n"; |
109 | 131 | Channel.Keys.locked = true; |
110 | 132 | if (Channel.Keys.text.Count > 0) |
111 | 133 | { |
112 | 134 | foreach (dictionary.item Key in Channel.Keys.text) |
113 | 135 | { |
114 | | - text += AddLine(Key.key, Key.text); |
| 136 | + text += AddKey(Key.key, Key.text); |
115 | 137 | } |
116 | 138 | } |
117 | 139 | text = text + "</table>\n"; |
118 | 140 | text = text + "<h4>Aliases</h4>\n<table border=1 width=100%>\n"; |
119 | 141 | foreach (dictionary.staticalias data in Channel.Keys.Alias) |
120 | 142 | { |
121 | | - text += AddLine(data.Name, data.Key); |
| 143 | + text += AddLink(data.Name, data.Key); |
122 | 144 | } |
123 | 145 | text = text + "</table>\n"; |
124 | 146 | Channel.Keys.locked = false; |
Index: trunk/tools/wmib/RClogs.cs |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | } |
224 | 224 | catch (Exception) |
225 | 225 | { |
226 | | - |
| 226 | + Console.WriteLine("error in Connect() fc"); |
227 | 227 | } |
228 | 228 | } |
229 | 229 | |
— | — | @@ -364,39 +364,36 @@ |
365 | 365 | } |
366 | 366 | } |
367 | 367 | } |
368 | | - wikiinfo.Add(new wiki("#cs.wikinews", "https://cs.wikipedia.org/w/index.php", "cs_wikinews")); |
369 | | - wikiinfo.Add(new wiki("#en.wikinews", "https://en.wikipedia.org/w/index.php", "en_wikinews")); |
370 | | - wikiinfo.Add(new wiki("#de.wikinews", "https://de.wikipedia.org/w/index.php", "de_wikinews")); |
371 | | - wikiinfo.Add(new wiki("#fr.wikinews", "https://fr.wikipedia.org/w/index.php", "fr_wikinews")); |
372 | | - wikiinfo.Add(new wiki("#pt.wikinews", "https://pt.wikipedia.org/w/index.php", "pt_wikinews")); |
373 | | - wikiinfo.Add(new wiki("#zh.wikinews", "https://fr.wikipedia.org/w/index.php", "zh_wikinews")); |
374 | | - wikiinfo.Add(new wiki("#es.wikinews", "https://fr.wikipedia.org/w/index.php", "es_wikinews")); |
375 | | - wikiinfo.Add(new wiki("#ru.wikinews", "https://fr.wikipedia.org/w/index.php", "ru_wikinews")); |
376 | | - wikiinfo.Add(new wiki("#it.wikinews", "https://fr.wikipedia.org/w/index.php", "it_wikinews")); |
377 | | - wikiinfo.Add(new wiki("#nl.wikinews", "https://fr.wikipedia.org/w/index.php", "nl_wikinews")); |
378 | | - wikiinfo.Add(new wiki("#ja.wikinews", "https://fr.wikipedia.org/w/index.php", "ja_wikinews")); |
| 368 | + wikiinfo.Add(new wiki("#cs.wikinews", "https://cs.wikinews.org/w/index.php", "cs_wikinews")); |
| 369 | + wikiinfo.Add(new wiki("#en.wikinews", "https://en.wikinews.org/w/index.php", "en_wikinews")); |
| 370 | + wikiinfo.Add(new wiki("#de.wikinews", "https://de.wikinews.org/w/index.php", "de_wikinews")); |
| 371 | + wikiinfo.Add(new wiki("#fr.wikinews", "https://fr.wikinews.org/w/index.php", "fr_wikinews")); |
| 372 | + wikiinfo.Add(new wiki("#pt.wikinews", "https://pt.wikinews.org/w/index.php", "pt_wikinews")); |
| 373 | + wikiinfo.Add(new wiki("#zh.wikinews", "https://zh.wikinews.org/w/index.php", "zh_wikinews")); |
| 374 | + wikiinfo.Add(new wiki("#es.wikinews", "https://es.wikinews.org/w/index.php", "es_wikinews")); |
| 375 | + wikiinfo.Add(new wiki("#ru.wikinews", "https://ru.wikinews.org/w/index.php", "ru_wikinews")); |
| 376 | + wikiinfo.Add(new wiki("#it.wikinews", "https://it.wikinews.org/w/index.php", "it_wikinews")); |
| 377 | + wikiinfo.Add(new wiki("#nl.wikinews", "https://nl.wikinews.org/w/index.php", "nl_wikinews")); |
| 378 | + wikiinfo.Add(new wiki("#ja.wikinews", "https://ja.wikinews.org/w/index.php", "ja_wikinews")); |
379 | 379 | wikiinfo.Add(new wiki("#en.wiktionary", "https://en.wiktionary.org/w/index.php", "en_wiktionary")); |
380 | | - wikiinfo.Add(new wiki("#cs.wiktionary", "https://cs.wikipedia.org/w/index.php", "cs_wiktionary")); |
381 | | - wikiinfo.Add(new wiki("#de.wiktionary", "https://de.wikipedia.org/w/index.php", "de_wiktionary")); |
382 | | - wikiinfo.Add(new wiki("#fr.wiktionary", "https://fr.wikipedia.org/w/index.php", "fr_wiktionary")); |
383 | | - wikiinfo.Add(new wiki("#pt.wiktionary", "https://pt.wikipedia.org/w/index.php", "pt_wiktionary")); |
384 | | - wikiinfo.Add(new wiki("#zh.wiktionary", "https://fr.wikipedia.org/w/index.php", "zh_wiktionary")); |
385 | | - wikiinfo.Add(new wiki("#es.wiktionary", "https://fr.wikipedia.org/w/index.php", "es_wiktionary")); |
386 | | - wikiinfo.Add(new wiki("#ru.wiktionary", "https://fr.wikipedia.org/w/index.php", "ru_wiktionary")); |
387 | | - wikiinfo.Add(new wiki("#it.wiktionary", "https://fr.wikipedia.org/w/index.php", "it_wiktionary")); |
388 | | - wikiinfo.Add(new wiki("#nl.wiktionary", "https://fr.wikipedia.org/w/index.php", "nl_wiktionary")); |
389 | | - wikiinfo.Add(new wiki("#ja.wiktionary", "https://fr.wikipedia.org/w/index.php", "ja_wiktionary")); |
| 380 | + wikiinfo.Add(new wiki("#cs.wiktionary", "https://cs.wiktionary.org/w/index.php", "cs_wiktionary")); |
| 381 | + wikiinfo.Add(new wiki("#de.wiktionary", "https://de.wiktionary.org/w/index.php", "de_wiktionary")); |
| 382 | + wikiinfo.Add(new wiki("#fr.wiktionary", "https://fr.wiktionary.org/w/index.php", "fr_wiktionary")); |
| 383 | + wikiinfo.Add(new wiki("#pt.wiktionary", "https://pt.wiktionary.org/w/index.php", "pt_wiktionary")); |
| 384 | + wikiinfo.Add(new wiki("#es.wiktionary", "https://es.wiktionary.org/w/index.php", "es_wiktionary")); |
| 385 | + wikiinfo.Add(new wiki("#ru.wiktionary", "https://ru.wiktionary.org/w/index.php", "ru_wiktionary")); |
| 386 | + wikiinfo.Add(new wiki("#it.wiktionary", "https://it.wiktionary.org/w/index.php", "it_wiktionary")); |
| 387 | + wikiinfo.Add(new wiki("#nl.wiktionary", "https://nl.wiktionary.org/w/index.php", "nl_wiktionary")); |
| 388 | + wikiinfo.Add(new wiki("#ja.wiktionary", "https://ja.wiktionary.org/w/index.php", "ja_wiktionary")); |
390 | 389 | wikiinfo.Add(new wiki("#cs.wikipedia", "https://cs.wikipedia.org/w/index.php", "cs_wikipedia")); |
391 | 390 | wikiinfo.Add(new wiki("#en.wikipedia", "https://en.wikipedia.org/w/index.php", "en_wikipedia")); |
392 | 391 | wikiinfo.Add(new wiki("#de.wikipedia", "https://de.wikipedia.org/w/index.php", "de_wikipedia")); |
393 | 392 | wikiinfo.Add(new wiki("#fr.wikipedia", "https://fr.wikipedia.org/w/index.php", "fr_wikipedia")); |
394 | 393 | wikiinfo.Add(new wiki("#pt.wikipedia", "https://pt.wikipedia.org/w/index.php", "pt_wikipedia")); |
395 | | - wikiinfo.Add(new wiki("#zh.wikipedia", "https://fr.wikipedia.org/w/index.php", "zh_wikipedia")); |
396 | | - wikiinfo.Add(new wiki("#es.wikipedia", "https://fr.wikipedia.org/w/index.php", "es_wikipedia")); |
397 | | - wikiinfo.Add(new wiki("#ru.wikipedia", "https://fr.wikipedia.org/w/index.php", "ru_wikipedia")); |
398 | | - wikiinfo.Add(new wiki("#it.wikipedia", "https://fr.wikipedia.org/w/index.php", "it_wikipedia")); |
399 | | - wikiinfo.Add(new wiki("#nl.wikipedia", "https://fr.wikipedia.org/w/index.php", "nl_wikipedia")); |
400 | | - wikiinfo.Add(new wiki("#ja.wikipedia", "https://fr.wikipedia.org/w/index.php", "ja_wikipedia")); |
| 394 | + wikiinfo.Add(new wiki("#zh.wikipedia", "https://zh.wikipedia.org/w/index.php", "zh_wikipedia")); |
| 395 | + wikiinfo.Add(new wiki("#es.wikipedia", "https://es.wikipedia.org/w/index.php", "es_wikipedia")); |
| 396 | + wikiinfo.Add(new wiki("#ru.wikipedia", "https://ru.wikipedia.org/w/index.php", "ru_wikipedia")); |
| 397 | + wikiinfo.Add(new wiki("#ja.wikipedia", "https://ja.wikipedia.org/w/index.php", "ja_wikipedia")); |
401 | 398 | wikiinfo.Add(new wiki("#mediawiki.wikipedia", "https://www.mediawiki.org/w/index.php", "mediawiki")); |
402 | 399 | wikiinfo.Add(new wiki("#test.wikipedia", "https://test.wikipedia.org/w/index.php", "test_wikipedia")); |
403 | 400 | return 0; |
— | — | @@ -426,6 +423,14 @@ |
427 | 424 | break; |
428 | 425 | } |
429 | 426 | } |
| 427 | + if (Page.Contains("*")) |
| 428 | + { |
| 429 | + if (!Page.EndsWith("*") || Page.Replace("*", "") == "") |
| 430 | + { |
| 431 | + irc.SlowQueue.DeliverMessage("Invalid string, you can't use a wildcard like this", channel.name); |
| 432 | + return true; |
| 433 | + } |
| 434 | + } |
430 | 435 | if (pages.Contains(currpage)) |
431 | 436 | { |
432 | 437 | irc.SlowQueue.DeliverMessage("There is already this string in a list of watched items", |
— | — | @@ -493,12 +498,26 @@ |
494 | 499 | { |
495 | 500 | foreach (IWatch w in curr.pages) |
496 | 501 | { |
497 | | - if (w.Channel == _channel && page == w.Page) |
| 502 | + if (w.Channel == _channel) |
498 | 503 | { |
499 | | - irc.SlowQueue.DeliverMessage( |
500 | | - "Change on 12" + w.URL.name + " a page " + page + |
501 | | - " was modified," + " changed by " + username + |
502 | | - " link " + w.URL.url + "?diff=" + link + " edit summary: " + summary, curr.channel.name); |
| 504 | + if (page == w.Page) |
| 505 | + { |
| 506 | + irc.SlowQueue.DeliverMessage( |
| 507 | + "Change on 12" + w.URL.name + " a page " + page + |
| 508 | + " was modified," + " changed by " + username + |
| 509 | + " link " + w.URL.url + "?diff=" + link + " edit summary: " + summary, curr.channel.name); |
| 510 | + } |
| 511 | + else |
| 512 | + if (w.Page.EndsWith("*")) |
| 513 | + { |
| 514 | + if (page.StartsWith(w.Page.Replace("*", ""))) |
| 515 | + { |
| 516 | + irc.SlowQueue.DeliverMessage( |
| 517 | + "Change on 12" + w.URL.name + " a page " + page + |
| 518 | + " was modified," + " changed by " + username + |
| 519 | + " link " + w.URL.url + "?diff=" + link + " edit summary: " + summary, curr.channel.name); |
| 520 | + } |
| 521 | + } |
503 | 522 | } |
504 | 523 | } |
505 | 524 | } |