#dev 2017-07-22

2017-07-22 UTC
[kevinmarks], tantek, eli_oat, KartikPrabhu, Defenest_, snarfed, Defenestrate and j12t joined the channel
#
loqi.me
edited /monoculture (+82) "[kevinmarks] added "https://medium.com/@VitalikButerin/the-meaning-of-decentralization-a0c92b76a274" to "See Also""
(view diff)
mblaney joined the channel
#
mblaney
my reader does the same as monocle. if a u-photo is found in e-content, it gets skipped.
#
mblaney
once all the u-photo's have been checked for duplicates, if there's more than one I put them in a lightbox.
#
mblaney
I haven't added the UI yet to create photo posts myself (I would like to though), but I'm still adding u-photo to images in my post for brid.gy.
#
mblaney
I actually check to see if I'm POSSE'ing via brid.gy, and only add u-photo in that case.
j12t joined the channel
#
vanderven.se martijn
edited /IndieAuth (+1527) "Add argument for adding authorization endpoint declaration to the how-to."
(view diff)
KevinMarks, jeremycherfas and j12t joined the channel
#
vanderven.se martijn
edited /IndieAuth (-125) "Updating definition and #Why to start clearing some confusion. Add a clear note about the naming issue right after the description of IndieAuth."
(view diff)
KevinMarks joined the channel
#
vanderven.se martijn
edited /User:Vanderven.se_martijn/IndieAuth (+182) "I think this captures Micropub for WordPress correctly?"
(view diff)
KevinMarks and KevinMarks_ joined the channel
#
jeremycherfas
Zegnat: Notify halts at this line $result = $client->sendWebmention($pagedata['permalink'], $link['url']);
#
jeremycherfas
I’m wondering, could it be failing to find sendWebmention, which is in MentionClient, which is under /classes
#
jeremycherfas
I don’t think so, because it includes this:
#
jeremycherfas
require_once __DIR__ . '/../classes/MentionClient.php';
#
sebsel
jeremycherfas is there a (github?) URL to the code? :)
#
Loqi
[Perlkonig] grav-plugin-webmention: Implements the Webmention protocol (with the Vouch extension) for the Grav CMS
#
jeremycherfas
I see that in the code for mentionclient.php, aaron says “If you want to collect debugging information so you can see the steps the library is doing, run IndieWeb\MentionClient::enableDebug(); before calling any other function.
#
jeremycherfas
Where would I put that? Near the top of Notify?
#
sebsel
yeah, after the include.
#
Zegnat
It shouldn’t *not* find that function, jeremycherfas
#
Zegnat
So that would sound like some sort of cURL problem
#
jeremycherfas
Sebsel: “MentionClient::enableDebug();“ gives a fatal error.
#
Zegnat
What is the exact wording of the error?
#
Loqi
It looks like we don't have a page for "exact wording of the error" yet. Would you like to create it?
#
jeremycherfas
Class 'Grav\Plugin\Console\MentionClient' not found in /Applications/MAMP/htdocs/grav-admin/user/plugins/webmention/cli/NotifyCommand.php on line 14
#
sebsel
It should be `\IndieWeb\MentionClient::enableDebug();` because of namespacing, I think?
#
Zegnat
Yes, sebsel is right.
#
jeremycherfas
OK, trying that
#
Zegnat
jeremycherfas, class names work a bit like URLs. If it doesn’t start with a \ they are treated as relative to the current namespace.
#
jeremycherfas
OK, that’s helpful. Now see a message from MentionClient “Sending mention now!” and then it hangs!
#
jeremycherfas
But that’s in the public static functioon sendwebmentiontoendpoint
#
jeremycherfas
Which is not what Notify is calling, I don’t think.
#
Zegnat
You can go to the _post functino, jeremycherfas: https://github.com/indieweb/mention-client-php/blob/bc45c6051ae9aa5e0905389ad9c863d738be7b03/src/IndieWeb/MentionClient.php#L492 and add some more self::_debug('message') in there
KevinMarks joined the channel
#
jeremycherfas
You mean add my own mnessage?
#
sebsel
Then you know more precisely where it stops :)
#
jeremycherfas
Now, interesting. The version of MentionClient that he is using in the Plugin is not the same as the version on Github.
#
Zegnat
Oh, yeah, sorry about that, I should have been linking to the one nested in the plugin
#
sebsel
Ah! No that was me, switching to IndieWeb's repo
#
Zegnat
Yeah, that’s a dangerous thing to do when it comes to the grav plugin ;)
#
sebsel
Does it break when you update the MentionClient? :P
#
jeremycherfas
It’s already broken!
#
sebsel
Break it back!
#
Zegnat
jeremycherfas: the Notify script calls sendWebmention() which calls sendWebmentionToEndpoint() which calls _post().
#
Zegnat
If you get the “Sending webmention now!” debug message after enabling debug in MentionClient, that means you reach sendWebmentionToEndpoint() right before its _post() call.
#
jeremycherfas
And I reach the Post call successfully.
#
Zegnat
So if that is where it hangs, you might want to add some extra debug messages inside _post() and see if you can further find out when it hangs
#
Zegnat
Could you add this as the first line of the _post method in the client?
#
Zegnat
self::_debug("Sending a POST to $url with the following data: " . print_r(['body'=>$body,'headers'=>$headers], true));
#
Zegnat
That should give the exact data that is being used to build the request
#
Zegnat
(I say should because I can’t test it, but the code *looks* right)
#
jeremycherfas
How do I do a blob?
#
Zegnat
“do a blob”?
#
jeremycherfas
It is failing right before line 400 of the plugin’s mentionclient “ $response = curl_exec($ch);”
#
jeremycherfas
In github, like you were just doing
#
sebsel
You compared phpinfo(), right? Is curl on there?
#
Zegnat
Oh, you can select any line on GitHub by clicking the line number. That will link to the specific line. If you want to do a multiline select, click on the first line and hold shift to click on the last line of your select.
#
jeremycherfas
Yes, curl is in there.
#
jeremycherfas
And I can curl fine between local files
#
sebsel
Ah, yeah, you wouldn't make it to curl_exec() if it wan't indeed :(
#
sebsel
Try Zegnat's code, so you know what the input is
KevinMarks joined the channel
#
Zegnat
That seems completely fine :/ Assuming that URL is indeed where the Known endpoint is at
#
sebsel
And even if it isn't, it shouldn't hang, right?
#
Zegnat
Unless it isnt hanging but just trying to establish a connection ad infinitum
#
Zegnat
Do you see all those curl_setopt function right above our chokepoint, jeremycherfas? Could you add these two to the list:
#
Zegnat
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
#
Zegnat
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
#
Zegnat
See what happens if you run it with that?
#
Zegnat
Basically we are telling cURL to time out connection if it can’t establish it in 5 seconds, and to stop running completely if it is still working after 10 seconds.
#
Zegnat
This is waaay too short for real use, but it might force the script to stop hanging.
#
sebsel
Yeah, I once had a problem when mentioning myself... The code got executed on first page-view, but since the endpoint does a GET on the source page, that first-page-view code got triggered again. The problems of sync webmention handling
#
sebsel
(not saying that's the problem here)
#
Zegnat
These are two separate CMS sebsel, Grav trying to mention Known
#
sebsel
I see now
#
Zegnat
munches away on his potatosalad-swedish-meatball sandwich in the meantime
#
jeremycherfas
Goota have lunch. BRB
#
jeremycherfas
is back, but doesn’t have long.
#
jeremycherfas
Wow! Those two additional options seem to have kicked things right along.
#
Zegnat
That’s … not really good news :(
#
Zegnat
If setting short timeouts fixes things it still means cURL is timing out trying to reach the webmention endpoint
#
jeremycherfas
I don’t get that. Would it help to see the results I get back?
#
jeremycherfas
self::_debug($response); now at least shows that $response is set.
#
Zegnat
What’s the response?
#
Zegnat
I can’t recall how to dump the entire cURL from PHP off the top of my head. (There is an option for that, I believe, that gives basically the output -v does on the command line where it will show the exact request cURL makes and the exact response.)
#
jeremycherfas
This is the output of that debug comand ^^^
#
Zegnat
Yep, so that one happened completely correct
#
Zegnat
Probably because webmention.io responded within our very short timeout
#
Zegnat
The real question is, what happened to the one the process hung on before
#
jeremycherfas
OK, but it was hanging on the very first one before, and I believe that went through. Just scrolling back through Terminal to find it.
#
jeremycherfas
Unfortunately, I have to stop for today. But I have learned a bit more about debugging, for which I thank you both, zegnat and sebsel.
#
Zegnat
No problem jeremycherfas :) Do note that you probably don’t want to keep those TIMEOUT settings in if you want to take code live though
#
Zegnat
Have a good Saturday :)
#
jeremycherfas
Thanks zegnat. But that’s the biggest mystery of all, that it works live WITHOUT those options. I am trying to get it to work properly locally. That’s what this is all about!
#
jeremycherfas
So that I can then tinker with using XRay insted of mf2-php
#
Zegnat
Yeah, we would need to figure out which cURL call was hanging and then see why to solve the core issue.
#
Zegnat
But this’ll get you going :d
#
jeremycherfas
Yup. On the other hand, as my eventual goal is to work with XRay, I’m tempted to go back to the version aaron helped me with ihn Nurnberg and debug that properly.
barpthewire and Defenestrate joined the channel
#
Zegnat
Have there been any updates since Nürnberg other than the discoverability fix I filed a PR for?
KevinMarks, j12t and jeremycherfas joined the channel
#
jeremycherfas
None that I know of
#
Zegnat
Then you can just look at the last few commits on GitHub and copy any potential fixes into your old Nürnberg work. Shouldn’t be hard :)
davidmead, snarfed, j12t and tantek joined the channel
#
Zegnat
aaronpk, I just went on a bit of a search. And JWT with pub/priv key seems to be trivial with PHP JWT libraries, so that’s good.
#
Zegnat
Might have a proof of concept tomorrow. Pending what ever comes up this weekend. Will let you know
#
aaronpk
Zegnat++
#
Loqi
zegnat has 22 karma in this channel (120 overall)
KevinMarks, snarfed, davidmead, j12t and tantek joined the channel
#
@wpmudev
What the New Webmention and Annotation W3C Standards Mean for WordPress https://premium.wpmudev.org/blog/?p=166420 #wpmudev
(twitter.com/_/status/888823466106998784)
#
@wpsheeteditor
wpmudev: What the New Webmention and Annotation W3C Standards Mean for WordPress https://premium.wpmudev.org/blog/?p=166420 #wpmudev
(twitter.com/_/status/888823517181075456)
#
@muc_webdesigner
What the New Webmention and Annotation W3C Standards Mean for WordPress https://premium.wpmudev.org/blog/?p=166420 #wpmudev
(twitter.com/_/status/888824814898745344)
j12t, KevinMarks_, jjuran, barpthewire and KartikPrabhu joined the channel
#
loqi.me
created /Messages (+21) "prompted by tantek and dfn added by tantek"
(view diff)
#
tantek
schmarty: did you upload those from the phone? or did you move the PNGs to your laptop and upload from there?
#
schmarty
i just hopped on my laptop
#
martymcgui.re
edited /iMessage (+401) "add podcast link preview"
(view diff)
#
schmarty
i have to run but i wanted to add that at least to the /iMessage page for now.
#
tantek
thank you!
#
loqi.me
edited /tinbox (+107) "tantek added "Update tantek/contact add to homescreen script for iOS10 from https://github.com/cubiq/add-to-homescreen" to "See Also""
(view diff)
#
tantek.com
edited /iMessage (+637) "iPod touch version with play button and inline playability"
(view diff)
leg, snarfed and j12t joined the channel
#
prtksxna
Is someone running a REST API to get indieweb (and/or opengraph) information about a given URL?
#
sknebel
what's "indieweb information"? there are APIs for the microformat parsers, and x-ray does a bunch of stuff on top of that (authorship, post type, ...)
#
prtksxna
sknebel: mf2 parsing and post type discovery, yeah.
#
prtksxna
what is xray?
#
Loqi
XRay is an open source API that returns structured data for a URL by parsing microformats and following other indieweb algorithms, and is part of the p3k suite of applications https://indieweb.org/XRay
#
prtksxna
Thanks sknebel!
#
prtksxna
I think what I am looking for is a service that'll take a URL, try to parse mf2/do post type discovery, if that fails, look at open graph data if present, and if that fails fallback to scraping. And return this information in a somewhat consistent manner.
#
KartikPrabhu
i made a link-aware progressive disclosure script: if someone links to a fragment/fragmention inside a toggle-able hidden thing, it reveals the hidden content, compare https://kartikprabhu.com/papers to https://kartikprabhu.com/papers#coframes%20at%20fixed%20connection
#
prtksxna
That is so neat KartikPrabhu!
#
KartikPrabhu
will have to write it up and put script on github or something
#
tantek.com
edited /federation (+62) "note federation should not require setting up / creating accounts in both places"
(view diff)
barpthewire joined the channel
#
tantek.com
edited /federation (+1872) "expand dfn with a few more specifics, add social media section, add XMPP and email to history"
(view diff)
#
tantek
!tell aaronpk question about the federation support demonstrated by https://aaronparecki.com/2017/07/19/24/webmention-io - when you're looking at that post yourself when signed-into your site, do you have/see "Reply" or "Like" buttons yourself on the comments? And if you reply right there, do they get threaded with the original comment on micro.blog?
#
Loqi
Ok, I'll tell them that when I see them next
#
Loqi
[Aaron Parecki] The https://webmention.io dashboard just got a whole lot more useful! You can now see the last few dozen webmentions you've received, and delete them if you want! This is the first step towards a "block" feature in webmention.io: https://indieweb.org... https://aaronparecki.com/2017/07/19/24/photo.png
snarfed joined the channel
#
tantek
(basically I'm wondering if how hard/easy it is for you to reply/back forth with someone who is on micro.blog, without either of you having to do anything "special")
jjuran joined the channel
#
snarfed
aaronpk granary twitter block lists now include username and id
AngeloGladding and deep-book-gk_ joined the channel