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

Store response data from sent webmentions #30

Closed
aarongustafson opened this issue Jun 26, 2017 · 9 comments
Closed

Store response data from sent webmentions #30

aarongustafson opened this issue Jun 26, 2017 · 9 comments
Milestone

Comments

@aarongustafson
Copy link
Owner

This bubbled up in #16. Should be easy enough.

It might also make sense to combine the (currently) two separate "outgoing" & "sent" webmentions files and track all of the details in one spot (as opposed ot having to work across two files.

@aarongustafson
Copy link
Owner Author

aarongustafson commented Jul 5, 2017

Integrating the webmention gem allows for this more easily. To make it happen thought, I need to do a few things:

  • Write a sent webmentions migration script
  • Figure out the best way to store responses
  • Implement the change

@aarongustafson aarongustafson added this to the 2.4 milestone Jul 5, 2017
@aarongustafson
Copy link
Owner Author

@miklb @martymcguire Are you just looking for me to store the response body or do you want headers and such too?

@miklb
Copy link

miklb commented Jul 6, 2017

@aarongustafson For me the response body would be enough.

@martymcguire
Copy link

martymcguire commented Jul 6, 2017 via email

@miklb
Copy link

miklb commented Jul 6, 2017

agreed the response code would be handy for debugging.

@aarongustafson
Copy link
Owner Author

So… assuming there’s not an location or server error, the response should provide an error object in the JSON, so that would get passed into the response body. The way I have things set up (and the way the webmentions gem processes the response), any failure will result in a false return. I currently have a false value as the default state that indicates a URL has not been mentioned. Storing false after a failed webmention would essentially keep it alive for the next run of the command. That sound good?

Here’s a look at the new, combined, format for outgoing webmentions with 3 failed webmentions and one success:

---
https://www.aaron-gustafson.com/jekyll/update/2017/06/20/welcome-to-jekyll.html:
  https://jekyllrb.com/docs/home: false
  https://github.com/jekyll/jekyll: false
  https://talk.jekyllrb.com/: false
  http://webmention.io/:
    status: queued
    summary: Webmention was queued for processing
    location: https://webmention.io/pingback/webmention/fZm5CkgNN6yuFWnc9NXw
    source: https://www.aaron-gustafson.com/jekyll/update/2017/06/20/welcome-to-jekyll.html
    target: http://webmention.io/

That work for you all?

@aarongustafson
Copy link
Owner Author

It’s worth noting that, for legacy purposes, I am adding a function to upgrade from the old two-file setup (queued and sent) to the combined file. For any webmentions that have been sent prior to the upgrade, I was planning to have the value be an empty string "". Any thoughts on that?

@aarongustafson
Copy link
Owner Author

agreed the response code would be handy for debugging.

I have some logs running during the build to let you know what’s going on:

[jekyll-webmention_io] Looking for webmention endpoint at https://jekyllrb.com/docs/home
[jekyll-webmention_io] No webmention endpoint at https://jekyllrb.com/docs/home
[jekyll-webmention_io] Looking for webmention endpoint at https://github.com/jekyll/jekyll
[jekyll-webmention_io] No webmention endpoint at https://github.com/jekyll/jekyll
[jekyll-webmention_io] Looking for webmention endpoint at https://talk.jekyllrb.com/
[jekyll-webmention_io] No webmention endpoint at https://talk.jekyllrb.com/
[jekyll-webmention_io] Looking for webmention endpoint at http://webmention.io/
[jekyll-webmention_io] Sending webmention of http://webmention.io/ in https://www.aaron-gustafson.com/
jekyll/update/2017/06/20/welcome-to-jekyll.html to https://webmention.io/pingback/webmention

I will likely slim these down for production and limit it to successes and failures an webmentioning only rather than reporting missing endpoints and such.

@miklb
Copy link

miklb commented Jul 7, 2017

👍

I recall seeing the logging commented out in the old plugin, was helpful for me when I was debugging some things.

Here's an example of how I was dumping a raw response from bridgy to a json data file so your example definitely looks cleaner. My hacked together Rakefile that generated that.

Mind you I switched away from Jekyll about 6 months ago, but intend to pick it back up for a new site soon, so will be able to dig in more.

Can't thank you enough for picking this back up and putting in so much work to create the gem.

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

3 participants