WikiCrawler/Tasks/Commons/SimpleTasks.cs
/// <summary>
/// Does a null edit on all pages with incoming links to a set of pages.
/// </summary>
Does a null edit on all pages with incoming links to a set of pages.
Does a null edit on all pages with incoming links to a set of pages .
[BatchTask]
		public static void NullEditLinks()
		{
			Uri commons = new Uri("https://commons.wikimedia.org/");
			EasyWeb.SetDelayForDomain(commons, 0.1f);
			Api Api = new Api(commons);
			Api.AutoLogIn();
			string[] pages = new string[]
			{
				"Creator:Chatsam",
				"Creator:Allen & Ginter",
				"Creator:Tim Felce (Airwolfhound)",
				"Creator:Thomas R Machnitzki"
			};
			List<string> links = new List<string>();
			foreach (string page in pages)
			{
				Article article = new Article(page);
				foreach (Article link in article.GetLinksHere(Api))
				{
					Article linkpage = Api.GetPage(link);
					Api.EditPage(linkpage, "null edit", minor: true);
					Console.WriteLine(link.title);
					links.Add(link.title);
				}
			}
			File.WriteAllLines("E:/temp.txt", links.ToArray());
		}
[ BatchTask ] public static void NullEditLinks ( ) { Uri commons = new Uri ( " " ) ; EasyWeb . SetDelayForDomain ( commons , 0.1f ) ; Api Api = new Api ( commons ) ; Api . AutoLogIn ( ) ; string [ ] pages = new string [ ] { " " , " " , " " , " " } ; List < string > links = new List < string > ( ) ; foreach ( string page in pages ) { Article article = new Article ( page ) ; foreach ( Article link in article . GetLinksHere ( Api ) ) { Article linkpage = Api . GetPage ( link ) ; Api . EditPage ( linkpage , " " , minor : true ) ; Console . WriteLine ( link . title ) ; links . Add ( link . title ) ; } } File . WriteAllLines ( " " , links . ToArray ( ) ) ; }
Does a null edit on all pages with incoming links to a set of pages.
Does a null edit on all pages with incoming links to a set of pages .