Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set maximum linecount #40

Open
NicoleJaneway opened this issue Jul 3, 2021 · 4 comments
Open

Set maximum linecount #40

NicoleJaneway opened this issue Jul 3, 2021 · 4 comments

Comments

@NicoleJaneway
Copy link

NicoleJaneway commented Jul 3, 2021

Is there a way to set a maximum linecount when returning random poems? Thanks!

@jamogriff
Copy link

@NicoleJaneway In a way, yes. poetrydb.org/linecount/x where x is an integer of your choosing returns poems with exactly that line count. For example, for x = 10, the endpoint will only return poems that have a line count of ten. I made a helper method for my use case to generate a random number up to my desired max line-count to hit the API to kind of simulate max line-count.

@NicoleJaneway
Copy link
Author

Thanks, @jamogriff

Right now, the workaround I'm using is to requery the API if the random poem returned has a line length > the desired maximum.

@mystictide
Copy link

Please reconsider adding a maximum linecount.

@sebastian-j-ibanez
Copy link

I would absolutely love this functionality!

It would also reduce traffic, since users would not need to requery the API when the poem length is larger than what they need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants