thundercomb / poetrydb Goto Github PK
View Code? Open in Web Editor NEWThe Internet's first Poetry API
Home Page: http://poetrydb.org
License: GNU General Public License v2.0
The Internet's first Poetry API
Home Page: http://poetrydb.org
License: GNU General Public License v2.0
Out of curiosity, where is the data sourced from?
Hi,
It seems like /authors only returns the first 128 authors. How do I get the rest?
@thundercomb Do you know what parameters should I retrieve and pass in AJAX for getting a random poem? I tried understanding the ruby one but unfortunately I don't know ruby.
If I query the following URL
http://poetrydb.org/linecount/5
then the output contains poems with the number of lines where 5 is encountered in linecount at any place.
To clarify,
For the above url, the output will contain poems with linecount as 25, 50, 105, 5, 15, etc.
If you specify it as http://poetrydb.org/linecount/10 it will return poems with linecount as 103, 105, 10, 100, etc.
So, basically there is a string.contains comparison that is taking place instead of a string.equals comparison.
Expand test cases to be more reflective of the different types of API calls.
It would be useful to expand the test cases to cover the various types of documented end points, particularly the different types of input fields, and a good variety of combination searches.
The existing tests for failure cases appear to be fairly comprehensive already.
When searching by title, I noticed that the search seems to be case-sensitive. Could you modify the code to make it case insensitive?
I'm trying to grab "Song (Go And Catch A Falling Star)" by John Donne via requests in python, but I think the url is not being encoded properly. If I paste "http://poetrydb.org/title/Song (Go And Catch A Falling Star)/lines.json" into the address bar, I get a 404. How do I properly format this request?
First of all, thanks for the great project 👍
And a question/suggestion here (potentially can help with a PR, if it's not opposed some internalized ideas/plans). Would be a big deal to add a Swagger (OAS) docs here for the API? Or maybe they are already present in some way?
There is already a simple endpoint to return a single random poem:
/random
It would be useful to combine this with other searches, for example to return 5 random Shakespeare sonnets:
/author,title,random/Shakespeare;Sonnet;5
Given the existing poemcount input and search fields, random
and poemcount
should be mutually exclusive.
I was building an api for my poetry. Is it ok to collaborate so I can include my poetry in poetry dB?
Hi,
Came across this. Amazing job. Great going.
Can you please share how to use this API with little more information for GET, POST, PUT methods?
Thanks in advance.
The following request returns a poem that is 200 lines long (as indicated by its return linecount):
http://poetrydb.org/author,title/Algernon%20Charles%20Swinburne;Hymn%20Of%20Man/all.json
However, when I make the request below including the linecount as a search term, a 404 is returned:
http://poetrydb.org/author,title,linecount/Algernon%20Charles%20Swinburne;Hymn%20Of%20Man;200/all.json
Any ideas?
Are there statistics on how many poems and poets there are in this database?
I would like to use this api to get a random poem.
Hi, the documentation for the project is really good! But there seems to be some formatting errors towards the end of the README.md. If you go down and a little bit after the "Combinations" section, you can see that the code blocks are the titles, and the titles are in the code blocks
Guys I'm calling the API like this:
$(document).ready(function() { $("#submit").click(function(event) { var poet = $("#poet").val(); var title = $("#title").val(); var reppoet = poet.replace(" ", "%20"); var reptitle = title.replace(" ", "%20"); var url = <es6backtick>http://poetrydb.org/title,author/${reptitle};${reppoet}/author,title,linecount,lines.json</es6backtick>; $.ajax({ type: 'GET', url: url, success: function(data) { console.log(data); }, error: function(url){ console.log('Error!'+url); } }); }); });
It always goes to error and returns
"Error![object Object]"
Please help me out
Could you please provide API in HTTPS protocol?
The following URL returns a 500 Internal Server Error, even though it's using the title supplied by the API:
Can I search a term across all input fields? For example, I'll search for poems with "William" on either title, author, or lines. Thanks.
Hey I used your api for a small telegram bot for a friend who likes poems, She loves Emily Dickinson and I found one of them poems she likes missing. Is there a way we can add to the database ? or maybe you can ?
https://www.poemhunter.com/poem/forbidden-fruit-a-flavor-has/
also really cool project. Many thanks😄
For some reason https://poetrydb.org/random is heavily biased towards returning P. B. Shelley and Byron poems. Is this by design or it can be fixed somehow?
Is there any way we can add or contribute to the database? There's a ton of poems I'd love to see in here!
Gunctionality for including a link to a web page with the author's information. Webpage can be authors personal webpages or the webpage from a larger poetry database
Hi,
I was wondering if there could be a simple endpoint added to gather a random poem?
Thanks!
First the problem: when trying to search for two terms, authors in this case: this does not appear to give the results I believed I should expect... maybe I am misunderstanding something?
http://poetrydb.org/author/austen;bowles/title
Secondly, thank you so much for this wonderful database! It is invaluable for teaching about how to access apis with kids learning to code.
Thirdly, I know this isn't a support forum! But I promise I have tried to read the docs carefully :-) If I have simply misunderstood the api documentation, when I understand it, I promise I will write a suggested addition to the help files for people like me who are too dumb to work it out!
Best wishes
Upon querying the API, or visiting poetrydb.org, the following message is displayed:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
You can do this from the Heroku CLI with the commandheroku logs —tail
Is there a way to set a maximum linecount when returning random poems? Thanks!
Some of my calls return a large amount of information, which is a lot to download and takes more time than is expected by most users. Is there a way to limit the number of results?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.