Bug 340795 - Browsing results "pages" does not work
Summary: Browsing results "pages" does not work
Status: RESOLVED FIXED
Alias: None
Product: choqok
Classification: Applications
Component: Twitter (show other bugs)
Version: Git
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Mehrdad Momeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-09 18:16 UTC by Ian Schwarz
Modified: 2020-02-06 09:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.6


Attachments
Removes "browsing" buttons, adds very basic "load" more functionality (15.42 KB, patch)
2014-11-14 22:48 UTC, Ian Schwarz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Schwarz 2014-11-09 18:16:39 UTC
When performing a custom search (e.g. "tweets by $person", "tweets containing $searchterm" etc.), you are displayed 50 (or however many the preference is set to, maximum of 100) tweets matching the criteria. Two push buttons are displayed (previous and next) and a page number appears. However, upon entering a different page than "1", no results are displayed.
Twitter does not work with pages. I don't know if there is a way to make it work with pages, but Twitter results are not returned in "pages"--instead, they make use of since_id and max_id parameters.
It is relatively easy to isolate the "max_id" you should include in your query to get the next set of results, e.g. in void TwitterSearch::searchResultsReturned(KJob* job): 
QString nextMaxId = QUrl(parser.parse(jj->data(), &ok).toMap()["search_metadata"].toMap()["next_results"].toString()).queryItemValue("max_id"); Unfortunately, I have so far been unable to change twitterapisearchtimelinewidget.cpp to make use of this information.

Reproducible: Always

Steps to Reproduce:
1. Open a Twitter search tab in Choqok.
2. Click "next page"

Actual Results:  
All pages except page 1 are empty.

Expected Results:  
More results should be shown on pages 2, 3, etc.
Comment 1 Ian Schwarz 2014-11-14 22:48:39 UTC
Created attachment 89589 [details]
Removes "browsing" buttons, adds very basic "load" more functionality

My efforts as of today. I have removed the dysfunctional browsing elements and added a "load more tweets" button in their place. Note that as of now, it only works the SECOND time it is pressed and it does not display an error message etc. if there are no more tweets to be found. Also, older tweets are added on top of the newer ones. I am finding out how to do that next.
Comment 2 Mehrdad Momeny 2016-03-28 02:17:55 UTC
(In reply to Ian Schwarz from comment #1)
> Created attachment 89589 [details]
> Removes "browsing" buttons, adds very basic "load" more functionality
> 
> My efforts as of today. I have removed the dysfunctional browsing elements
> and added a "load more tweets" button in their place. Note that as of now,
> it only works the SECOND time it is pressed and it does not display an error
> message etc. if there are no more tweets to be found. Also, older tweets are
> added on top of the newer ones. I am finding out how to do that next.

Thanks for sharing your efforts.
However, we use KDE review board[1] to review and apply patches. Also, please submit a finalized patch.

[1] https://git.reviewboard.kde.org/r/
Comment 3 Ian Schwarz 2016-12-29 11:42:13 UTC
Seems fixed as of 1.6, at least. Nice work!