Skip to content

Instantly share code, notes, and snippets.

@kb10uy
Created March 1, 2014 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kb10uy/9290057 to your computer and use it in GitHub Desktop.
Save kb10uy/9290057 to your computer and use it in GitHub Desktop.
#coding: shift-jis
import clr
from Kbtter import *
from System import *
from TweetSharp import *
from System.Text import *
from System.Text.RegularExpressions import *
class Plugin(IKbtterTweetPlugin):
def OnTweet(self,svc,user,st):
reg=Regex("@"+user.ScreenName+"\\s+update_name\\s+(?<name>.+)\\s?")
m=reg.Match(st.TextDecoded)
if m.Success :
print "Rename : "+m.Groups["name"].Value
op=UpdateProfileOptions()
op.Name=m.Groups["name"].Value
svc.UpdateProfile(op)
tw=SendTweetOptions()
tw.Status="@" +st.User.ScreenName+ " " +m.Groups["name"].Value+" に改名しました"
tw.InReplyToStatusId=st.Id
print tw.Status
svc.SendTweet(tw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment