Skip to content

Instantly share code, notes, and snippets.

@xbony2
Created November 22, 2015 22:56
Show Gist options
  • Save xbony2/4885bce9456d3cc0cc8f to your computer and use it in GitHub Desktop.
Save xbony2/4885bce9456d3cc0cc8f to your computer and use it in GitHub Desktop.
require_relative 'lib/mediawiki-butt'
require 'open-uri'
f = File.new("Documents/domains.txt", "r").read.chomp.each_line do |url|
butt = MediaWiki::Butt.new(url.chomp)
butt.login("xbony2", "-REDACTED-")
if butt.get_extensions.include? "Semantic MediaWiki"
if butt.get_text("User:Xbony2/common.css").nil?
butt.create_page("User:Xbony2/common.css", "/* Hides \"This page supports semantic in-text annotations\" message */\n#smw-form-editpage-help {\n display: none;\n}\n", "Automated task: contact [[User:Xbony2]] with any issues.")
end
end
butt.logout
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment