[Mediawiki-l] Bot for rewriting external links as wiki links?

Platonides Platonides at gmail.com
Mon May 21 16:55:17 UTC 2012


On 21/05/12 18:41, David J. Biesack wrote:
> 
> Is there a bot which will repair external URL coded links to the same wikinand rewrite them as wiki links?
> 
> For example, if MediaWikis were installed in www.example.com/wiki and pages contains
> links using external link notation
> 
>   blah http://www.example.com/wiki/Some_page blah
>   blah [http://www.example.com/wiki/Some_page some text] blah
>   blah [http://www.example.com/wiki/Some_page#some_section some text] blah
> 
> then the "What links here" feature would not work because such links are not recognized.
> 
> The bot would replace those with wiki links:
> 
>  blah [[Some page]] blah
>  blah [[Some page | some text]] blah
>  blah [[Some page#some_section | some text]] blah or  blah {{there|some section|Some page | some text}} blah
> 
> In addition, if the link is to a section of the current page, i.e. on [[Some page]],
> the second link would be updated as
> 
>  {{here|some section|some text}}
> 
> There may need to be some way to disable this (i.e. in help or project pages
> that discuss link notation).

You could perform it using pywikipedia and some ugly regex.




More information about the MediaWiki-l mailing list