#indiewebcamp 2013-10-26

2013-10-26 UTC
bnvk joined the channel
#
JonathanNeal
manymoon === do
#
tantek
my goodness their actual email announcement that shaners linked to includes the literal phrase "incredible journey" (!!!)
#
tantek
I want to know how much they spent on buying the domain name do.com
#
JonathanNeal
Looks like do.com used to belong to ddo.com
josephboyle joined the channel
#
tantek
aaronpk - 48 line http_rels() php function ready for testing. I've been trying it on aaronparecki.com in case you've been seeing a strange useragent.
#
aaronpk
sweet!
#
tantek
apparently Link: header syntax can be kind a nuts - e.g.
#
tantek
rel=f
#
aaronpk
yeah :(
#
tantek
so my code handles that :)
#
aaronpk
wow. did you find some good test data?
#
tantek
yeah that Link: above ^^^ :)
#
tantek
and your site
#
tantek
I figure that's pretty good ;)
#
tantek
now should I post this function as a gist or separate file?
#
aaronpk
I wouldn't mind bundling it up as its own project, adding a test suite, and publishing to composer
#
aaronpk
and here's a relatively simple component bundled up how I would bundle this one up https://github.com/indieweb/date-formatter-php
#
tantek
reading that spec now and seeing if I missed anything obv
#
tantek
e.g. "Relationship values are case-insensitive"
#
JonathanNeal
THAT'S RIGHT
#
tantek
aaronpk, hmm, I'm ignoring all non-rel attribute on the Link: header
mikeal joined the channel
#
aaronpk
where do they go in the mf2-parsed version?
#
tantek
we ignore them there too except for special-casing alternate
#
aaronpk
maybe that's the answer then
#
tantek
I designed that to satisfy actual use-cases, rather than full expression of what a <link> can do
#
tantek
yeah - though I'm not going to bother with adding alternate-specific support
#
aaronpk
well if you want, I can wrap this in a test suite real quick
#
aaronpk
is it all a single function?
#
tantek
quite tight
#
aaronpk
I can just namespace it under IndieWeb without making it into a class
#
tantek
yes that would be great. in reading that spec I need to add just a bit more defensiveness.
scor joined the channel
#
tantek
aaronpk - right now I'm doing the curl in the function, I wonder is it better to split it into two functions, one that just extracts the rels from a headers string.
#
aaronpk
ah yes, that would be ideal
#
aaronpk
likely some people may want to fetch the headers some other way and still use the code to parse the rel values
tpinto joined the channel
#
tantek
I'm going to postpone making the "extract rels from a headers string" function into CASSIS for now - but that shouldn't be too hard
#
tantek
since it's just string manipulation
#
tantek
then Node folks could use it too
#
aaronpk
the function returns an array, yes?
#
tantek
right now, just a php array, with the rel values as indices, which then are arrays of URLs themselves
#
aaronpk
did benwerd drop the Link from his headers?
#
tantek
it was there earlier today
#
tantek
also I think this is the more recent spec for HTTP Link: http://tools.ietf.org/html/rfc5988
#
tantek
except they made the mistake of putting a registry in there (which HTML has promptly ignored and is officially using the microformats existing-rel-values registry)
#
aaronpk
new rule: spec authors should be required to give a complete list of examples that can be used as tests
#
tantek
heh - I don't think we pass that rule ;)
dybskiy joined the channel
#
aaronpk
I know, we should fix that!
#
aaronpk
I was able to turn that bit of the RFC into a test suite very easily: https://github.com/indieweb/php-mf2/blob/master/tests/Mf2/URLTest.php#L245
#
tantek
well alright then. ok, running some test code of my own with more examples from that spec
#
tantek
should we worry about multiline header fields?
#
aaronpk
have you encountered any in the wild yet?
#
tantek
only in the spec
#
tantek
specs
#
aaronpk
oh wait you mean a header field with a newline as one of the characters? that seems weird
#
tantek
newline then space is allowed as a way to break long header fields apparently
#
tantek
so I'm doing this now: preg_replace('/\r\n[ \t]+/',' ',$h)
#
aaronpk
I suppose that's what they had in mind
#
tantek
correction: preg_replace("/(\r\n|\r|\n)[ \t]+/", " ", $h)
#
tantek
sheesh
#
aaronpk
http doesn't specity \r\n vs \n?
#
tantek
well http does, but I'm coding http_rels just a bit defensively for ease of testing purposes
#
tantek
so without the curl code, http_rels is 38 lines
dybskiy joined the channel
#
tantek
screw commandline - I'm just going edit and copy/paste the code in
#
aaronpk
you should try Gitbox, it's the best git gui i've found
#
aaronpk
that's what I use 98% of the time
#
Loqi
agreed.
#
tantek
ok saved - take a look
#
tantek
(and welcome to my classic C coding style ;) )
#
tantek
do the tests pass?
#
aaronpk
weird, not returning anything
mikeal joined the channel
#
tantek
works for me without namespaces
#
tantek
aaronpk, e.g. try http_rels('Link: <http://example.org/query?a=b,c>
#
tantek
rel=f');
#
aaronpk
works on that one
#
tantek
I can give you more if you like :)
#
aaronpk
oh also I was checking for an array with a 'rels' array
#
tantek
e.g. this works too: head_http_rels("http://aaronparecki.com/");
#
tantek
oh sorry - I simplified what http_rels returns
#
tantek
it's head_http_rels that returns an array with 'status' and 'rels' array
#
aaronpk
updates test cases
#
tantek
I figure that demonstrates how to build it up into something bigger if you want
#
aaronpk
ok now it's only failing on the multi-line ones
#
tantek
damn, really?
#
tantek
e.g.?
scor joined the channel
#
tantek
oh I know why - your PHP multiline string literal is not doing \n\r
#
tantek
er, \r\n
#
aaronpk
oh I thought you relaxed that?
#
tantek
only for continuation lines
#
tantek
I'll fix it for all
#
aaronpk
test pass!
#
aaronpk
only one change required
#
tantek
what was that?
#
tantek
oh right - one fix to the tests ;)
#
aaronpk
was throwing an error if the key doesn't exist. you must have a lower threshold of error reporting.
#
aaronpk
one fix to the tests, one minor fix to the code
#
tantek
technically the line-break flexibility is a change in the code to accommodate the not-quite-http-spec multiline test ;)
#
tantek
as HTTP requires \r\n linebreaks
#
aaronpk
oh yea but the array_key_exists thing
#
aaronpk
ok gotta run!
#
tantek
oh is array_key_exists better?
#
tantek
aaronpk - did you notice how it parses out the X-Pingback as if it is a Link header too and returns it like a rel?
mikeal, dybskiy, josephboyle, michaelrhodes, shaners, scor, tpinto, acegiak and tantek joined the channel
#
tantek
!tell aaronpk re: "must have a lower threshold of error reporting" - not sure - I was just testing it with the default php install on MacOS X 10.7
#
Loqi
Ok, I'll tell them that when I see them next
tpinto joined the channel
#
christopheducamp.com
edited /WordPress-fr (+3234) "[fr: french translation sync'd - checked welcome]"
(view diff)
#
christopheducamp.com
edited /WordPress (-6) "/* People using WordPress */ moved blog to other sites list"
(view diff)
#
tantek
tommorris - did you catch any of anildash's speaking at Mozfest on video?
#
tommorris
tantek: no, just saw the tweets about it
#
tommorris
tantek: I asked Mozilla if they are going to publish the video
andreypopp joined the channel
#
tantek
yeah - saw your request. often this stuff is archived on air.mozilla.org
#
tantek
tomorris I'm watching the live stream on air.mozilla.org and don't really understand what is going on
tpinto and barnabywalters joined the channel
#
tantek
it's a fragment
#
tantek
the tweets about it seemed a bit high level
#
tantek
basic message "open is not enough"
#
tantek
"economic value of links"
#
tantek
"like spam is coming" - um, it's already here: http://indiewebcamp.com/spam#Like_Spam
#
christopheducamp.com
edited /webmention-fr (+12312) "[fr: synchro - french translation to be achieved and checked. still searching french help to test on Jekyll ?)]"
(view diff)
#
@xtof_fr
@glenux ? en langage clair ? Si tu as du temps, je ch. aide et/ou exemples ds la jungle de #webmention en français : http://indiewebcamp.com/webmention-fr#Impl.C3.A9mentations
(twitter.com/_/status/394041607600611328)
LauraJ joined the channel
#
tantek
tommoris - does Ferocity (especially the version you're running on your site) accept webmentions? or send? (or only send pingbacks?)
#
tantek.com
edited /webmention (+501) "/* Discovery in PHP */ HTTP HEAD request and rel parsing library now implemented and shared on github! brief notes about how to use in this context"
(view diff)
Acidnerd, glennjones, Acidnerd1 and xtof joined the channel
#
tantek
hey xtof - what are you running on your main site now?
#
xtof
bonjour tantek : currently studying jekyll on a local instance. Think I should be ready next monday.
#
xtof
Will start at the root name on christopheducamp.com and will describe indiemark first steps learning in french...
#
tantek
wonderful!
bnvk, Acidnerd, xtof, andreypopp, bnvk_, bnvk__, ozten, tpinto and glennjones joined the channel
xtof, LauraJ and singpolyma joined the channel
#
aaronpk
I need to display "comments" under my blog posts now
#
Loqi
aaronpk: tantek left you a message 7 hours, 22 minutes ago: re: "must have a lower threshold of error reporting" - not sure - I was just testing it with the default php install on MacOS X 10.7
#
aaronpk
just had someone email me a link to their blog post they wrote because they "didn't find a trackback feature" on my site!
#
christopheducamp.com
created /spam-fr (+9164) "[fr: french translation draft]"
(view diff)
tpinto, glennjones, caseorganic, tilgovi, mikeal and barnabywalters joined the channel
#
barnabywalters
web dataflow UI experimentation: http://waterpigs.co.uk/intertubes/
#
barnabywalters
doesn’t do much yet but you can wire the boxes together
#
aaronpk
barnabywalters: hello!
#
barnabywalters
mafternoon aaronpk!
caseorganic, melvster, tpinto and andreypopp joined the channel
#
tobilehman.com
edited /OpenID (+64) "/* Consuming Sites */ add cufp.org"
(view diff)
#
tobilehman.com
edited /OpenID (+7) "/* Consuming Sites */"
(view diff)
bnvk, xtof, KevinMarks, LauraJ, Slyphoria, paulcp, caseorganic, tpinto, josephboyle and earplugs joined the channel
caseorganic, glennjones and paulcp joined the channel
aaronpk_, tpinto, jalbertbowdenii, Jeena and tobiastom joined the channel
#
tobiastom
hey.
#
barnabywalters
greetings tobiastom
ttepasse joined the channel
#
tobiastom
I have q question about indie auth.
#
tobiastom
on the website you say that persona and SMS are supported providers. How does that work?
#
bret
aaronpk: I wanted to ask you about how you do flat file storage for your site... thinking of building off of my existing content that works in jekyll, and I know you had similar roots for your site
#
bret
tobiastom: for SMS, you list a phone number on your site, and it sends you a one time authentication token via sms to that number
#
bret
tobiastom: for persona, you list an email on your site and lets indieauth if you own it or not
#
tobiastom
bret: you could use something like http://getkirby.com/
#
bret
tobiastom: the best way to test out those auth methods is to try it out yourself!
#
tobiastom
will do, thanks.
#
bret
kirby looks cool! i was looking to try and roll my own thing though in node/express
#
tobiastom
there are more solutions like kirby, but I prefer that one.
#
bret
yeah it looks nice
#
bret
it costs money though, can you hack on it?
#
tobiastom
yeah, you can. it's completely available on github: https://github.com/bastianallgeier/kirbycms
#
tobiastom
the price is just a license thing which supports the continued development of it.
aaronpk_ joined the channel
#
bret
ah is ee
#
aaronpk
what who is this aaronpk_ imposter
#
aaronpk
bret: my file storage looks very similar to jekyll's markdown files
#
bret
aaronpk: do you have any notes on how you go from the flat files the live site?
#
bret
maybe next time we meet and have time we can talk about it
tpinto and tantek joined the channel
#
tantek
good afternoon #indiewebcamp!
#
barnabywalters
afternoon tantek
#
tantek
catches up on logs
#
tantek
barnabywalters - what do you think of the link rel parser I posted (with aaronpk's help) ?
#
barnabywalters
tantek: looks good
#
tantek
thanks!
#
barnabywalters
did you see sandeep’s one? he wrote a state machine instead of using regexes: https://github.com/phpish/link_header/blob/master/link_header.php
#
barnabywalters
oh interesting normalisation of custom pingback headers
#
tantek
yeah I did :)
KevinMarks joined the channel
#
tantek
if you think of any other similar-to-rel HTTP header fields that are worth converting to rel equivalents, let meknow
#
tantek
barnabywalters how does this work if $link_values is just a string? >>> $link_values = array($link_values)
#
tantek
also - mine accepts a raw HTTP header block as one big string
#
barnabywalters
looks like it normalises it into a list of one item instead of demanding a list
#
barnabywalters
tantek: yep, that’s really useful for PHP curl handling
#
tantek
exactly - hence I also included the function to *do* a PHP curl HEAD request to a URL for the Link headers if that's all you want to do: head_http_rels()
#
barnabywalters
so crazy that PHP doesn’t have string HTTP headers -> normalised array built in
#
tantek
barnabywalters - I don't see how I'd use sandeepshetty's function to parse HTTP headers - looks like you have to do some preprocessing first
#
barnabywalters
tantek: not advocating its use (haven’t used it myself), just making sure you knew it existed :)
#
tantek
yeah I think I saw it because it's linked from the Libraries section: http://indiewebcamp.com/webmention#Libraries
#
tantek
but it's not useful on its own and it was easier to write a *38 line* function that did *all of it*
#
tantek
I like functions that fit on a single screenful on my MacBook Air 11"
#
tantek
plus it handles x-pingback etc.
#
tantek
doesn't understand why most code/functions takes *pages and pages*
#
tantek
KevinMarks - do you mean "java" as a programming culture problem? As in, "java" programmers writing code in other languages write bloated code?
#
barnabywalters
there are tradeoffs, as with anything. I find cassis extremely difficult to understand because of all the single letter variables
#
tantek
barnabywalters - yeah - no argument there - the usability of cassis.js needs work
#
tantek
which is why I decided to write this function as just PHP rather than cassis
#
tantek
though the http_rels($h) function could easily be converted to cassis.js
#
KevinMarks
yes, java trains people into insane verbosity. Also spawning needles entities
#
barnabywalters
also, 10-level deep code folder structures
#
tantek
so, I think selfdogfood kind of cures that
caseorganic joined the channel
#
tantek
you'll never get anything done on your own site if you have to write pages and pages of code with 10-level deep code folder structures.
#
tantek
no one in the indieweb community is building their own site/code with Java AFAIK.
#
KevinMarks
good point
josephboyle joined the channel
#
KevinMarks
perl is the opposite problem...
#
tantek
I've been fairly convinced by Crockford's JSLint coding guidelines
#
tantek.com
edited /webmention (+331) "add link_rel_parser to webmention endpoint discovery section in libraries"
(view diff)
#
tantek
barnabywalters - how do you iterate through the hyperlinks in your posts when doing webmentions? do you iterate through the HTML output of your system, or do you iterate through some sort of pre-output like markdown etc.?
#
barnabywalters
IIRC I use the cassis URL regex to find all the URLs in my HTML
#
tantek
wow - even if they're not hyperlinked then
#
tantek
just plain text mentions like ttk.me
#
barnabywalters
they will be by then, because I use cassis auto_link
#
barnabywalters
lots of cassis in my note posting flow
#
tantek
sure - but then you'll get double mentions right? for the URL in the href and for the URL in the plain text?
#
barnabywalters
nope, I filter out duplicates
#
barnabywalters
I should probably just do a DOM query for all elements with href
#
tantek
also - it won't handle relative URls
#
Loqi
yea!
#
tantek
e.g. if you reply to yourself with a relative URL
#
barnabywalters
usually I’m not that fussed about sending webmentions to relative URLs on my own site, but it’s a good point
#
tantek
so you can comment on your own stuff
#
barnabywalters
I try not to use too many relative URLs, having seen how awkward it is to implement spec-compliant software which consumes them correctly
#
tantek
so true
#
barnabywalters
woo! got typed connections working for web dataflow environment: http://waterpigs.co.uk/intertubes/
#
barnabywalters
try dragging the output of the URL input to the inport of the output module
tpinto joined the channel
#
barnabywalters
so tomorrow I just need to build the backend
#
barnabywalters
yahoo pipes v2
#
tantek
yahoo pipes that you can run on your own domain
#
tantek
indie pipes
#
barnabywalters
anyone know who’s maintaining yahoo pipes?
#
barnabywalters
sounds like most of the original creators moved on to other stuff/away from yahoo
#
tantek
it's probably on autopilot
Acidnerd joined the channel
#
barnabywalters
goodnight all
#
Loqi
buenas noches