Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch WMs for aliased/equivalent URLs #92

Open
keithjgrant opened this issue Nov 9, 2017 · 4 comments
Open

Fetch WMs for aliased/equivalent URLs #92

keithjgrant opened this issue Nov 9, 2017 · 4 comments

Comments

@keithjgrant
Copy link

For any given page on my site, I have to fetch webmentions for four different equivalent URLs. Consider the page at http://keithjgrant.com/posts/2017/09/code-not-clojure/

If I want to check for WMs, its possible the trailing slash was left off the WM (I think my site currently adds the slash, but a previous iteration didn't). So to get all WMs, I have to fetch for these two URLs:
http://keithjgrant.com/posts/2017/09/code-not-clojure
http://keithjgrant.com/posts/2017/09/code-not-clojure/

This is a little annoying, but workable. But recently, I switched added SSL. WMs could have been sent before I made this switch (that is, without https in the target url) or after (with https). So now I have to fetch WMs for four URLs:
http://keithjgrant.com/posts/2017/09/code-not-clojure
http://keithjgrant.com/posts/2017/09/code-not-clojure/
https://keithjgrant.com/posts/2017/09/code-not-clojure
https://keithjgrant.com/posts/2017/09/code-not-clojure/

It seems silly (and a bit wasteful) to have to include all four permutations of this same url when fetching WMs from the API. I would like a way to provide the target URL once, and get back results for all four versions.

@aaronpk
Copy link
Owner

aaronpk commented Nov 9, 2017

This is tricky. At least with the API you can provide all the URLs in the same API call.

I'm not a huge fan of the idea of having to update previous webmentions when your URLs change. Keeping track of that sounds like a really hard problem. I also can't assume that a trailing slash is the same page as without, since other websites may serve different content at the two URLs.

Do you have any suggestions for how this could work?

@keithjgrant
Copy link
Author

I would probably suggest a flag that I could pass to the API—or possibly two flags: on for the trailing slash, another for http/s.

When the "include trailing slash" flag is set, it returns urls that match both with and without a trailing slash. When the "include https" flag is set, it returns urls that match both http and https.

@aaronpk
Copy link
Owner

aaronpk commented Nov 9, 2017

On second thought, I think I like the idea of hard-coding rules for "trailing slash" and http/https less than being able to update the webmentions received in webmention.io.

Here's a proposal: webmention.io can provide an API (and probably also a UI) where you'd give it an old URL that now redirects to your new URL. It would fetch that URL and see the redirect, then update any webmentions that were at the old URL to be associated with the new URL.

@keithjgrant
Copy link
Author

Sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants