Closed Bug 954486 Opened 11 years ago Closed 11 years ago

Fix search API results (was: Generate Twitter entities if not available)

Categories

(Chat Core :: Twitter, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clokep, Assigned: florian)

References

Details

(Whiteboard: [1.1-wanted])

Attachments

(1 file, 1 obsolete file)

*** Original post on bio 1052 at 2011-09-27 12:33:00 UTC ***

As bug 954457 (bio 1022) suggests, the search API does not include entities (hashtags, @-usernames and links) in the JSON response we get.  Instead of special casing check if the entities exist, we should just generate them up front if they don't and allow our code to assume they do.
*** Original post on bio 1052 at 2011-09-27 13:23:13 UTC ***

Entities aren't the only quirk of tweets from the search API.

See also the "if ("results" in data)" test (and the code after it) in the onTimelineReceived method.

I think the good fix here would separate these code paths: add an onSearchResultsReceived (or something similar) method that would fix all the tweets before putting them in this._timelineBuffer.
Summary: Generate Twitter entities if not available → Fix search API results (was: Generate Twitter entities if not available)
Blocks: 954326
Whiteboard: [1.1-wanted]
Attached patch Patch v1 (obsolete) — Splinter Review
*** Original post on bio 1052 as attmnt 856 at 2011-10-03 12:24:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352599 - Flags: review?
Assignee: nobody → florian
Status: NEW → ASSIGNED
Attached patch Patch v2Splinter Review
*** Original post on bio 1052 as attmnt 857 at 2011-10-03 13:39:00 UTC ***

Significantly improved regexps, with Even's help :).
Attachment #8352600 - Flags: review?(clokep)
Comment on attachment 8352599 [details] [diff] [review]
Patch v1

*** Original change on bio 1052 attmnt 856 at 2011-10-03 13:39:22 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352599 - Attachment is obsolete: true
Attachment #8352599 - Flags: review?
*** Original post on bio 1052 at 2011-10-03 15:47:41 UTC ***

By the way, the twitter documentation for how this should work is some complicated ruby code: 

hashtag: https://github.com/twitter/twitter-text-rb/blob/master/lib/regex.rb#L106

mentions: https://github.com/twitter/twitter-text-rb/blob/master/lib/regex.rb#L47

(pasting the links so that I don't have to search for them again in the future)
Comment on attachment 8352600 [details] [diff] [review]
Patch v2

*** Original change on bio 1052 attmnt 857 at 2011-10-03 15:52:55 UTC ***

r+ if comments are added, especially for what the regular expression represents (links to documentation / examples would be nice).
Attachment #8352600 - Flags: review?(clokep) → review+
*** Original post on bio 1052 at 2011-10-03 18:06:47 UTC ***

I pushed this with several additional comments:
https://hg.instantbird.org/instantbird/rev/a44d8b4ec267
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: