diff options
author | trizen <trizen@protonmail.com> | 2020-02-27 08:54:42 +0200 |
---|---|---|
committer | trizen <trizen@protonmail.com> | 2020-02-27 08:54:42 +0200 |
commit | 70665dfdba007791e7f8c8595fa7aba26449b32a (patch) | |
tree | 2e0dfee992b2953c8b31143b5937281b94adf3c5 /lib | |
parent | 3bb78645fd553b3d58b222931c4828e373cc49c3 (diff) | |
download | fair-viewer-70665dfdba007791e7f8c8595fa7aba26449b32a.tar.lz fair-viewer-70665dfdba007791e7f8c8595fa7aba26449b32a.tar.xz fair-viewer-70665dfdba007791e7f8c8595fa7aba26449b32a.zip |
Added support for next pages of comments.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/WWW/StrawViewer.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/WWW/StrawViewer.pm b/lib/WWW/StrawViewer.pm index 5f0ae02..934dfc9 100644 --- a/lib/WWW/StrawViewer.pm +++ b/lib/WWW/StrawViewer.pm @@ -998,6 +998,20 @@ sub post_as_json { $self->_save('POST', $url, $json_str); } +sub next_page_with_token { + my ($self, $url, $token) = @_; + + my $pt_url = ( + $url =~ s{[?&]continuation=\K([^&]+)}{$token} + ? $url + : $self->_append_url_args($url, continuation => $token) + ); + + my $res = $self->_get_results($pt_url); + $res->{url} = $pt_url; + return $res; +} + sub next_page { my ($self, $url) = @_; |