#dev 2017-11-19

2017-11-19 UTC
[kevinmarks], bengo, [chrisaldrich], tantek, [miklb], tbbrown and renem joined the channel
#
schmarty
!tell sknebel i just published my WIP webmention.io receiver for static sites - https://github.com/martymcguire/morris
#
Loqi
Ok, I'll tell them that when I see them next
#
Loqi
[martymcguire] morris: PHP webhook for caching webmention.io webmentions for static sites.
#
schmarty
!tell sknebel: more to come as i deploy it for site #2
#
Loqi
Ok, I'll tell them that when I see them next
#
grantcodes
Alrighty, for anyone following along there is an update to together https://github.com/cleverdevil/together
#
Loqi
[cleverdevil] together: The together project: an IndieWeb experience
#
grantcodes
Now supporting micropub likes, reposts and replies!
#
grantcodes
Also the map and photo views are kinda awesome
#
grantcodes
Looking forward to getting it hooked up to a microsub endpoint now
tantek, [miklb] and [mrkrndvs] joined the channel
#
sebsel
grantcodes++
#
Loqi
grantcodes has 3 karma in this channel (5 overall)
loicm joined the channel
#
sknebel
schmarty++ thx
#
Loqi
schmarty has 8 karma in this channel (50 overall)
#
Loqi
sknebel: schmarty left you a message 7 hours, 7 minutes ago: i just published my WIP webmention.io receiver for static sites - https://github.com/martymcguire/morris
#
Loqi
sknebel: schmarty left you a message 7 hours, 6 minutes ago: more to come as i deploy it for site #2
#
@nortix
@gdgts Schon mal an Webmentions gedacht? Alle Kommentare im Netz unter dem Beitrag gebündelt.
(twitter.com/_/status/932211389128683521)
#
Zegnat
!tell gRegorLove did you document what sort of micropub request you make for your /read posts? https://indieweb.org/2017/Demos#gRegor_Morrill
#
Loqi
Ok, I'll tell them that when I see them next
#
sknebel
ssg << webmention.io receiver for static sites - https://github.com/martymcguire/morris - bake webmention data during build
#
Loqi
[martymcguire] morris: PHP webhook for caching webmention.io webmentions for static sites.
#
Loqi
ok, I added "webmention.io receiver for static sites - https://github.com/martymcguire/morris - bake webmention data during build" to the "See Also" section of /static_site_generator
#
loqi.me
edited /static_site_generator (+119) "sknebel added "webmention.io receiver for static sites - https://github.com/martymcguire/morris - bake webmention data during build" to "See Also""
(view diff)
raretrack joined the channel
#
Zegnat
That’s pretty interesting. So basically you use wm.io as endpoint and let aaronpk worry about validation and data extraction, and then you mirror it back into your own server?
#
sknebel
and put it in a format you can use directly for building the static site
#
sknebel
so no need to have the user browser call out to wm.io
#
Zegnat
It doesn’t really make a specific format in itself though, right? Just the jf2 it gets from wm.io?
#
Zegnat
isn’t yet sure if he prefers jf2 to actual mf2
#
sknebel
the format in the files seems directly from the api, yes, only the structure on disk is of course it's own
#
Zegnat
Oh, right, yes
#
sknebel
grantcodes: any chance of putting a demo of together somewhere? tried to test it locally and of course yarn doesn't like my node and ...
#
sknebel
I guess I could try dropping it on glitch...
#
sknebel
(ok, now something is happening, but at a few seconds per dependency and ~1100 dependencies this will take a while)
#
Zegnat
1100 dependencies?!
#
sknebel
modern JS apparently
amz3 joined the channel
#
sknebel
yarn--
#
Loqi
yarn has -1 karma
#
Zegnat
What’s your issue with yarn? I heard it was better than npm.
#
sknebel
I'm still trying to install dependencies
#
sknebel
(going for coffee break now, bbl)
snarfed joined the channel
#
grantcodes
Haha yeah npm dependencies are a fun time. Together really only has about 20 dependencies, but each one of those has its own dependencies and each one of those has its own dependencies.......
#
Loqi
rofl
#
grantcodes
But it's not usually that slow for me, even I'm not great connections
#
sknebel
it just fails on some
#
sknebel
doesn't tell me what it doesn't install as a consequence of those
#
sknebel
so I can't even try to install the missing ones via npm
#
grantcodes
A lot of the time it'll actually work with some failures
#
sknebel
not yet
#
grantcodes
Ah well I'll see about putting up a hosted demo as well
#
sknebel
does it need the backend right now? otherwise it'd be easy to upload somewhere
#
sknebel
(which is what I planned to do, an hour and a bit ago...)
#
sknebel
okay, officially giving up
#
grantcodes
Yeah it does need the back end now.
#
aaronpk
That's basically how I use webmention.io too. I let it handle validating and parsing, and it sends the data to my web hook to store the comment
snarfed joined the channel
#
Zegnat
Hmm. I prefer to store the HTML of the mention source. Can webmention.io give me that, or does it only store the jf2?
#
Zegnat
I love how everyone has these unreadable domains for hosting their tools. p3k.io, 5eb.nl, tpxl.io
#
grantcodes
it's the only way to get a super short domain :P
[miklb] joined the channel
#
sknebel
thx grantcodes
bengo joined the channel
#
aaronpk
Zegnat: it only gives you the parsed version. You d have to fetch the html page itself if you wanted that
#
Zegnat
Thanks for confirming, aaronpk. Means I am better off building my endpoint myself or forking wm.io and hosting it myself
#
aaronpk
Don't fork webmention.io, it's kind of a mess ;-)
#
Zegnat
Alrighty then :P
#
Zegnat
is playing with a PHP curl wrapper that limits allowed download size
#
Zegnat
That sounds like a solid feature to use when fetching URLs
#
Zegnat
aaronpk, do you use beanstalk with PHP? Any code samples? I am looking at how I will queue my webmentions. I have some experience with Gearman and PHP, but heard about beanstalk a lot and the wiki says that’s what you use.
#
aaronpk
yeah I like it a lot
#
aaronpk
I ended up making a really minimal wrapper that handles job queuing and dequeuing using beanstalk. you're welcome to use it: https://github.com/aaronpk/Caterpillar
#
Loqi
[aaronpk] Caterpillar: Caterpillar is a PHP job queueing system based on beanstalkd
#
aaronpk
basically it pushes a class and function name and the list of parameters into beanstalk, then the worker script grabs jobs and calls whatever function is described by the job
#
Zegnat
Great! Thanks! Not sure if I will use it or write something myself, but this is going to save me a lot of crawling the web for code samples :D
KartikPrabhu joined the channel
#
aaronpk
it doesn't take much to re-create that same mechanism, I just found myself duplicating a lot of code for every new project so turned it into a library
#
Zegnat
Dinner first, then beanstalk testing
leg and tantek joined the channel
#
ancarda
I never got into proper queue systems, I was just going to shove WebMentions into a MySQL table and process them with a PHP cron job... probably a bit primitive
#
aaronpk
eh that works fine
#
aaronpk
only downside with actual cron is you always have a built-in 1 minute delay
[chrisaldrich] joined the channel
#
aaronpk
the Laravel framework can use MySQL as its job queue
#
sknebel
I use a folder full of files as a queue, works as well
#
aaronpk
totally
#
aaronpk
if you really need instant processing of the jobs on the queue, then there are various mechanisms you can use with MySQL, the filesystem, redis, beanstalk, etc.
#
sknebel
might be less good for sending (I remember you mentioned pretty massive send rates due to salmention etc), but for receiving you're likely limited by verification speed
#
Zegnat
I like the idea of a job queue because that will go it as-fast-as-possible. E.g. if verification for one takes longer than usual, it’ll just keep the job processor busy a little longer. It’ll still pick up the next one as soon as it is done.
#
Zegnat
No need to guess intervalls for cron
#
sknebel
Zegnat: you can get that on top of most other solutions as well, most of them have some kind of notifying mechanism. but switching to a dedicated queue system has been on my list too
#
sknebel
(one with some monitoring tool. on the filesystem I can at least manually poke at the files, so not totally invisible, but something else might be nicer to use)
#
Zegnat
https://indieweb.org/queue mentions celery for Python, sknebel. That something that is interesting for you?
#
Zegnat
At work in the Netherlands we had an inotify watcher on a directory that would prod Gearman into working depending on certain filesystem triggers. Worked OK
#
sknebel
that's similar to what I do, except it's just a while loop in a script instead of gearman ;)
#
sknebel
not a fan of celery, it feels kind of weird to use to me
#
sknebel
probably going to go with something on top of redis
#
Zegnat
I’ve never used redis
#
Zegnat
aaronpk Caterpillar looks really easy to use, but the README doesn’t instantly make it clear to me how I would set-up workers.
#
aaronpk
Hm I guess I should add an example there
#
aaronpk
check out the scripts/ownyourswarm.php file, and the corresponding worker classes in the lib folder
#
Zegnat
And you run scripts/ownyourswarm.php as a service or something?
#
aaronpk
Yeah using an init script in Ubuntu. I can add that example too
#
Zegnat
I guess the part that confuses me the most is where you run a PHP script and that script then tells beanstalk to run X workers. In Gearman we used to have a PHP script itself be the worker. You didn’t start workers from within PHP.
#
aaronpk
All it does is fork and run multiple in parallel. If you just say run one worker then it'll just run in that process
#
aaronpk
its more like telling the php script to fork and run multiple processes that all listen to the same beanstalk queue. Lets you process jobs in parallel instead of just one at a time
#
aaronpk
So the php process *is* the worker, beanstalk is still just an in/out queue
#
Zegnat
Ah, yeah, just checked Caterpillar code again. I guess I didn’t know PHP could fork itself into multiple processes. Learn something new every day
bengo joined the channel
#
Zegnat
Alright: goal for tomorrow: get beanstalk going :D I might bother you a bit during the day, aaronpk. For now, bed.
[jeremycherfas], [dgold], tantek and [kevinmarks] joined the channel
#
www.boffosocko.com
edited /Cross-posting (+5739) "fleshed out (for the benefit of Gen2+); links to other methods and thought"
(view diff)
tantek joined the channel