File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ defmodule Chuko.Api.Anibis do
3131 |> Req . get! ( put_in ( options [ :params ] [ :ps ] , 1 ) )
3232 |> then ( fn % Req.Response { body: body } -> body [ "pagingInfo" ] [ "totalItems" ] end )
3333
34- pages = ceil ( amount / 120 )
34+ pages =
35+ ceil ( amount / 120 )
36+ # Capping for rate limit reasons
37+ |> then ( & if & 1 > 5 , do: 5 , else: & 1 )
3538
3639 1 .. pages
3740 |> Task . async_stream (
Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ defmodule Chuko.Api.Ricardo do
2626 |> Req . get! ( )
2727 |> then ( fn % Req.Response { body: body } -> body [ "totalArticlesCount" ] end )
2828
29- pages = ceil ( amount / 60 )
29+ pages =
30+ ceil ( amount / 60 )
31+ # Capping for rate limit reasons
32+ |> then ( & if & 1 > 10 , do: 10 , else: & 1 )
3033
3134 1 .. pages
3235 |> Task . async_stream (
Original file line number Diff line number Diff line change @@ -297,7 +297,8 @@ defmodule Chuko.Api.TuttiGql do
297297 |> then ( fn % Req.Response { body: body } ->
298298 body [ "data" ] [ "searchListingsByQuery" ] [ "listings" ] [ "totalCount" ]
299299 end )
300- |> then ( & if & 1 > 3000 , do: 3000 , else: & 1 )
300+ # Max is 3000 but capping at 500 for rate limit reasons
301+ |> then ( & if & 1 > 500 , do: 500 , else: & 1 )
301302
302303 0 .. floor ( amount / 100 )
303304 |> Enum . map ( & ( & 1 * 100 ) )
You can’t perform that action at this time.
0 commit comments