aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-02-27 08:54:42 +0200
committertrizen <trizen@protonmail.com>2020-02-27 08:54:42 +0200
commit70665dfdba007791e7f8c8595fa7aba26449b32a (patch)
tree2e0dfee992b2953c8b31143b5937281b94adf3c5 /lib
parent3bb78645fd553b3d58b222931c4828e373cc49c3 (diff)
downloadfair-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.pm14
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) = @_;