Guest User

Untitled

a guest
Sep 4th, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import pywikibot, sys
  2.  
  3. # Usage: savepage [article name] [edit comment] [local file]
  4.  
  5. f = open(sys.argv[3], 'r')
  6. newtext = f.read()
  7.  
  8. site = pywikibot.Site('en', 'wikipedia') # The site we want to run our bot on
  9. page = pywikibot.Page(site, sys.argv[1])
  10. page.text = newtext
  11. page.save(sys.argv[2]) # Saves the page
Advertisement
Add Comment
Please, Sign In to add comment