Skip to content

Instantly share code, notes, and snippets.

@jonnybarnes
Created March 12, 2014 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonnybarnes/9509247 to your computer and use it in GitHub Desktop.
Save jonnybarnes/9509247 to your computer and use it in GitHub Desktop.
Webmentions pseudocode
1. Check that both a target and source value has been sent with the mention
2. Parse target URL and check it actually points to something on my site
3. Attempt to get the content from source
4. Check if any of my saved webmentions are from this source already
5. If so check the saved webmentions has the same target (someone's note could mention two of my notes for example)
6. If not goto 10.
7. If yes then check the source still "mentions" the target, i.e. check the 'in-reply-to' values from the source HTML
8. If not delete the saved webmention
9. If so update the information in the saved webmention
10. No saved webmention so save this as a new entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment