バグ #1233 » 0001-html-entity.patch
core/plugin/twitter/model/message.rb | ||
---|---|---|
636 | 636 |
def body |
637 | 637 |
self[:message].to_s.freeze |
638 | 638 |
end |
639 |
alias_method :description, :body |
|
639 | ||
640 |
def description |
|
641 |
self[:message].to_s.gsub(Plugin::Twitter::Message::DESCRIPTION_UNESCAPE_REGEXP, &Plugin::Twitter::Message::DESCRIPTION_UNESCAPE_RULE) |
|
642 |
end |
|
640 | 643 | |
641 | 644 |
# Message#body と同じだが、投稿制限文字数を超えていた場合には、収まるように末尾を捨てる。 |
642 | 645 |
def to_s |
core/plugin/twitter/twitter.rb | ||
---|---|---|
364 | 364 |
def score_by_entity(tweet) |
365 | 365 |
score = Array.new |
366 | 366 |
cur = 0 |
367 |
text = tweet.description
|
|
367 |
text = tweet.body
|
|
368 | 368 |
tweet[:entities].flat_map{|kind, entities| |
369 | 369 |
case kind |
370 | 370 |
when :hashtags |
... | ... | |
466 | 466 |
uri: user.uri, |
467 | 467 |
reference: user) |
468 | 468 |
else |
469 |
screen_name = user_entity[:screen_name] || tweet.description[Range.new(*user_entity[:indices])]
|
|
469 |
screen_name = user_entity[:screen_name] || tweet.body[Range.new(*user_entity[:indices])]
|
|
470 | 470 |
Diva::Model(:score_hyperlink).new( |
471 | 471 |
description: "@#{screen_name}", |
472 | 472 |
uri: "https://twitter.com/#{screen_name}") |