daily pastebin goal
85%
SHARE
TWEET

new bot code

a guest Jan 28th, 2017 179 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. =// Write your own bot scripts and functions in this file.
  2. // Run "Compile & Run.bat" file - it will compile this file as executable and launch it.
  3.  
  4. using System;
  5. using System.IO;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Collections;
  9. using System.Xml;
  10. using DotNetWikiBot;
  11.  
  12. class MyBot : Bot
  13. {
  14.     public void addEditNotice(Page input)
  15.     {
  16.         input.text = "{{Wikipedia information pages talk page editnotice}}";
  17.         input.Save();
  18.     }
  19.  
  20.     public static void Main()
  21.     {
  22.         Site s = new Site("https://en.wikipedia.org", "Haven’t decided bot name yet", "no password either");
  23.         s.defaultEditComment = "Adding editnotice";
  24.         s.minorEditByDefault = false;
  25.         PageList l = new PageList(s);
  26.         l.FillFromCategory("Wikipedia information pages");
  27.         foreach (Page p in l)
  28.         {
  29.             string pageTitle = "Template:Editnotices/Page/" + p.title;
  30.             Page p2 = new Page(s, pageTitle);
  31.             if (p2.Exists)
  32.             {
  33.                 if (p2.IsEmpty)
  34.                 {
  35.                     addEditNotice(p2);
  36.                 }
  37.                 else
  38.                 {
  39.                     continue;
  40.                 }
  41.             }
  42.             else
  43.             {
  44.                 addEditNotice(p2);
  45.             }
  46.         }
  47.     }
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top