You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've fiddled with the Kickstarter API a bit recently, and noticed that searches for updates/projects/comments can have a "count" parameter that defines the maximum number of results returned. If not specified, the API returns 10 results at a time. Non-numeric values or values less than 1 are treated as 1.
This functionality is easy enough to implement in Kickscraper by adding a "count" parameter to the relevant methods in client.rb, but I'm wondering if it might be better to accept a hash parameter. So we could call something like:
Alternatively, we could make things a little more explicit by creating something like a QueryParameters class and passing that around. I'd be happy to implement this either way, but figured I'd see how the maintainers feel before running off in an unproductive direction.
The text was updated successfully, but these errors were encountered:
Hey @ajkerrigan, this sounds good. I personally like the idea of the hash, because it keeps things simple and it's easy and flexible.
The one thing I would say is that any functions accepting the hash should still accept a string (or whatever they accepted before), so they can work either way. That might be a bit "railsy", but it's very convenient if they can accept a string or a hash and just work.
I agree with @benrugg in that I prefer the hash, although I think I'd prefer to keep the required field as the string and then have a hash of the optionals, especially as the current search_projects method takes a page = nil with the required field of query. E.g.:
I meant to reply to this earlier, but yes, the format you just wrote out @jamlen is what I should have said. (I haven't been in the code of kickscraper for too long!)
I've fiddled with the Kickstarter API a bit recently, and noticed that searches for updates/projects/comments can have a "count" parameter that defines the maximum number of results returned. If not specified, the API returns 10 results at a time. Non-numeric values or values less than 1 are treated as 1.
This functionality is easy enough to implement in Kickscraper by adding a "count" parameter to the relevant methods in client.rb, but I'm wondering if it might be better to accept a hash parameter. So we could call something like:
Alternatively, we could make things a little more explicit by creating something like a
QueryParameters
class and passing that around. I'd be happy to implement this either way, but figured I'd see how the maintainers feel before running off in an unproductive direction.The text was updated successfully, but these errors were encountered: