#dev 2016-12-12

2016-12-12 UTC
tantek joined the channel
#
tantek.com
edited /Events (-121) "HWC locations for this week"
(view diff)
#
tantek.com
edited /Events (+0) "Moz all hands completed"
(view diff)
#
vanderven.se martijn
edited /pgp (-60) "Link to the article's canonical copy"
(view diff)
#
loqi.me
edited /CASSIS (+100) "/* See Also */ new section"
(view diff)
cweiske and KevinMarks joined the channel
#
cweiske
I don't understand your question
#
cweiske
all unix timestamps are the same
#
petermolnar
no, they are not
#
cweiske
other people commented the same
#
cweiske
and downvoted
#
petermolnar
revisited
#
petermolnar
revisiting
#
petermolnar
I need to wake up
#
petermolnar
copied the wrong terminal...
#
petermolnar
so the problem is found, the astimezone doesn't do anything
#
tantek.com
edited /rsvp (+75) "/* Tantek */ another RSVP maybe remote example"
(view diff)
#
petermolnar
fixed the question
#
petermolnar
so, summary: python always seem to use the machine's local timezone instead of the one I'm asking it to use
#
cweiske
that's a different question
#
cweiske
you should start a new one with that observation
#
cweiske
and adjust the test code accordingly
#
petermolnar
I'll do that
#
petermolnar
because it is indeed a different question
#
tantek.com
edited /rsvp (+548) "/* Brainstorming */ explicitly document Remote Participation, and note why useful"
(view diff)
KevinMarks_ joined the channel
#
petermolnar
I'm beginning to re-appreciate PHP and Perl... they are originated from simpler times, when date parsing worked...
#
cweiske
petermolnar, the strftime docs don't even list %s
#
cweiske
in PHP I always try not to use strftime because it's locale dependent
#
cweiske
and timezone-dependent
#
cweiske
php has gmdate/gmstrftime
#
cweiske
php > echo strftime('%s');
#
cweiske
1481536910
#
cweiske
php > echo gmstrftime('%s');
#
cweiske
1481533313
#
petermolnar
different problem
#
petermolnar
$t = "2015-07-28T17:27:56+0000"; $d = strtotime( $t ); <- this works perfectly in PHP
#
cweiske
no. your problem is - as I understood it - that print(strftime('%s')) already outputs different timestamps
#
petermolnar
but you're right about the system one
#
cweiske
timestamps must be equal across different timezones
#
cweiske
because otherwise they are different times
#
petermolnar
I'll rephrase it: different to my current problem :)
#
cweiske
except you know exactly that the timestamp has the timezone offset included
#
petermolnar
but you're right about that
#
petermolnar
epoch is UTC
#
petermolnar
no timezone, no daylight saving time
#
petermolnar
so if PHP doesn't respect that, indeed that is an issue
#
cweiske
your python also does not respect it
#
cweiske
>>> print(d.strftime('%s')): 1438100876 vs.
#
cweiske
>>> print(d.strftime('%s')): 1438104476
#
cweiske
that's because of strftime
#
petermolnar
print(d.astimezone(pytz.utc).strftime('%s')) <- but this should work, shouldn't it?
#
petermolnar
because it doesn't
#
cweiske
try %z
#
cweiske
what do you get?
#
petermolnar
print(d.strftime('%z')) -> +0000
#
petermolnar
both machines
#
petermolnar
( I have a UTC and a CET machine with synced inputs for testing )
#
petermolnar
the parsing of the string time is fine
#
petermolnar
it's the epoch conversion which fails
#
cweiske
hm. I'd have thought %z would be different
#
cweiske
ok, i'm out
#
petermolnar
>>> import time >>> unixtime = time.mktime(d.timetuple()) >>> print(unixtime) - this one fails as well... this is a bad joke.
#
petermolnar
so Python behave __excatly__ like PHP here
#
cweiske
so my intuition was right here :)
#
petermolnar
it was, but these implementations... who made these decisions?
#
petermolnar
seems like they never really had to work with dates, just to think of them
#
cweiske
nobody. they just expose the C strftime api
#
cweiske
ask who wrote that one
#
petermolnar
let me get my time machine...
#
petermolnar
wasn't alive in the 70s
#
petermolnar
hah, the current time.h is from 91, and of course, since it's a linux re-implementation, https://linux.die.net/include/time.h; do direct copyright notes, only FSF, shall I assume Linus himself?
j4y_funabashi joined the channel
#
j4y_funabashi
Think it is time for me to delve into learning javascript, I havent really looked at any frontend stuff for a long time and it looks like you can do some pretty amazing things these days
#
cweiske
still tries not to use javascript whenever possible
#
petermolnar
j4y_funabashi don't. the JS ecosystem is turtles.
#
cweiske
a language without a standard library..
#
petermolnar
what is Turtles all the way down?
#
Loqi
It looks like we don't have a page for "Turtles all the way down" yet. Would you like to create it?
#
petermolnar
I'm not sure that should go into the wiki
#
loqi.me
created /Turtles_all_the_way_down (+114) "prompted by petermolnar and dfn added by cweiske"
(view diff)
#
Zegnat
That needs an image
bret joined the channel
#
j4y_funabashi
The main things I would like to do are add some fancy stuff to my posting interface
#
j4y_funabashi
And improve my pagination so it loads new posts in rather than reloading the page
#
cweiske
j4y_funabashi, then please take care that you don't break history
#
cweiske
as in: user visits, loads more articles, clicks article, goes back
#
cweiske
aaronpk has or had this problem
#
j4y_funabashi
oh you mean browser history?
#
j4y_funabashi
ok yeah I dont like it when sites do that either
#
j4y_funabashi
petermolnar: do you mean that there are a million frameworks + libs?
#
Sebsel
ah, I have a js load-more thingy that does not break when there's no js, but it does break history I guess...
#
Sebsel
adds to the list
loicm joined the channel
#
loqi.me
created /hwc-next (+21) "prompted by Sebsel and dfn added by Sebsel"
(view diff)
#
petermolnar
j4y_funabashi I used to use endless scrolling: if it's automated ( based on scroll position ), it usually renders footers useless and while it's cool, in my opinion, it's more annoying than useful :)
#
petermolnar
and yes, I meant that JS dependencies are endless pits
#
sknebel
petermolnar: you relly want to look at extra libs for timestamps in python :/ I use https://github.com/boxed/iso8601 for iso-timestamp parsing and pytz for timezones (read the docs!) and dateutils for more free-formatted parsing...
#
sknebel
pendulum and arrow are 2 other, more all-in-one libs you might want to look at
#
petermolnar
sknebel I'm using that, also tried dateutils
#
petermolnar
to actually print utc epoch, you need calendar.timegm
#
petermolnar
all the other methods I tried failed
#
sknebel
ok, didn't need that yet, I only print the iso-format or other components it seems
#
aaronpk
my javascript "load more" links do update the browser URL so that when you go back or refresh the page you get the page you expect
#
ben_thatmustbeme
aaronpk, was wondering if i can get your thoughts on this https://github.com/dissolve/inkstone/issues/14
#
aaronpk
ah yeah
#
aaronpk
trying to remember if i've written this anywhere
#
ben_thatmustbeme
i feel like its probably a security issue to just accept whatever is returned from the auth endpoint
#
aaronpk
i think the conclusion we came to before is you should use whatever comes back from the auth endpoint as long as it's on the same domain as what was entered
#
petermolnar
oh, wow, I generated all the shortcode and old slug redirects into a single nginx conf, 129k and 1900 lines o.O
#
ben_thatmustbeme
aaronpk: i was thinking that might be okay, but would probably add the requirement of checking that the auth endpoint is still the same on the new URL
#
aaronpk
good idea
miklb__, tantek, gRegorLove and KartikPrabhu joined the channel
#
ben_thatmustbeme
miklb__: you around?
#
GWG
Hi, Ben
#
miklb__
ben_thatmustbeme I am
#
ben_thatmustbeme
miklb__: i just posted a response on github
#
miklb__
looking now
tantek and KevinMarks joined the channel
#
miklb__
ben_thatmustbeme unfortunately they don't show up for me. I tested in a browser I've never logged in with just to be sure. I don't have my endpoint code handy, but pretty sure it should it's correct, as it works in Quill.
#
ben_thatmustbeme
i tried to test your endpoint to see what its returning exactly
#
ben_thatmustbeme
but i don't have auth
#
ben_thatmustbeme
i'll try disabling q=config option on mine and see what happens
#
miklb__
I can get that code moved over to this machine so I can look at it closer this evening.
#
ben_thatmustbeme
hmm, the force refresh does not appear to be working correctly either
KevinMarks joined the channel
#
ben_thatmustbeme
or actually, it is, i just broke my mp endpoint when trying to disable the q=config option
#
ben_thatmustbeme
miklb__: is this from desktop?
#
miklb__
laptop, yes
#
miklb__
try in iOS?
#
ben_thatmustbeme
if you inspect you should see the requests to route.php?q=
#
ben_thatmustbeme
the response should be the raw JSON from your endpoint
#
ben_thatmustbeme
it should try q=config first, then try q=syndicate-to when it fails
#
ben_thatmustbeme
(this is when hitting the force refresh)
#
miklb__
where am looking exactly?
#
ben_thatmustbeme
from the settings page, inspect the page, go to network tab
#
ben_thatmustbeme
then hit force refresh
#
miklb__
I see a 400 for q=config…
#
ben_thatmustbeme
it doesn't try q=syndicate-to after that?
#
miklb__
not seeing it in Safari Inspector. I am seeing Error: Error connecting to InkStone Server : The string did not match the expected pattern. micropub.js 184
#
ben_thatmustbeme
ah, hmm, okay
#
miklb__
also references settings.js 182
#
miklb__
er, 37 in settings.js it seems
#
miklb__
I also manually deleted localstorage, nothing changed
#
ben_thatmustbeme
yeah, htast the correct spot, thats really odd. so that error is caught and retried with syndicate-to
#
ben_thatmustbeme
really annoying
#
ben_thatmustbeme
at least now i know its on safari
#
ben_thatmustbeme
i should be able to debug this all on my wife's laptop
#
Loqi
definitely
#
miklb__
I diid try Firefox and seemed to be same issue
#
miklb__
in firefox am seeing the q=syndicate-to and a 200 response, but the dropdrown not showing
#
ben_thatmustbeme
so its not seeing any response basically?
#
miklb__
appears that way
#
miklb__
a hash
#
ben_thatmustbeme
this is the problem of not having a central anything for this app. I tried to make it so anyone could deploy it with extremly little effort, anywhere
#
ben_thatmustbeme
but, not central logging
#
ben_thatmustbeme
it firefox inspector, it looks like this for me
#
miklb__
unfortunately that's not what I see. I'll move that repo to this machine tonight so I can look at the logs of the endpoint to see if anything there can be of help
#
miklb__
can't seem to get rid of the __ in nick
KartikPrabhu and KevinMarks joined the channel
#
ben_thatmustbeme
'miklb' might be taken if you didn't register the handle
#
miklb__
oh, I've had that for 12 years. Textual just doesn't seem to want to allow me to switch back.
#
miklb__
or freenode. ¯\_(ツ)_/¯
#
miklb__
If I quit and rejoin it will log me in as miklb. You'd think over 12 years I would have figured this out :-)
#
miklb__
anyway, I appreciate your work on this and I will definitely look at the logs tonight and report back.
#
ben_thatmustbeme
miklb__: last question, the response tab in there, you said you get a hash?
#
miklb__
yes, basically looks like Auth token
#
ben_thatmustbeme
thats reallly odd
#
miklb__
but longer and not the auth token in the header response
#
ben_thatmustbeme
can you paste it to me in a private message?
#
ben_thatmustbeme
i have no idea where that could be coming from
#
ben_thatmustbeme
oh, so if you take a look at that screenshot again, https://ben.thatmustbe.me/static/inkstone-ff.png
#
ben_thatmustbeme
what does it say for "Type"?
#
ben_thatmustbeme
mine is coming up as JSON
#
ben_thatmustbeme
but if i set certain headers i get it showing as PDF and i get the encoded data like that
#
miklb__
application/x-www-form-urlencoded
#
ben_thatmustbeme
yeah, i was able to reproduce that
#
ben_thatmustbeme
its not form-encoded data you are sending back, but they header you are sending says that it is
#
ben_thatmustbeme
you should send Content-Type: application/json
#
miklb__
OK. guess somehow Quill can navigate that?
#
ben_thatmustbeme
because its not the browser thats actually receiving the data, but the server, it can ignore the header
#
ben_thatmustbeme
since inkstone runs entirely in the browser, its forced to run everything through there first
#
miklb__
cc voxpelli
#
ben_thatmustbeme
ohhhh, wait, are you actually returning json or form-encoded?
#
voxpelli
miklb__: the micropub endpoint sometimes responding with wrong content type?
#
ben_thatmustbeme
the spec doesn't allow for the form-encoded response for ?q=syndicate-to anymore
#
ben_thatmustbeme
as i read it anyway
#
aaronpk
correct
#
aaronpk
i'm not sure it ever did?
#
aaronpk
mayyybe it did in a super early version
#
ben_thatmustbeme
not in the official spec, but when we originally started doing discovery, thats what we used
#
miklb__
voxpelli trying to decipher now
KevinMarks joined the channel
#
miklb__
voxpelli seems sends as application/x-www-form-urlencoded but should be application/json
#
miklb__
mybe you've fixed that in recent updates and I'm still using old code
#
voxpelli
I haven't updated in quite a while either I think :/
#
ben_thatmustbeme
voxpelli: its not that its responding with the wrong type, but just a non-expected type. queries to the micropub endpoint for syndication-to is responding with form-encoded data, not JSON data, micropub spec only allows for JSON
#
ben_thatmustbeme
at least as i understand
#
ben_thatmustbeme
confirmed, its responding with syndicate-to[][uid]= ....
#
voxpelli
ben_thatmustbeme: I respond with JSON if JSON is requested, but I default to form-encoded, yes: https://github.com/voxpelli/node-micropub-express/blob/master/index.js#L314-L322
#
ben_thatmustbeme
okay, so i should be able to fix this by just making sure to request json
#
miklb__
is taking copious notes for when he attempts to write micropub endpoint for Habari
KevinMarks joined the channel
#
voxpelli
Historically form-encoded was the default and application/json was needed to get a JSON response, but I see that has changed so that onlye JSON is allowed now
#
ben_thatmustbeme
miklb__: hard refresh inkstone
#
ben_thatmustbeme
v 1.1.6 should work
#
miklb__
ben_thatmustbeme++
#
Loqi
ben_thatmustbeme has 4 karma in this channel (180 overall)
#
miklb__
everything appeared. Just posted a test note.
#
miklb__
I got a message that new post created is there more to do for publishing?
KevinMarks joined the channel
#
ben_thatmustbeme
not on inkstone's end
#
miklb__
OK. I'll have to check the logs on the endpoint later to see what occurred. Not seeing the note pushed to GitHub repo from endpoint
#
ben_thatmustbeme
huh, there may be other errors
#
ben_thatmustbeme
but at least you got the list of syndicate-to
#
miklb__
yes. I updated and closed that issue.
#
miklb__
I will definitely check the logs and see what failed
#
ben_thatmustbeme
let me know, open up a ticket when you figure it out, its probably an issue with inkstone
#
miklb__
will do
#
ben_thatmustbeme
really should have been doing work that i'm getting paid to do instead.... i'll get back to that
KevinMarks_ joined the channel
#
miklb__
likewise thanks for your time
KevinMarks joined the channel
#
ben_thatmustbeme
miklb: I had another error I just fixed
#
ben_thatmustbeme
it stopped sending the auth token
#
miklb
ok, I'll test this evening
#
seblog.nl
edited /Micropub/Servers (+323) "/* CMS Software */"
(view diff)
KartikPrabhu joined the channel
#
seblog.nl
edited /events/2016-12-14-homebrew-website-club (+520) "added The Netherlands with Zegnat and Sebsel"
(view diff)