#dev 2018-01-26
2018-01-26 UTC
EmreSokullu joined the channel
# aaronpk yeah i'm following https://micro.blog/feeds/aaronpk.json
EmreSokullu, [colinwalker], [kevinmarks], snarfed, [miklb], [cleverdevil], tantek, KartikPrabhu and [keithjgrant] joined the channel
# [keithjgrant] anybody on that's familiar with the mp-syndicate-to field when posting to a MP endpoint?
tantek and [miklb] joined the channel
# [keithjgrant] do you know if the MP client is supposed to post an array of the syndicate UID strings, or an array of the full syndicate objects?
# [keithjgrant] https://www.w3.org/TR/micropub/#new-reply This seems to indicate just the uid
# [keithjgrant] well, I think that the problem is my MP server, not Omnibear. I'll keep this in a branch until someone can test a diff endpoint
[eddie] joined the channel
# [keithjgrant] So the request (to post an entry) only needs to contain an array of the UIDs?
eli_oat joined the channel
# [keithjgrant] Is it as 'mp-syndicate-to'?
# [keithjgrant] Cool.
# [keithjgrant] I wonder if voxpelli's app uses syndicate-to. It omits the mp- in mp-slug
# [keithjgrant] Yeah, I made mp-slug configurable. Guess I'll do the same for this
renem and tantek joined the channel
# [keithjgrant] Indeed. eddie++
# [keithjgrant] eddie++
EmreSokullu, [miklb], tantek, EmreSoku_, loicm, curve25519, cweiske, jeremycherfas and j12t joined the channel
# jeremycherfas Trying to send a webmention to Known; json_encode() escapes the / in the URL; Known returns an error "That doesn't look like a valid URL.","message_type":"alert-danger"
# jeremycherfas Is there another way to create the json payload?
# Zegnat Special constant to stop PHP from escaping slashes: https://secure.php.net/manual/en/json.constants.php#constant.json-unescaped-slashes
# jeremycherfas Sorry cweiske they are not webmentions. My mistake. I am just trying to post to Known via crul.
# jeremycherfas "
{"link":"https://www.tbray.org/ongoing/When/201x/2017/09/03/Murder-chez-Hitler","description":"PESOS+from+%3Ca+href%3D%27https%3A%2F%2Fwww.reading.am%2Fp%2F4Njk%2Fhttps%3A%2F%2Fwww.tbray.org%2Fongoing%2FWhen%2F201x%2F2017%2F09%2F03%2FMurder-chez-Hitler%27%3Ereading.am%3C%2Fa%3E"}
"# jeremycherfas $known['body'] = json_encode($mybody, JSON_UNESCAPED_SLASHES); gives the same error
# jeremycherfas From the php script I am working on, yes.
# jeremycherfas Maybe because I produce it with var_dump($known['body']); ?
# jeremycherfas Gist OK?
# Zegnat Ha, looks like you broke the log display, jeremycherfas: https://chat.indieweb.org/dev/2018-01-26/1516959199028900 :D
# jeremycherfas Intention is to test with hard-coded variables, before doing with the variable variables, IYSWIM
# jeremycherfas I thought I WAS using micropub, by sending to a specific Known endpoint.
# jeremycherfas And oops, my credentials are in there.
# jeremycherfas Erk!
# jeremycherfas It is for the live site.
# jeremycherfas Let me understand this better.
# cweiske curl -X POST -H 'User-Agent: shpub' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Bearer deadbeef' -d 'h=entry' -d 'like-of=http://cweiske.de' 'https://commentpara.de/micropub.php'
# jeremycherfas Known says that every endpoint accepts POSTs, so I was sending to the Known Post url.
# jeremycherfas To create a post that is a PESOS of something I marked at reading.am
# jeremycherfas You're suggesting that instead I send the POST to shpub?
# jeremycherfas Hang on zegnat, I'll find it
# Zegnat jeremycherfas, cweiske is suggesting you use Micropub instead, since Known should support that. shpub has a handy debug option that will show you the exact cURL command it does. So if you can get posting to work with shpub, it is super easy to get the cURL command and use that wherever you want.
# jeremycherfas OK. I'll try that route from http://cweiske.de/shpub.htm
# jeremycherfas Well, it would be, if it worked. I have tested other things, and they worked, but then I got into this specific project and it has not gone well.
# jeremycherfas Pretty much, yes. You get that by doing a GET ihntstead of a POST
# jeremycherfas Cweiske is there a preferred place to extract the phar file?
# Zegnat That is what the Like plugin seems to be looking for: https://github.com/idno/Known/blob/master/IdnoPlugins/Like/Like.php#L131
# cweiske ./shpub.phar like http://url/
# jeremycherfas https://cweiske.de/tagebuch/php-phar-files.htm is a little dense for me. :)
# jeremycherfas I'll try changing as you suggest first zegnat
# jeremycherfas I wonder whether bookmark-of would be better.
# jeremycherfas To be honest, I'm as happy with a bookmark as with a like (and that is a whole 'nother can of worms that many people are working on) but now it would be good to improve the presentation of the body of the post
# jeremycherfas That string is not exactly helpful.
# Zegnat As a general rule though, jeremycherfas, if you are going to work with the Known API instead of Micropub: check the source for the post type (in the IdnoPlugins folder, probably) and look for the `saveDataFromInput` method. There you will find method calls like `getInput('inreplyto')` (for Status) and `getInput('like-of')` (for Like). That way you
# jeremycherfas What is REALLY weird is what Known seems to be doing with the HTML in the body of the post.
# Loqi It looks like we don't have a page for "REALLY weird is what Known seems to be doing with the HTML in the body of the post." yet. Would you like to create it? (Or just say "REALLY weird is what Known seems to be doing with the HTML in the body of the post. is ____", a sentence describing the term)
# jeremycherfas What I see is PESOS from https://gregorlove.com/2017/12/indieweb-wordpress-feedback/">reading.am
# jeremycherfas But the HTML is <p>PESOS from <a href="https://www.reading.am/p/4Uny/https://gregorlove.com/2017/12/indieweb-wordpress-feedback/">reading.am</a></p>
# jeremycherfas And that HTML out do display as I intend.
# jeremycherfas It must be something to do with the nested Hhttps, I think
z2xy joined the channel
# jeremycherfas No, I don't think I do :)
# jeremycherfas What I would really like to understand is whether in general it would be better to work with the Known API or with something like shpub.
# jeremycherfas I started with the Known API because that seemed the most obvious. But not I am wondering.
# jeremycherfas Right, I see the value of that, even though I personally do not anticipate wanting to send my reading.am links to any of my WP sites.
# jeremycherfas That display issue might be somethying to do with FILTER_VALIDATE_URL I think.
# jeremycherfas I thought it might be truncating the URL from the second https
# jeremycherfas I'm still not sure where shpub.phar should be. In /bin?
# cweiske if you move it to /usr/bin/, then you don't need the "./" in front
# jeremycherfas OK. Should I remove the -0.6.0 from the filename?
# jeremycherfas Cool. I have managed to authenticate!
# jeremycherfas Well, that seemed a good first test!
# jeremycherfas Cweiske I tried to see what the syndication targets are of my server, and got this error "response data are not of type application/json"
# jeremycherfas I see now. Thanks.
# jeremycherfas cweiske One final question, for now: Can I use the same kind of formatting you have under custom post types to create a more detailed Bookmark post, with url, tags etc?
# jeremycherfas I mean, specifically, the way you have constructed the command at http://cweiske.de/shpub.htm#id13
# jeremycherfas OK. Thanks. I will continue to expeirment, after lunch. Thanks for your help.
# cweiske shpub bookmark --category=foo -x url=mycustomslug http://example.org "this is my example text"
[miklb] joined the channel
AngeloGladding joined the channel
John_Ivan and leg joined the channel
# jeremycherfas OK, I'm back with more noob questions. If I want to make use of shpub in my php program, do I use exec()?
# jeremycherfas Oh. I see. OK, I'll try that.
# jeremycherfas Oh. I see. OK, I'll try that.
# jeremycherfas But then, do I use the same Authorization: Bearer, or do I use the API key from KNown?
# jeremycherfas Thanks
leg joined the channel
# @sl007 @rhiaro @dustyweb @SocialWebWG Instead care about friends, https://indieweb.org/Events needs you and there are just a few https://github.com/w3c/activitystreams/issues ;) For me it just feels that all 3 webmention, microparts and activitypub are achivements. (twitter.com/_/status/956883702885371905)
eli_oat and KevinMarks joined the channel
# cweiske jeremycherfas, https://incarnate.github.io/curl-to-php/
EmreSokullu joined the channel
# jeremycherfas Very cool; thanks. Right now, I'm stumped by the fact that when I create a bookmark by hand, I can add what it calls a desction, but when I do that with shpub, so far, I cannot. Still trying
# jeremycherfas Does not accept it, so far
# jeremycherfas Ignores it.
# jeremycherfas No
# cweiske -d 'h=entry' -d 'bookmark-of=http://cweiske.de' -d 'content=this is a text'
# jeremycherfas Let me try content. I have tried body and description
# jeremycherfas Not included and not in curl
# jeremycherfas php ./shpub-0.6.0.phar --debug bookmark -x tags=#testtag -x title="Inserting a title with a star and a link" -x bookmark-of=https://indieweb.org/bookmark -x content="A bit meta, linking to this."
# jeremycherfas OK, let me try again
# cweiske php ./shpub-0.6.0.phar --debug bookmark https://indieweb.org/bookmark "A bit meta, linking to this."
# jeremycherfas Nope. It is in the curl but seems that Known is not receiving that element.
# Loqi It looks like we don't have a page for "final curl command" yet. Would you like to create it? (Or just say "final curl command is ____", a sentence describing the term)
# jeremycherfas curl -X POST -H 'User-Agent: shpub' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Bearer xxx' -d 'h=entry' -d 'bookmark-of=https://indieweb.org/bookmark' -d 'content=using a different label for description.' -d 'tags=#testtag' -d 'title=Description' 'https://stream.jeremycherfas.net/micropub/endpoint'
# jeremycherfas Me too. Very frustrating. I'll ask in the #known channel in case mapcyka is lurking there.
John_Ivan joined the channel
# jeremycherfas I'll try anything
# jeremycherfas Server returned an error status code 400
# jeremycherfas invalid_request: Couldn't create bookmark: That doesn't look like a valid URL.
# jeremycherfas Yes. Json seems to create a different curl payload
# jeremycherfas But it actually gets the entities differently. Look:
# jeremycherfas curl -X POST -H 'User-Agent: shpub' -H 'Content-Type: application/json' -H 'Authorization: Bearer 44cb20945935ef0d19be5867a575ed1f' --data '
{"type":["h-entry"],"properties":{"bookmark-of":["http:\/\/using a different label for description."],"tags":["#testtag"],"title":["Description"],"https:\/\/indieweb.org\/bookmark":[null]}}
' 'https://stream.jeremycherfas.net/micropub/endpoint'# jeremycherfas Erk, left the auth code in there
# jeremycherfas I suppose to get a new code I do shpub connect again
# jeremycherfas Account/indiepub allows you to revoke tokens
# jeremycherfas So I have to get a new one.
# jeremycherfas Book-mark of has become http://title
EmreSokullu joined the channel
# jeremycherfas Thanks. When I try to connect again, it says token already available.
# jeremycherfas Can I get a new one?
# jeremycherfas which config?
# jeremycherfas Cool.
snarfed joined the channel
# jeremycherfas Well, I don't think I can go much further, but I do think I have made some progress today, thanks to you both
# jeremycherfas Cweiske++
# jeremycherfas Zegnat++
EmreSokullu joined the channel
# jeremycherfas The json payload works with a hand edited bookmark-of URL but then does not send the tags or the title.
# jeremycherfas I think that is where Known's own names for the entities comes into play.
KevinMarks_ joined the channel
KevinMarks joined the channel
# jeremycherfas But looking at the blog you suggested https://github.com/idno/Known/blob/master/IdnoPlugins/Like/Like.php#L125 I can't see content, only description
# jeremycherfas Ands that is in the Likes plugin. I'm still not sure how that relates to the bookmarks.
# jeremycherfas Yeah, and that discussion was about how confusing it is.
# Zegnat Bookmarks overwrite body: https://github.com/idno/Known/blob/master/IdnoPlugins/Like/Like.php#L144-L147
# jeremycherfas Zegnat The micropub code seems to be absolutely clear that it will accept 'content' and 'bookmark-of' and 'category' (but not 'tags')
# jeremycherfas Am I write that if you use the bookmark API then that will happen, but not if you use micropub?
AlanPearce[m] left the channel
# jeremycherfas https://github.com/idno/Known/blob/master/IdnoPlugins/IndiePub/Pages/MicroPub/Endpoint.php#L314 seems to me to be saying that
# jeremycherfas Because https://github.com/idno/Known/blob/master/IdnoPlugins/IndiePub/Pages/MicroPub/Endpoint.php#L352 then gets the plugin
# Zegnat And the Like plugin then goes and overwrites “body” with the “bookmarkof” value: https://github.com/idno/Known/blob/master/IdnoPlugins/Like/Like.php#L144-L147
# jeremycherfas So --- without digging deep into Known code, the answer may be to structure a Post type article with the information I want to publish with micropub.
# jeremycherfas That's what I want to say too. But it is perfctly possible to create the body by hand when cwriting a bookmark post
# jeremycherfas But using the known API is exactly where we started! And the problem there was that the Known API mangles the description.
# jeremycherfas And on which I have seen very little movement recently.
# jeremycherfas I need to write some notes to myself and then think about raising an issue on the Like plugin.
# jeremycherfas Heh.
[xavierroy], [andrea_arbogast, singpolyma and snarfed joined the channel
[jeremycherfas] joined the channel
# [jeremycherfas] dgold Are you sure you wouldn’t prefer a spaceship operator?
# [jeremycherfas] I don’t understand why it has that name. Go no-go?
# [jeremycherfas] Ok
# [jeremycherfas] I really do not want to start digging into knowns sql for what is in some ways a very silly itch.
[miklb] and KevinMarks joined the channel
# gRegorLove On dreamhost you could use `php56` to invoke composer at the command line iirc
# gRegorLove Similar should work with phpunit
# Zegnat Ugh, this is going to bite me: https://github.com/Homebrew/homebrew-php/issues/4721
# aaronpk 🎉 works in 5.6-nightly! https://travis-ci.org/aaronpk/p3k-micropub
John_Ivan joined the channel
[cleverdevil] joined the channel
# Loqi GWG: sknebel left you a message 19 hours, 26 minutes ago: could you review the wordpress column in https://indieweb.org/Micropub/Servers#Implementation_status and bring it up to date if it is not? Thanks!
KevinMarks joined the channel
# gRegorLove I've been on Windows for a while so never had a strong desire to mess with local PHP dev :)
# gRegorLove If I switch to Mac or Linux, I'm definitely more likely to
[jeremycherfas] joined the channel
# gRegorLove Haven't tried it
snarfed, KevinMarks_, [miklb], KevinMarks, snarfed1, tantek and [kevinmarks] joined the channel
# gRegorLove What is lazymention?
# Loqi lazymention is an open source service you can run on a Node.js server to send Webmentions from static sites https://indieweb.org/lazymention
[keithjgrant], tantek, jackjamieson, [cleverdevil], [eddie] and snarfed joined the channel
# gRegorLove KevinMarks, is pestagram dead?
AngeloGladding, KevinMarks, tantek, snarfed and [kevinmarks] joined the channel
# [kevinmarks] Yes, the api it was using went away, and it violated several terms for the new one.
snarfed joined the channel
snarfed joined the channel
# gRegorLove ooh, I didn't think to try granary
# gRegorLove snarfed, What's activity_id, or does that apply to IG?
# gRegorLove Thanks!
# gRegorLove Oops, totally missed the docs link, sorry. Jumped to the bottom and only found github. :)