Welcome, guest | Sign In | My Account | Store | Cart

Basic script that will check and see if there have been any recent changes to a Wikimedia. Used for low use Wikimedia sites to keep an eye on them. I run this whenever my box starts and it will open the browser along with a few other windows that open.

Python, 20 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import urllib2
from BeautifulSoup import BeautifulSoup
import webbrowser

# Remote Path to your Wikimedia instalation
remote_link = ""

# Special link for Wikimedia to the Recent Changes Special Page
recent_changes_link = "index.php/Special:RecentChanges"

link = remote_link + recent_changes_link

page = urllib2.urlopen(link)

soup = BeautifulSoup(page)

test = soup.findAll(text=u"diff")

if len(test) != 0:
    webbrowser.open(link)

On Ubuntu, it is run through System>Preferences>Startup Applications in this matter: bash -c "sleep 10; python /path/to/change_check.py; /opt/google/chrome/google-chrome %U http://en.wikipedia.org/wiki/Special:Random www.pandora.com https://www.rememberthemilk.com/"

Looking to make any improvements to the script or my start up process. Thanks.