#indiewebcamp 2014-02-17

2014-02-17 UTC
#
bret
Its great when you make something and it just keeps working and working
lukebrooker joined the channel
#
snarfed
rare though. simple things with few dependencies, but not much else
#
snarfed
and those can be great, but they're a bit less likely to have big impacts
#
snarfed
still though
caseorganic, benjaminchait and gRegor` joined the channel
#
gRegor`
!tell snarfed I think I received a "duplicate" webmention for https://snarfed.org/2014-02-11_re-gregorlove-com-little-g-big-r-powered-by-indieweb. The second had http://localhost instead of the domain, but the same URL slug.
#
Loqi
Ok, I'll tell them that when I see them next
caseorganic, pfenwick, KartikPrabhu, catsup and pasevin joined the channel
#
aaronpk
I'm curious who here has actually implemented the "how to display" here http://indiewebcamp.com/comments-presentation#How_to_display
emmak, KartikPrabhu, caseorganic, rektide, pasevin, grantmacken, lukebrooker and cweiske joined the channel
#
aaronpk
!tell tantek I'm having a tough time turning this algorithm into code: http://indiewebcamp.com/comments-presentation#How_to_display It seems to contain conditionals that overlap/wrap in odd places. Is there any chance you could rewrite to clear that up?
#
Loqi
Ok, I'll tell him that when I see him next
pasevin, LauraJ, pfenwick, Jihaisse, friedcell, caseorganic, fmarier, Sebastien-L, melvster, KevinMarks, KevinMarks_, tobiastom, pfefferle, barnabywalters, marcthiele, michielbdejong1, michielbdejong2 and adactio joined the channel
caseorganic, netweb, ttepasse, fmarier, friedcell, bnvk, pasevin, eschnou, Sebastien-L and KartikPrabhu joined the channel
snarfed joined the channel
#
Loqi
snarfed: gRegor` left you a message on 2/16 at 5:51pm: I think I received a "duplicate" webmention for https://snarfed.org/2014-02-11_re-gregorlove-com-little-g-big-r-powered-by-indieweb. The second had http://localhost instead of the domain, but the same URL slug.
KartikPrabhu joined the channel
#
snarfed
gRegor`: heh, yeah, sorry. that's from running it locally on my own machine for testing. i'll suppress those.
JasonO joined the channel
#
gRegor`
snarfed: I figured that was the case. No problem
#
gRegor`
just wanted to let you know.
#
snarfed
thanks!
#
gRegor`
aaronpk: I have not implemented it yet, but I do plan to implement a display of reply webmentions interleaved with local comments left on articles.
#
aaronpk
great!
eschnou, LauraJ, scor, caseorganic and iangreenleaf joined the channel
#
aaronpk
barnabywalters: good morning!
#
barnabywalters
morning aaronpk!
#
aaronpk
i'm working on some things! had a couple questions you might be able to help with
#
barnabywalters
thanks for spotting my dodgy article microformats markup
#
aaronpk
ah yes!
#
aaronpk
spotted when I added your site to my new reader!
#
aaronpk
so I want to use tantek's ellipsize_to_word function in this library I am writing
#
aaronpk
what's the best way to bring in cassis via composer?
#
barnabywalters
you should just be able to require tantek/cassis: *
#
barnabywalters
nice work on the feedreader btw! looking great
#
aaronpk
I'm writing a library called p3k\comments
#
aaronpk
namespaced to p3k\comments rather
#
barnabywalters
abstracted indieweb comment handling logic?
#
aaronpk
in there, I need to do "require_once __DIR__ . '/../../vendor/autoload.php';" right?
#
aaronpk
specifically the comments-presentation
#
aaronpk
for figuring out whether to use content, summary or name, and truncating appropriately
#
barnabywalters
no, never include autoload from a library
#
barnabywalters
just require tantek/cassis in composer.json and leave it to the library consumer to require the autoloader
#
aaronpk
ok. in this case the library consumer is phpunit
#
barnabywalters
which, irritatingly, forces them to manually wrap it in ob_start()
#
barnabywalters
unless we added another file to the cassis repo which does that automatically
#
aaronpk
actually that's a good idea
#
aaronpk
cassis.php
#
aaronpk
cassis' composer.json would point to cassis.php as its autoload
#
barnabywalters
I think pfefferle or someone sent a pull request doing just that
#
aaronpk
I can probably do that real quick
#
aaronpk
ok but aside from that, do you have an example of a library with a phpunit test suite that also requires packages?
#
barnabywalters
!tell tantek any objections to merging https://github.com/tantek/cassis/pull/11? it would make using cassis much easier in PHP+composer projects
#
Loqi
Ok, I'll tell him that when I see him next
#
barnabywalters
aaronpk: so the test suite needs to include the autoloader?
#
barnabywalters
this is what PHPUnit bootstrap files are for
#
aaronpk
I guess so? I have a bootstrap.php that phpunit requires
#
barnabywalters
yeah, that’s the place to include autoload.php
#
aaronpk
oh ok, that's weird it managed to also include my comments.php file. magic.
#
aaronpk
cool. do you know what $min is for in ellipsize_to_word?
#
barnabywalters
I would guess minimum length, but not sure exactly what that would do
#
aaronpk
yeah I can't really tell
#
barnabywalters
I would try reading the code but I have a headache ;)
#
aaronpk
also strange is that it appears to be putting a space between the last word and the "..."
#
aaronpk
"it will be truncated ..."
#
aaronpk
need a test suite for cassis :)
#
barnabywalters
tantek mentioned that he has a private test suite
#
barnabywalters
not entirely sure why it’s private
#
aaronpk
hm I wonder if he would be up for sharing it if I set up a structure for it
#
barnabywalters
aaronpk: “structure” being logic for testing in both PHP and javascript?
#
aaronpk
I don't know a good JS test structure, but I can set up phpunit stuff
#
aaronpk
oh dear, ellipsize seems to be leaking
brianloveswords joined the channel
#
aaronpk
barnabywalters: I added some more stuff, do you think this looks reasonable? https://github.com/aaronpk/cassis
#
barnabywalters
looks fine to me
#
barnabywalters
generally I am against wrapping perfectly good standalone functions as instance method for no reason
#
aaronpk
oh you mean my ellipsize() helper?
#
barnabywalters
i.e. EllipsizeTest->ellipsize doesn’t access $this so it doesn’t need to be an instance method
#
aaronpk
yeah, I figure it's only there to help that class's tests so it's fine
#
aaronpk
normally I'd agree
#
barnabywalters
generally it’s considered good practise to put test classes/functions in the same namespace as the things they’re testing, or a \Test sub-namespace
#
barnabywalters
but it has few practical implications if you’re not using API documentation generators, so it can be left out
#
aaronpk
gotta run to catch the bus!
#
Loqi
woot
eschnou joined the channel
#
aaronpk
Made it
#
aaronpk
So now I have a test suite started for cassis
#
aaronpk
And my tests for comments are working
#
aaronpk
I'm working on an implementation of the comments-presentation algorithm
#
barnabywalters
I’m working on more plumbing
#
barnabywalters
python mf2 parser
#
aaronpk
barnabywalters: what are you doing for the logic of displaying comments right now?
#
snarfed
barnabywalters: python mf2 parser! tommorris's? or another? or your own?
#
barnabywalters
aaronpk: perhaps http://indiewebcamp.com/Taproot#Mentions can answer some of your questions?
#
barnabywalters
I’m working on Tom’s parser
#
tommorris
thanks barnabywalters
#
barnabywalters
it’s actually pretty far along to being usable for basic cases
#
snarfed
awesome! glad to hear it. i can't wait to use it
#
aaronpk
Reading...
#
barnabywalters
just adding basic dt and e parsing then it’ll be usable for simple stuff
#
barnabywalters
then it’s all the crazy stuff like value-class parsing with split date time support…
#
aaronpk
barnabywalters: cool. That page doesn't say how you determine what to display tho (content vs summary vs linked post name)
#
barnabywalters
aaronpk: true, in fact I’m not sure myself OTTOMH
#
barnabywalters
I think I’m even using different things in different contexts
#
aaronpk
Maybe you will find this library useful then :)
#
barnabywalters
e.g. name in in-feed reply contexts, content -> summary -> name in single page reply contexts
#
aaronpk
This library is my first on the path to making p3k more of a collection of modules rather than a monolithic code base
#
barnabywalters
aaronpk: great!
#
barnabywalters
is your HTML page archiver included in the comment presentation library?
#
barnabywalters
it would be interesting to compare it with taproot/archive
#
aaronpk
No, this library is just the comments-presentation algorithm
friedcell joined the channel
#
aaronpk
I will probably pull out the page archived as a separate library to match the indie archive page
#
aaronpk
I'm shooting for a library for each thing we have a wiki page for more or less
#
barnabywalters
that might be a good framing technique to validate wiki page naming — “does this make sense as a library name”
snarfed joined the channel
#
barnabywalters
okay tommorris I sent you a pull request with some fixes, basic e-* and dt-* parsing in
#
barnabywalters
mf2py should now be ready for initial real-world usage
#
bnvk
yo yo
#
bnvk
really? Neato :)
#
barnabywalters
tommorris: how does one go about adding a package to pypi
#
barnabywalters
heh, looks like their openID support is broken
#
KartikPrabhu
barnabywalters: have you been adding code to mf2py?
#
KartikPrabhu
sweet! I have been meaning to put code in there. Will have to learn mercurial i suppose
#
barnabywalters
KartikPrabhu: mercurial is pretty easy
#
KartikPrabhu
i just got used to git :)
#
barnabywalters
hg pull/push are pretty much the same as git pull/push
#
barnabywalters
same with hg status, add and commit
#
barnabywalters
except I use hg commit -m "message" instead of git’s -am
#
barnabywalters
then merging in changes from tom’s repo is just hg pull ssh://hg@bitbucket.org/tommorris/mf2py
#
barnabywalters
the most irritating thing about it is that “hg” is set to auto-expand to Hurdy Gurdy on my computer
#
barnabywalters
so I have to keep pausing an pressing escape when using it or talking about it :)
#
barnabywalters
changing locations, bbiab
#
KartikPrabhu
barnabywalters: alright will get on it tonight! I already made some oranisational changes to the version I downloaded. Might merge etc... Also what are your thoughts on using Beautiful Soup instead of html5lib?
#
tommorris
was in a standup.
#
tommorris
I’ll look at the pull request and also look into releasing a PyPI package
#
tommorris
and will also look at BeautifulSoup too.
caseorga_ joined the channel
#
KartikPrabhu
tommorris: investigates more. you can use html5lib as a parser in beautiful Soup. So you have html5 and all the nice parsing that bs does!
#
anselm
how fares the artisanal bespoke web?
paulcp joined the channel
#
bear
barnabywalters++
#
Loqi
barnabywalters has 23 karma
paulcp, bnvk, Acidnerd, hallettj, pfenwick, grantmacken, squeakytoy, KartikPrabhu, eschnou and KartikPrabhu1 joined the channel
#
tommorris
has merged in barnabywalters’ changes.
snarfed joined the channel
#
tommorris
is going to pop to the gym for an hour or so, then will look into transferring mf2py to git + github to ease collaboration
#
tommorris
and maybe start a branch to test BeautifulSoup switch.
#
tommorris
and then have a look at PyPI.
#
KartikPrabhu1
tommorris: yay!
#
Loqi
yay!
#
tommorris
set up my PyPI account and looking into the upload process and how to sign code.
#
tommorris
GPG signing of code is sensible. it’s a shame the Ruby community has failed to adopt gem signing
pfenwick and ttepasse joined the channel
#
tommorris
just transferring issues
skinny, jonnybarnes, Kopfstein and pfenwick joined the channel
#
KartikPrabhu1
tommorris: forked mf2py on github. I can look into converting to Beautiful Soup on my fork.
#
tommorris
KartikPrabhu1: awesome
#
tommorris
I’ve just published it to PyPI
#
KartikPrabhu1
neat! Glad this is gathering steam!
#
tommorris
It’s signed as well.
#
KartikPrabhu1
bear: https://github.com/tommorris/mf2py might be of interest!
snarfed and barnabywalters joined the channel
#
tommorris
hey barnabywalters
#
barnabywalters
greetings — thanks for merging my changes tommorris!
#
tommorris
barnabywalters: not just merged them, but released them.
#
barnabywalters
oh cool! nice work
#
tommorris
and copied it over to use Git and Github
KartikPrabhu joined the channel
#
barnabywalters
okay, forked. I’ll add any further changes/issues to the GH repo
#
barnabywalters
how do we go about adding usage info to the pypi page?
pfenwick joined the channel
#
barnabywalters
there should at least be the dumbest possible import, parse, use demo there
#
tommorris
Yep. Needs to be in ReStructuredText.
#
barnabywalters
RST is right up there with java on my list of things not to learn before I die
caseorganic joined the channel
#
tommorris
Well, there shouldn’t be too much RST. Probably best to have a simple example in the description field, and then link out to the wiki/github for more details.
#
barnabywalters
RE beautifulsoup, I’m not convinced that it’s necessary, and would rather avoid the dependency
#
barnabywalters
tommorris: yep that sounds like a good plan
#
barnabywalters
but the python world has very different attitudes toward packages depending on things than the PHP world
#
tommorris
barnabywalters: KartikPrabhu has said he’s going to fork on github and try out BeautifulSoup.
#
tommorris
I’ll make a decision based on whether it makes the code cleaner and more usable
#
KartikPrabhu
barnabywalters: I was suggesting to use beautifulsoup's parsing specially to handle multiple class names etc..
#
barnabywalters
cool, might be worth a try at least
#
KartikPrabhu
I'll make an attempt and we'll see if it works
#
tommorris
I’m not bothered either way: I’m happy to be convinced either way and package up whatever seems best technically
#
tommorris
I’m also going to ask tantek to take on an honourific co-owner role of the PyPI package, just as a protection against getting hit by a bus.
#
tommorris
on the basis that if I disappear off the face of the earth, he can probably make a sane choice as to who should have maintainer access to the PyPI package
#
barnabywalters
+1 to removing SPOFs
caseorganic and KartikPrabhu joined the channel
#
KartikPrabhu
tommorris, barnabywalters: bear and I have a URL validator for ronkyuu that we borrowed from Django project here: https://github.com/bear/ronkyuu/blob/master/ronkyuu/validators.py Thought it might be useful for mf2py
#
tommorris
okay, will look shortly
#
barnabywalters
KartikPrabhu: where would a URL validator be used? when fetching a URL to parse or during parsing?
#
KartikPrabhu
if just a URL is given and no file then URL could be used to get the HTML (?)
#
tommorris
yep, good thinking
snarfed, fmarier and melvster joined the channel
#
bear
tommorris - I have experience with PyPI and maintaining python packages if you want to offload some administrivia
#
tommorris
bear: I’m sorta getting the hang of it.
#
bear
coolness
#
tommorris
it is - once you have learned the magic - very simple. pythonic, you might say.
#
bear
nods
#
tommorris
just pushed out 0.1.1
#
bear
it does require unlearning some web-ish habits :)
#
tommorris
just have to bump the version number, check everything into git and then ` sudo python setup.py sdist upload --sign`
#
bear
signing is something new I need to add to my packages now that PyPI supports it properly
#
tommorris
git tag supports signing too
#
barnabywalters
one thing I really like about packagist is how the entire workflow is git-based, not requiring any out-of-band versioning. I wonder if exposing signed git tags in their UI anywhere would be a feasible extension of that
#
bear
packagist?
#
aaronpk
php's package manager
grantmacken joined the channel
#
barnabywalters
well, package repo technically
#
aaronpk
it actually confused the crap out of me the first time I tried publishing
#
barnabywalters
aaronpk: oh really? what about it?
#
aaronpk
barnabywalters++ for pedantry
#
Loqi
barnabywalters has 24 karma
#
tommorris
Tempted to just make a ‘release’ script that cuts a git tag using the pypi version number
#
tommorris
but that might be yak shaving a bit too much
#
aaronpk
I didn't expect that the *only* way to publish a release was to make a git tag. I expected I'd need to specify a version in the json file or something
#
bear
yea, i've been wanting to automate my release process also - but I always fall back to manual steps
catsup joined the channel
#
bear
at least now I am just releasing sdist builds instead of the 5 versions of egg's I used to do
#
barnabywalters
aaronpk: ah, okay. I always found it straightforward, but I hadn’t had any experience with other dependency managers beforehand so I had no existing expectations to unlearn
#
aaronpk
yeah it makes sense now that I know it :)
paulcp and KartikPrabhu joined the channel
#
tommorris
bear: yeah. have had interesting issues with native dependencies and Python.
#
barnabywalters
tommorris: nice and concise :)
#
bear
I need to get used to the crazy json that the modern mf2 parsers all seem to return
#
bear
(crazy in that it is soo different than what i'm used to :)
#
aaronpk
what are you used to?
catsup joined the channel
#
bear
a simple dictionary of each item with children
#
aaronpk
just read this page and you'll get used to the canonical JSON representation really quick http://microformats.org/wiki/microformats2
#
bear
I get the new format - just have to wrap my head around how to navigate it so I can extract the bits I need
#
bear
yep, that page has it's own dedicated window when i'm working on the code
#
barnabywalters
bear: one thing to look out for is parsed e-* properties which return a dict containing 'value' and 'html' keys
#
Loqi
Ok, I'll tell them that when I see them next
#
tommorris
if we can get the parsing nailed down *tight*, I might create a Python class wrapper around a resulting item object that makes it a little bit easier on the programmer to access if they are using it within Python
#
bear
that would be epic
#
tommorris
essentially a ‘result dict’ which would just make it so you could call .name rather than [‘properties’][‘name’][0:-1] or whatever
#
barnabywalters
tommorris: https://github.com/jkphl/micrometa might be useful prior art for that
#
barnabywalters
I particularly like how jkphl implemented property fetching
#
snarfed
along with corresponding html, and activitystreams for good measure. and the python for converting btw them: https://github.com/snarfed/activitystreams-unofficial/blob/master/microformats2.py
#
barnabywalters
singular property accessor gives you the first one, plural gives you the full list
#
snarfed
oh wow, interesting (re singular vs plural)
#
snarfed
just as one person's vote, that accessor syntactic sugar sounds nice, but not high priority for me personally
#
tommorris
barnabywalters: ooh, that is interesting. you know Rails has a built in pluralizer.
#
bear
my first instinct is to say that would be annoying… but I now know when I react that way it is probably a great idea
#
barnabywalters
tommorris: oh interesting I did not know that
#
snarfed
my code is littered with .get(…) instead of […], and the occasional default [] or {}, and it's not really a problem. still concise and readable
#
barnabywalters
hasn’t done any rails development
#
barnabywalters
snarfed: yep, I’m another .get() user. keeps those nasty KeyErrors at bay
#
tommorris
barnabywalters: it’s so if you have a relational database sructure, you can call, like, Author.find_by_name(“Barnaby Walters”).posts
#
tommorris
where ‘posts’ is a reference to the post table
#
tommorris
posts is easy, but octopuses isn’t.
#
tommorris
to make that work, they just throw an inflection dictionary into Rails.
#
barnabywalters
tommorris: and it would correctly handle cases like category -> categories instead of categorys?
catsup joined the channel
#
aaronpk
that always seemd like too much magic for me
#
barnabywalters
fortunately there are few web apps listing octopi
#
tommorris
inflection is what they refer to it as. there’s now inflection libraries in a lot of languages for that use case
#
barnabywalters
maybe a zooniverse project ;)
snarfed, catsup, scor, jedahan, pfenwick, lukebrooker, caseorganic and poppy joined the channel