This topic is currently marked as "dormant"—the last message is more than 90 days old. You can revive it by posting a reply.
1atlefren
I've figured out that it would be cool to be able to retrieve a random quote from a random book in my library and display it on my blog.
I know book quotes are in the common knowledge part, and can be accessed by the common knowledge API, and i've gotten as far with the "normal" api as to get the title, isbn etc of a random book.
What i thought to do next was to call the common knowledge api with the ISBN on my random book, retrieve the quotes (if any) and select a random one if there is more of them and display it.
pseudo-code:
get a random book (completed)
var randombook
call cc-api with randombook
if randombook has quotes
- get quotes
- if num_quotes >1 atlefren:
-- select random quote
- else
-- select the one quote
else (has no quotes)
- get new random book
- repeat untill we get a book with qoutes
any suggestions on how to accomplish this?
I know book quotes are in the common knowledge part, and can be accessed by the common knowledge API, and i've gotten as far with the "normal" api as to get the title, isbn etc of a random book.
What i thought to do next was to call the common knowledge api with the ISBN on my random book, retrieve the quotes (if any) and select a random one if there is more of them and display it.
pseudo-code:
get a random book (completed)
var randombook
call cc-api with randombook
if randombook has quotes
- get quotes
- if num_quotes >1 atlefren:
-- select random quote
- else
-- select the one quote
else (has no quotes)
- get new random book
- repeat untill we get a book with qoutes
any suggestions on how to accomplish this?
2timspalding
Oh, I was going to make one of these. Hmmm... Well, it's on my plan to do. I'm not sure what to use of yours, or whether you want to wait or not.
3atlefren
If you make it I could wait, as my knowledge of javascript is quite limited. And I can't figure out how to get hold of the the cc data from javascript..
So please, go ahead and make one for me ;)
Or give me a pointer on how to get the cc data
So please, go ahead and make one for me ;)
Or give me a pointer on how to get the cc data
