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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some guidance #4

Open
wottpal opened this issue Aug 4, 2017 · 6 comments
Open

Some guidance #4

wottpal opened this issue Aug 4, 2017 · 6 comments

Comments

@wottpal
Copy link

wottpal commented Aug 4, 2017

Hey sebsel,
first thanks for all your work (will need your queue very soon for a project 馃槝)!

I'm actually building my very first blog right now and have never done anything with webmentions before. I still have to get my head around the concept at all, sorry!

My basis questions are: How do I get this thing working? And how do I test that's working?

I've did everything the Readme says under install and tried to send something with this tool to my live beta-domain (not localhost, no I am not that dumb :D). But the <div class="webmentions"></div> stays empty :(

I've also tried to add the webmentions.new hook in my config, but I am not sure how to identify the corresponding post and how to save the information :/ Can you provide me with your hook-code?

Would be so great if you could help me in any manner,
Dennis from Germany

@sebsel
Copy link
Owner

sebsel commented Aug 4, 2017

Hmz!

First off: I am working on a completely new Webmentions plugin, because this one is kind of a mess. But it's not finished at all and needs more work, so you're kind of stuck with this one for now.

This plugin does two things: receiving webmentions and sending webmentions. Those are related, but very different actions. The tool you linked is called "Send webmentions" and the <div class="webmentions"> contains the received webmentions, so I think you are trying to compare two different actions :)

Sending

The sending of the webmentions happens automatically. If you go to your post, in the content folder, you will see a .mentions folder with a pings.json in it. This file will contain a JSON array of all the URLs it found, and the different endpoints for those URLs. (If it's [], it means it did not find any links.)

To send webmentions again, delete the pings.json file, and re-visit the page (on the front end, not in the panel, I am going to change this in the new plugin). You will then see the file is created again, with all the new information about the webmentions you just sent.

To test sending the mentions, you can use webmentions.rocks, which has a great collection of tests. Only number 13 is currently failing for my site, but the rest should work. Just create a post with all those links in the text field, and keep removing 'em pings.json till you got them ;)

Receiving

There is also a receiver test on Webmention.rocks. If you want to ping yourself, you can also create a .html that mentions your test post and just send a POST request yourself. An example:

<div class="h-entry">
<a class="u-author h-card" href="http://example.com">Example Author</a> likes
<a class="u-like-of" href="http://yoursite.example/your-test-post">this post</a>.
</div>

Replace http://yoursite.example/your-test-post with your own test post URL.

Then send a POST request with target and source to your test site /webmention. For example by using this form:

<form action="http://yoursite.example/webmention" method="post">
<input name="target" value="http://yoursite.example/your-test-post">
<input name="source" value="http://example.com/the-url-to-the-above-html-doc">
<input type="submit">
</form> 

Hope these things help!

@wottpal
Copy link
Author

wottpal commented Aug 9, 2017

Hey,
first thanks for your amazing help! 馃
At least I got something to work:

  1. Under .webmentions/ping.json it successfully stores all outgoing mentions
  2. When I target my post by creating a HTML-file like you described I get a success-message {"status":"success","code":200,"message":"Yay","data":202} and it generates a .webmentions/0-c1706852f58846c95327492eb487b6f1a5e4a0e9.json file with the correct content of the mention. (I've attached it below)

But it still doesn't display any of these in the page :/

{  
   "author":{  
      "name":"Example Author",
      "photo":false,
      "url":"http:\/\/twitter.com\/wottpal"
   },
   "published":false,
   "name":false,
   "text":"Example Author likes\nthis post.",
   "url":false,
   "type":"like",
   "source":"http:\/\/wottpal.dev\/test.html"
}

@sebsel
Copy link
Owner

sebsel commented Aug 18, 2017

And you have <?php echo webmentions() ?> in your template? That function should display all received webmentions for a specific page. (All the mentions in the .mentions-folder for that page.)

@wottpal
Copy link
Author

wottpal commented Aug 19, 2017

Yep! Both .json files are under .webmentions but <?php echo webmentions() ?> only produces an empty div :(
How should I debug that?

@sebsel
Copy link
Owner

sebsel commented Sep 2, 2017

My standard way of debugging things is just adding die(':('); to random places in the code, and see when I see a :( on the page and when not. Then you know which code gets executed ;)

It sounds a bit like the snippets (in the snippets folder of this plugin) are not loaded. They should, so it would be a but if they don't.

Unfortunately, I don't have time to debug for you, now, and the time I do have, I would like to invest in writing my new Webmentions plugin. I will bump that one on my todo-list. Hope you get this one to work, still. It works for me, so there must be a way. Next one will be more reliable :)

@wottpal
Copy link
Author

wottpal commented Sep 4, 2017

I see if I have time to debug this or just wait for your new plugin. Really looking forward to it :)

Dennis

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

No branches or pull requests

2 participants