#TIL that you can put a relative URL in <base>
(via Tantek Çelik)
#TIL that you can put a relative URL in <base>
(via Tantek Çelik)
Testing websites on old windows mobile devices is an… experience.
Connecting to WiFi gave me the option of connecting to “The Internet” or “Work” (?).
On form submit using the software keyboard, I get a dialog warning me about the certificate, with the options “yes” and “no” but no question. Turns out the software keyboard was hiding “Do you want to proceed?”
Now I’m finally in the site, there’s no support for label
, so those nice big touch targets I made are mostly useless. Also, there’s no text wrapping.
Turns out the #microformats 2 JSON structures enable safe entity expansion just like twitter entities.
In my reply contexts I am not wanting to embed 3rd party HTML in my site, so I take the p-summary and strip tags. But, I want embedded h-cards to be expanded just like at-mentions on twitter. Pseudocode:
let h-card = canonical JSON structure for a note, with .summary as a plaintext representation of the content;
for item in h-card.children:
if not in_array('h-card', item.type) continue;
let html = HTML representation of the child from properties.url, name, etc;
replace item.value in h-card.summary with html
Example here.
Just hooked up my #indieweb notes to Brennan Novak’s rather awesome @emoome sentiment analysis API! So all my notes will have automated emotion/language analysis applied now, which I can query through machine tags.
At the moment I’m not publicly showing this data, but if you can read HTML it’s in the source (machine tags not shown by default) and if you can read JSON, add .json
onto the end of the URL.
Julien Genestoux I’ll probably add one this afternoon — wrapped in a subscribe
webaction, of course :)
Is the convention to have just one for the homepage (i.e. subscribe to “me”), or to have one wherever there is a feed (e.g. on my notes or articles pages?
Turns out that performing a GET request on a data URI from PHP works if file_get_contents is used, not if cURL is used. I wonder what support is like for other server side languages — using data URIs in with
could be the basis of some interesting #webactions.
Laurent Eschenauer thanks for the heads-up, on closer inspection it looks like the problem is on your end — the URL in the with
attribute of the action element has that quote at the end
cssquirrel even the if/else is redundant ;)
function awesomeWorkday(tasks) {
return (tasks instanceof coolJsonStuff || tasks instanceof coolApiStuff) ? true : false;
}
Really Google? em
to embolden search terms in results listings? #html
pcntl_wait($status); //Protect against Zombie children
Every now and again the otherwise banal PHP docs make me laugh.
Cross-browser selection UI injection flow:
mouseup
on body
window.getSelection()
s.isCollapsed === false
, returns.getRangeAt(0)
r.surroundContents(e)
e.innerHTML
and e.textContent
now return useful values, and e’s coordinates can be used to inject UI into the pageTo resolve: what element should e be? Or more accurately, what display property should it have? Possibly inline-block
(inline mucks up if selection is across block elements, block mucks up selections within text nodes)
r.surroundContent
, namely that it does not handle partial element selections. See MDNs explanation and solution.
Aral Balkan current #indiewebcamp rough consensus is to use URLs as nouns, pingback (or webmention) as notification infrastructure.
Personally I am doing some rather more complex stuff where I author notes using @-names, which get parsed by @cassisjs into .h-x-username
twitter.com-linked anchors, then I transform those into .h-card
’s with data either from my contacts DB (at the mo mirrored from my personal CardDAV share) or from the identengine.com API for people I don’t know. Then all the links in a note get sent pingbacks.
Fat chance of twitter implementing that though ;)
New stuff: Web Action Hero Toolbelt and <action>
markup on individual note pages. #webactions
We have a #webactions Hero Toolbelt config UI!
Now onto the actual meat. Most of this was already implemented in my fork of #indieweb reply, I just have to tidy it up and add in the <action>
shim.
I was going to spend this evening working on #webactions browser extension, but I think it would be better spent providing a #backup/data export utility for fellow ex #diaspora users.
From my initial researches, it looks like /u/username.json
is the best bet, as it gives a JSON array of all posts written by username
, along with like and comment data. It accepts a max_time=timestamp
query param, and a _
query param, the function of which I am not sure of.
To iterate through all the pages of posts from a certain user, start with their profile URL w/ .json
tacked on the end, fetch all the items, get the datetime of the last item, convert that to a timestamp, fetch the same URL with ?max_time=timestamp
, repeat until an empty array is returned.
Can any other #diaspora users (or fellow former users) verify that, on exporting your content (Settings -> Download XML) posts are NOT included.
I have User, Aspects, Contacts and People, but the Posts element is empty (<posts />
). #indieweb #ownyourcontent
I wonder how common it is for HTTP APIs actually support PUT
to a collection to replace it? Combined with the Robustness Principle it seems like a powerful tool for data migration #ownYourData #indieweb
Wow, exporting my DB of tunes (for migration into the shiny new system) as #YAML almost results in valid #ABC!
-
TUNE_ID: 1
T: Bourree De Brand
M: 2/4
L: 1/8
C: Trad. French
N: Bourree from France
K: G
ABC: |-
d>B GB|c3g|f>d ef|ga bg|d>B GB|c3g|f>d ef|g4:|
|:c2e2|g=fd2|e=fe2|ded2|cB AG|c2e2|g=fd2|e=f/2e/2 dB|c4:|
words:
genre: folk
I love that #php now has shiny namespacing and a thriving code sharing community, but I think the heavily hierarchical namespacing practises used by some of the community (e.g. symfony components) are unhealthy.
They are difficult to memorise, relying on (often slow) IDE autocomplete, and encourage a use
statement for each class. That’s pretty much a scoped equivalent of from x import *
in python — not a good practise! It’s still namespace pollution, it just takes longer to write.
I am trying to use a more python–like, package-centred approach with much fewer subnamespaces. The outcome of this should be that you use
the package name:
use BarnabyWalters
osse;
…and then using all the classes/subnamespaces from that root, e.g: $t = Posse\Helpers::convertHtmlToTwitterFormat($s);