Skip to content

Instantly share code, notes, and snippets.

@mashiro
Created April 26, 2010 05:36
Show Gist options
  • Select an option

  • Save mashiro/379008 to your computer and use it in GitHub Desktop.

Select an option

Save mashiro/379008 to your computer and use it in GitHub Desktop.
公式RTに♺をつける
import re
from Misuzilla.Applications.TwitterIrcGateway.AddIns.DLRIntegration import DLRIntegrationAddIn
rt_symbol = unichr(0x267A)
rt_color = 10
def color(str, num):
return '%c%s %s' % (chr(0x03), num, str)
def OnPreSendMessageTimelineStatus(sender, e):
if hasattr(e.Status, "RetweetedStatus"):
if e.Status.RetweetedStatus != None:
e.Text = "%s %s" % (color(rt_symbol, rt_color), color(e.Text, 1))
def OnBeforeUnload(sender, e):
CurrentSession.PreSendMessageTimelineStatus -= OnPreSendMessageTimelineStatus
CurrentSession.PreSendMessageTimelineStatus += OnPreSendMessageTimelineStatus
CurrentSession.AddInManager.GetAddIn(DLRIntegrationAddIn).BeforeUnload += OnBeforeUnload
@mashiro
Copy link
Author

mashiro commented Apr 26, 2010

RTしてもRetweetedStatusがないっぽいのが謎
Coreのバージョン変えたんだっけかなー覚えてない

@mashiro
Copy link
Author

mashiro commented Apr 27, 2010

実は動いてた。謎。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment