whim icon indicating copy to clipboard operation
whim copied to clipboard

add a /wms route that returns json

Open yanick opened this issue 5 years ago • 4 comments

This is a first, half-hapharded stab at it, but maybe it can be useful to start on #8

yanick avatar Jul 17 '20 16:07 yanick

I reacted to this pull request with both joy and horror -- the latter entirely due to witnessing someone else trying to use Web::Mention's very sub-par JSON methods, dashed off two years ago for a single, now-obsolete use-case, and never revised since then.

I could not let that stand, and so we have this entirely separate pull request: https://github.com/jmacdotorg/webmention-perl/pull/10 Could you please check it out at your convenience? It adds new JSON serialization/deserialization methods to Web::Mention.

If this seems like a good improvement to Web::Mention, then I'd like to change this PR's implementation to the following:

  • Letting Whim::Mention subclass TO_JSON so that it sticks the photo-hash value into the returned data structure
  • Invoking $wm->as_json instead of $wm->TO_JSON, since I'd rather let that be the public interface for serialization

And this should obviate the need to manually define all the author info, too.

jmacdotorg avatar Jul 18 '20 20:07 jmacdotorg

I reacted to this pull request with both joy and horror -- the latter entirely due to witnessing someone else trying to use Web::Mention's very sub-par JSON methods, dashed off two years ago for a single, now-obsolete use-case, and never revised since then.

Keep a skeleton in your closet long enough, someone is bound to find it and want to play the xylophone with it. ^.^

I could not let that stand, and so we have this entirely separate pull request: jmacdotorg/webmention-perl#10 Could you please check it out at your convenience? It adds new JSON serialization/deserialization methods to Web::Mention.

If this seems like a good improvement to Web::Mention, then I'd like to change this PR's implementation to the following:

* Letting Whim::Mention subclass `TO_JSON` so that it sticks the photo-hash value into the returned data structure

* Invoking `$wm->as_json` instead of `$wm->TO_JSON`, since I'd rather let that be the public interface for serialization

And this should obviate the need to manually define all the author info, too.

It all get :heart: from me. Wunderful. And thanks!

yanick avatar Jul 18 '20 21:07 yanick

I've released version 0.720 of Web::Mention, and encourage you to make use of that towards the two changes I suggested yesterday.

I don't want to overwhelm you with lots of change requests at one, so let's take this in steps! Be assured that your contribution yesterday opened my eyes to how this is a simpler enhancement than I had earlier feared, so I'm excited to see it happen.

jmacdotorg avatar Jul 19 '20 19:07 jmacdotorg

I've released version 0.720 of Web::Mention, and encourage you to make use of that towards the two changes I suggested yesterday.

Woo! Awesome!

I don't want to overwhelm you with lots of change requests at one, so let's take this in steps! Be assured that your contribution yesterday opened my eyes to how this is a simpler enhancement than I had earlier feared, so I'm excited to see it happen.

Heh heh. I am hard to overwhelm, so don't worry too much on my behalf. Still, thanks for the gentle approach. :-)

And, inversely, please be comfortable to deal with my PRs at your pace, and don't hesitate to ask for tweaks, or just say "thanks, but no thanks" to any of them. I typically like to send more than less, as even if they are not ultimately merged in, they can still trigger discussions and unexpected considerations. Which they seem to be doing here fabulously. :-)

yanick avatar Jul 19 '20 20:07 yanick