Make Wikipedia Articles look better!

I read articles at Wikipedia occasionally.

By accident, I disovered that the pages really looks best by inserting ‘m.’ after ‘en.’ in the page url.

This is probably because the ‘m.’ makes the page to be styled for mobile devices.

It is bother some to have to edit the urls all the time, so this script, fixes the url!

Enjoy!

tell application "Safari"
	# 2 lines below just for demo purposes!
	open location "http://en.wikipedia.org/wiki/AppleScript"
	delay 10
	# comment out the lines above when you have tried it!
	tell current tab of front window
		set {_oldURL, langdomain} to {URL, "//en."}
		if _oldURL contains langdomain and _oldURL does not contain (langdomain & "m.") then
			set {astid, my text item delimiters} to {my text item delimiters, langdomain}
			set urlparts to text items of _oldURL
			set my text item delimiters to (langdomain & "m.")
			try
				set URL to urlparts as text
			end try
			set my text item delimiters to astid
		end if
	end tell
end tell