User:Bishbot

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

This user is a bot, owned by en:User:FrancisTyers, the Tajik Wikipedia User Page can be found here.

It scrapes the Picture of the Day in order to include it on the Tajik Wikipedia Main Page.

It does not edit. Any questions to here

The bot is named after en:User:Bishonen! :)


#!/usr/bin/python
# -*- coding: utf-8  -*-

import wikipedia
from datetime import date

pageName = "Template:Potd/" + date.isoformat(date.today())

site = wikipedia.getSite()
page = wikipedia.Page(site, pageName)
text = page.get()
#text = page.imagelinks()

print text

potd = "{{border|[[Image:" + text + "|right|300px]]}}"

print potd

family = 'wikipedia'
# The language code of the site we're working on.
mylang = 'tg'

potdPage = u"Template:Акси имрўза"

site = wikipedia.getSite(code = "tg", fam = "wikipedia", user = "Bishbot")
page = wikipedia.Page(site, potdPage)
potdText = page.get()

print potdText

page.put(potd, comment = u"Акси имрўза ... Updating POTD")