snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
703 stars 52 forks source link

[Silo Request] openlibrary #1633

Open yepstepz opened 7 months ago

yepstepz commented 7 months ago

Hi! I want to contribute to brid.gy and add an integration with OpenLibrary.

Would be great to get notifications about the books I read, and since Goodreads deprecated their API, the best option could be the OpenLibrary.

The easiest option is to start from the listening part. They do not have any oAuth options right now, but API is available for GET option: https://openlibrary.org/developers/api

So what I think:

Login

After you login into Brid.gy with your website (indie auth), check profile page from OpenLibrary (OL) that you added to the input. for instance, https://openlibrary.org/people/zpetspey is my OL account, and it has my site https://yepstepz.io, and I can add

html

<code>1    ...
2    &lt;a href="https://openlibrary.org/people/zpetspey" rel="me"&gt;&lt;/a&gt;
3    ...
</code>

to my site. It would be enough to show that I want to listen some updates.

Updates

There are a few pages that I would possibly crawl to get my updates from:

Bridgy could crawl it from time to time to get updates.

I don't see any eTag on curl -I request, but probably once in a day is ok.

Another interesting feature request could be to fetch year's goal and stats. Would be nice to get that updates from webmention.

Post

After crawling and getting updates, bridgy could form a post. There is a discussion about some properties here: https://github.com/microformats/h-entry/issues/10, so I need to research it further.

What do you think? I also have plans for investigating posting possibility, but wanted to check if this idea is ok with you.

(Originally published at: https://yepstepz.io/notes/04-openlibrary-proposal)

snarfed commented 7 months ago

Interesting, thanks for filing!

The vision and ideas here are pretty broad and wide-ranging. Could you give a specific example of an OpenLibrary post that you syndicated/cross-posted from an original post on your site, and the response(s) to it on OpenLibrary that you'd hope to backfeed to that original post as webmentions? And what existing microformats2 you'd expect those backfed responses to use? (We generally prefer to use existing, established microformats2 instead of new ones that aren't used in the wild anywhere yet.)

It also sounds like much of what you're interested in here is more like PESOS, ie copying posts from inside OpenLibrary back onto your site? PESOS is great, but it's generally out of scope for Bridgy specifically.

I'm still open to ideas here though! Especially if we can start with concrete examples.

yepstepz commented 7 months ago

The vision and ideas here are pretty broad and wide-ranging. Could you give a specific example of an OpenLibrary post that you syndicated/cross-posted from an original post on your site, and the response(s) to it on OpenLibrary that you'd hope to backfeed to that original post as webmentions?

Not on my web site, but I have this example https://gregorlove.com/2023/05/reading-funny-in-farsi/. As far as I know, you can't officially use goodreads API, so it's probably posted manually. So the idea is: I post a book that I started to read, somehow it was sent to the OL (you can make bots which could publish data, but let's say it has already been established) and got to the currently-reading list. Then I can mark is as read, abandon, rate, leave some review.

I understand that it is better to use existing tags. Probably u-bookmark-of for want to read, u-like-of for rating (could it be numeric?), u-tag-of for listing in different shelves, u-in-reply-to for review.

Furthermore, now I think that the listening part is not required for OL since you can't leave actual text reviews, just some general anonymous phrases. (example).

Should I research a possibility of sending this data to OL through brid.gy or abandon this idea completely?

snarfed commented 7 months ago

Thanks! That helps a bit.

It sounds like you're mostly interested in POSSEing your own reviews, ratings, "want to read," etc posts to OL? Except I don't see a write API for posting those things on https://openlibrary.org/developers/api . So you're thinking you'd post those in OL, on an existing book, and then Bridgy would send them back to your site via webmention? How would Bridgy find the corresponding "currently reading" post on your site? Would it look for a u-read-of pointing to the book on OL?

If you want your OL reviews, ratings, etc to turn into their own posts on your site, that's more PESOS/Micropub territory. If you're ok with them becoming comments or reactions on the original "currently reading" post on your site, though, webmentions and Bridgy could work!

If so, here are a couple places to start:

snarfed commented 7 months ago

Oh, and try out more of these features in OpenLibrary itself too! It looks like you only joined a week ago, https://openlibrary.org/people/zpetspey , and you've posted one "already read" book, but no reviews or ratings or progress updates or anything else?

yepstepz commented 7 months ago

Yeah, will try, sounds like a plan!

It looks like you only joined a week ago

yeah I tried to figure out how to build my book routine outside goodreads and thought it would be great to have mentions. I will give it a try surely, and hopefully will get back to this topic after some time :)

Thank you for guidance :)

gRegorLove commented 7 months ago

Hi @yepstepz!

Not on my web site, but I have this example https://gregorlove.com/2023/05/reading-funny-in-farsi/. As far as I know, you can't officially use goodreads API, so it's probably posted manually.

I make posts like that using Micropub requests, from https://indiebookclub.biz. It's a pretty basic tool: you enter title, author, and ISBN. You select one of the statuses: to-read, reading, and finished. If your site supports Micropub, it tries to publish the post to your site.

Sparkles is another Micropub client for posting books and it uses OpenLibrary search.

Separate from indiebookclub, on my site I set up a URL that will accept an ISBN then redirect to the OpenLibrary page. That's why if you click on the book title in my post https://gregorlove.com/isbn/9780307430991, it redirects to https://openlibrary.org/isbn/0307430995 (normalized ISBN-10), which OL redirects internally a couple times and ends up at https://openlibrary.org/books/OL24289154M/Funny_in_Farsi. Obviously not every book is in OL yet, so this redirection method does sometimes result in a 404 on OL, but it's worked most of the time for me.

If you have questions about Micropub, the IndieWeb community #dev channel is a good place. Ryan and I are both there, as well as helpful community members around the world. I can also answer questions about indiebookclub there if you try that out.