See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Utilisateur:Delhovlyn/Allociné - Wikipédia

Utilisateur:Delhovlyn/Allociné

Un article de Wikipédia, l'encyclopédie libre.

Remplace les liens vers Allociné en utilisant les modèles {{Allocine name}} ou {{Allocine title}}.
Buts :

  1. Uniformiser/Harmoniser
  2. Ajouter (automatiquement, par le modèle), l'attribut nopub=1 dans l'URL, ce qui permet de sauter la page de pub intersticielle visible à la première visite.


(type 1 seulement, pour l'instant)
Tools > Make Module. Cocher Enabled, C# 2.0 sélectionné, rentrer code, cliquer sur Make Module, puis sur Done si pas d'erreur. Ensuite, lancer en désactivant le Find and replace.

Sommaire

[modifier] Films

public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Regex title = new Regex (@"([^\(]+) \((films?|[0-9]{4}|films?, [0-9]{4}|(S|s)aga)\)");
            Match myMatch = title.Match (ArticleTitle);
            String Title = myMatch.Groups[1].ToString ();
            String Title2 = "|title="+Title;
            if (Title == String.Empty)
               Title2 = "";
            Regex film = new Regex(@"^\*\040?(\{\{[^\}]+\}\})?\040?('')?\[http://www\.allocine\.fr/film/fichefilm_gen_cfilm=([0-9]+)\.html?/? .*\].*");
            ArticleText = film.Replace(ArticleText, "* {{Allocine title|id=$3"+Title2+"}}\r"); 
            Skip = false;
            Summary = "Remplacement lien Allociné par modèle {{Allociné title}} — ";
 
            return ArticleText;
        }

[modifier] Personnes

public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Regex title = new Regex (@"([^\(]+) \((acteur|actrice|réalisateur|réalisatrice)\)");
            Match myMatch = title.Match (ArticleTitle);
            String Name = myMatch.Groups[1].ToString ();
            String Name2 = "|name="+Name;
            if (Name == String.Empty)
               Name2 = "";
            Regex personne = new Regex(@"^\*\040?(\{\{[^\}]+\}\})?\040?('')?\[http://www\.allocine\.fr/personne/fichepersonne_gen_cpersonne=([0-9]+)\.html?/? .*\].*");
            ArticleText = personne.Replace(ArticleText, "* {{Allocine name|id=$3"+Name2+"}}\r");
 
            Skip = false;
            Summary = "Remplacement lien Allociné par modèle {{Allociné name}} — ";
 
            return ArticleText;
        }


[modifier] Films

1) Find →     \*\s?(\{\{[^\}]+\}\})?\s?('')?\[http://www\.allocine\.fr/film/fichefilm_gen_cfilm=([0-9]+)\.html? .*\].*
2) Replace →  * {{Allocine title|id=$3}}

[modifier] Personnes

1) Find →     \*\s?(\{\{[^\}]+\}\})?\s?('')?\[http://www\.allocine\.fr/personne/fichepersonne_gen_cpersonne=([0-9]+)\.html? .*\].*
2) Replace →  * {{Allocine name|id=$3}}


[modifier] La Règle (obsolète)

[modifier] Type 1

1) Find →     http://www\.allocine\.(fr|com)/([a-z]+)/([a-z]+)_gen_c([a-z]+)=([0-9]+)\.html?
2) Replace →  http://www.allocine.$1/$2/$3_gen_c$4=$5&nopub=1.html
           
Fait OK pour tout.

[modifier] Type 2

1) Find →     http://www\.allocine\.(fr|com)/([a-z]+)/([a-z]+)\.html?c([a-z]+)=([0-9]+)
2) Replace →  http://www.allocine.$1/$2/$3.html?c$4=$5&nopub=1.html
Fait OK pour tout.

[modifier] Général

[modifier] Type 1

http://www.allocine.fr/***/***_gen_c***=***.htmlhttp://www.allocine.fr/***/***_gen_c***=***.html

[modifier] Type 2

http://www.allocine.fr/***/***.html?c***=***http://www.allocine.fr/***/***.html?c***=***


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -