Created
March 1, 2014 13:54
-
-
Save kb10uy/9290057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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