Coder Social home page Coder Social logo

Profile h-card about indiewebring.ws HOT 1 OPEN

Ruxton avatar Ruxton commented on May 29, 2024
Profile h-card

from indiewebring.ws.

Comments (1)

martymcguire avatar martymcguire commented on May 29, 2024

Hey @Ruxton ! Thanks for looking at the webring!

You can find the code that handles finding representative h-card here:

https://github.com/martymcguire/indiewebring.ws/blob/master/lib/representative-h-card.js

The TL;DR is:

  • it uses the (somewhat outdated) microformat-node library to parse the page and return any h-cards found.
  • it checks for a card with both url and uid that point to the url they entered for their homepage. if it finds one, it uses it.
  • it checks for a card with a url that is also marked as rel="me" somewhere on the page
    • looks like i have a bug in this code! not sure if it's impacting your case, but it will result in taking the first card returned by microformat-node if there is any link on the page with rel="me" pointing to the homepage url.
  • finally, if there is only one card, and it has url matching the homepage url, it takes that.

I'm a bit constrained by the results of microformat-node, but I'm open to suggestions and PRs on improving this algorithm!

from indiewebring.ws.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.