public
Description: Read an RSS feed (even HTTPS with authentication) and rebroadcast it to a Twitter account.
Clone URL: git://github.com/trak3r/rss2twitter.git
Added Trac-specific munging to message to save precious characters
trak3r (author)
Mon Apr 28 11:04:27 -0700 2008
commit  7d4ea5bbc89e595f0ffa9e0908683b43d6cf886f
tree    e213f07ea161fea58da389a6f3830cab799c72ce
parent  21252d7a8f69c767800602744ef7d79d3d2431cf
...
73
74
75
 
 
 
 
76
77
 
78
79
80
...
73
74
75
76
77
78
79
80
 
81
82
83
84
0
@@ -73,8 +73,12 @@ class Item < ActiveRecord::Base
0
     @cached_short_url ||= ShortURL.shorten(self.link, :tinyurl)
0
   end
0
   
0
+ def munged_title
0
+ @cached_munged_title ||= sprintf( "%s %s", *self.title.scan( /^Changeset \[(.*?)\]\: (.*)/ ).flatten )
0
+ end
0
+
0
   def to_s
0
- "#{self.title[0..(tweet_limit-self.short_url.length)]} #{self.short_url}"
0
+ "#{self.munged_title[0..(tweet_limit-self.short_url.length)]} #{self.short_url}"
0
   end
0
 end
0
 

Comments

    No one has commented yet.