Adding review support to Breakfast and Coffee
Published on under the IndieWeb category.Toggle Memex mode

Breakfast and Coffee is a place to share information about breakfast and coffee shops you have visited, with a twist: where possible, contributions should come from personal websites rather than directly through the website editing interface. Breakfast and Coffee is a MediaWiki. This gives the site a lot of features like categories, a good page editor, and edit tracking out of the box. But, the site accepts Webmentions. When Breakfast and Coffee receives a webmention, it tries to create an entry on the wiki.
In the first version of Breakfast and Coffee, built earlier this year, I had a script that accepted a webhook request from webmention.io, a Webmention receiver, and made a page based on the contents of the page. With this script in place, I created pages for a few of my favourite cafes in Edinburgh, such as Lowdown Coffee and Fortitude Coffee. This setup let me publish information about coffee shops and breakfast spots on my website and have a syndicated copy show up on the wiki.
This week, I worked on a new feature: syndicate a review to the wiki.
This feature works in a similar way to the original function that let you syndicate a blog post about an eatery to the wiki in that when the wiki receives a webhook from webmention.io, a post is created. But, what happens after that is a bit different.
Flow to create an entry
Here's what happens when you submit a h-review to the Breakfast and Coffee wiki:
- The wiki retrieves a h-review from a provided blog post that has sent a webmention to Breakfast and Coffee.
- The wiki extracts relevant information from the review, such as the review title and description.
- The wiki tries to extract a h-geo object, if possible. This can be used to add a map and address to a page with help from the Nominatim API, which provides more data about a location given its latitude and longitude.
- Creates an aggregate review that totals up all of the reviews on the page. This lets you see, for example, that a cafe is voted 5/5 stars across all reviews on average, or 2.1/5 stars on average.
If a wiki page does not exist, Breakfast and Coffee creates a new page. The title of the page is determined by the title of the h-review, although I might change this further down the line because it requires people to follow a specific convention for titles. If a wiki page does exist, the review in the submitted h-review will be added to the "Reviews" section of the page.
Since adding the h-review logic, I have had to revisit the original logic that lets someone create a page from their personal website. I will need to make some changes to that the "reviews" section of a page is preserved even if someone edits the page from their personal website and has not copied the reviews. This ensures people using the wiki don't accidentally overwrite the reviews. Also, because the reviews are marked up using HTML microformats, it would be more work for someone who is editing a page to copy that.
How a review appears on the wiki and next steps
Here is an example of a review I posted on my website:
And here's how it showed up on Breakfast and Coffee:
This wiki page was created entirely from a h-review on my website. Breakfast and Coffee extracted my rating, displayed it on the wiki, created a map for the location with its address, and created an aggregate review. I can even edit this page from the MediaWiki UI (and soon from my personal website) to add more information to the page.
After I had the h-review submission logic working, I syndicated all of my cafe reviews to the wiki. There are now a dozen or so cafes in Berlin and the UK listed on Breakfast and Coffee. These were all first written on my personal website then were syndicated to Breakfast and Coffee. A link exists to the original reviews from each wiki page in case you want to read the review on my site (although there isn't any extra information on my website for each review!).
With this setup, I can:
- Create a review on my website that is styled with the theme of my website.
- Submit a review to Breakfast and Coffee so someone looking at a particular eatery can see my review.
- Have my reviews aggregated on the "city" pages on Breakfast and Coffee so someone can see my checkins when exploring the Breakfast and Coffee wiki by city.
I am excited by this. I hope to see some IndieWeb community members make contributions to explore the idea of syndicating reviews from personal websites further.
Tagged in web, IndieWeb, Breakfast and Coffee.
Responses
Comment on this post
Respond to this post by sending a Webmention.
Have a comment? Email me at readers@jamesg.blog.