Page MenuHomePhabricator
Paste P3256

scripts/ - v1.0

Authored by darthbhyrava on Jun 16 2016, 4:29 AM.
# -*- coding: utf-8 -*-
A script which takes a post ID on a Flow Board and thanks it on behalf of the
user logged in.
Syntax: python thanks -flow_post:[post_id]
-flow_post: The value of the postID to be thanked.
from __future__ import absolute_import, unicode_literals
import pywikibot
def thank_flow_post(post_id):
Thank the given Post ID on a Flow Board on behalf of the user logged in.
#Login into the side
site = pywikibot.Site()
#Make Thank API call to site, and print result
result = site.thank_flowpost(post_id)
print result
def main(*args):
Proces command line arguments and thank the post
local_args = pywikibot.handle_args(args)
for arg in local_args:
option, sep, value = arg.partition(':')
if option == '-flow_post':
post_id = value
if __name__ == "__main__":