User:Firefly/code/insertat


 * 1) !/usr/bin/python
 * 2) -*- coding: utf-8  -*-

import wikipedia

def endofprose(pagetext, addition): site = wikipedia.getSite interwiki =  wikipedia.getLanguageLinks(pagetext, site) categories = wikipedia.getCategoryLinks(pagetext, site) pagetext  =  wikipedia.removeLanguageLinks(pagetext, site) pagetext  =  wikipedia.removeCategoryLinks(pagetext, site) pagetext  += '\n\n' + addition pagetext  =  wikipedia.replaceLanguageLinks(pagetext,interwiki) pagetext  =  wikipedia.replaceCategoryLinks(pagetext,categories) return pagetext
 * 1) Inserts text directly before interlanguage links/categories if they exist, else it appends the text to the end of the article