Gebruiker:Magalhães/modules

Uit Wikipedia, de vrije encyclopedie
Naar navigatie springen Naar zoeken springen

insert getal (10) op specifieke locatie in tekst[bewerken]

         public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "Adding archiving templates";
 
            int insertPos = ArticleText.LastIndexOf("barangay=");
 
            if (insertPos < 0)
                insertPos = 0;
 
            ArticleText = ArticleText.Insert(insertPos+10, @"10");
 
            return ArticleText;
        }

insert string (b) op specifieke locatie in tekst[bewerken]

         public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "Adding archiving templates";
 
            int insertPos = ArticleText.LastIndexOf("barangay=");
            string b = "test";
 
            if (insertPos < 0)
                insertPos = 0;
 
            ArticleText = ArticleText.Insert(insertPos+10, b);
 
            return ArticleText;
        }

gelukt[bewerken]

         public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "Toevoegen #barangays";
            
            
            string Tekst;
            
            int findPos = ArticleText.LastIndexOf("[barangay]]s");
            
            if (findPos < 0)
                findPos = 0;
            
            Tekst = ArticleText.Substring(findPos-4, 2);
            int insertPos = ArticleText.LastIndexOf("barangay=");
            
 
            if (insertPos < 0)
                insertPos = 0;
 
            ArticleText = ArticleText.Insert(insertPos+9, Tekst);
 
            return ArticleText;
        }

toevoegen {{WP Filipijnen}}[bewerken]

    public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
         {
             Skip = false;
             Summary = "Toevoegen {{WP Filipijnen}}";
 
             ArticleText = "{{WP Filipijnen|klasse=D|belang=Laag}}\r\n" + ArticleText;
 
             return ArticleText;
         }

coordinaten van alle Filipijnse gemeenten van de Italiaanse wikipedia trekken[bewerken]

        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = true;
            Summary = "test";
            String outStr = ArticleTitle;
            bool found = false;
 
           Match i = Regex.Match(ArticleText, @"\[\[nl:([^\]]*)\]\]");
            while (i.Success) {
              outStr = outStr + i.Result(";$1");
              i = i.NextMatch();
              found = true;
           }
           Match m = Regex.Match(ArticleText, @"latitudineGradi\s*=\s*(.*)");
            while (m.Success) {
              outStr = outStr + m.Result(";$1");
              m = m.NextMatch();
              found = true;
            }
            Match n = Regex.Match(ArticleText, @"latitudinePrimi\s*=\s*(.*)");
            while (n.Success) {
              outStr = outStr + n.Result(";$1");
              n = n.NextMatch();
              found = true;
            }
            Match o = Regex.Match(ArticleText, @"latitudineSecondi\s*=\s*(.*)");
            while (o.Success) {
              outStr = outStr + o.Result(";$1");
              o = o.NextMatch();
              found = true;
            }
            Match p = Regex.Match(ArticleText, @"longitudineGradi\s*=\s*(.*)");
            while (p.Success) {
              outStr = outStr + p.Result(";$1");
              p = p.NextMatch();
              found = true;
            }
            Match q = Regex.Match(ArticleText, @"longitudinePrimi\s*=\s*(.*)");
            while (q.Success) {
              outStr = outStr + q.Result(";$1");
              q = q.NextMatch();
              found = true;
            }
            Match r = Regex.Match(ArticleText, @"longitudineSecondi\s*=\s*(.*)");
            while (r.Success) {
              outStr = outStr + r.Result(";$1");
              r = r.NextMatch();
              found = true;
            }
            if (found) {
              System.IO.StreamWriter sw = System.IO.File.AppendText("C:/Users/XYZ/AutoWikiBrowser/coordinaten.it.txt");
              sw.WriteLine(outStr);
              sw.Close();
           } 
 
            return ArticleText;
        }