Facepalm moment: realizing that flock(2)
doesnβt block across threads inside of a process, only across multiple processes, and adding an MVar lock to Gitson about a year after writing the original code.
Tag #sweetroll
βWhy is my app saying it canβt load my templates because itβs not valid UTF-8?!??!β
Itβs been reading .DS_Store
. Facepalm.
Accidentally reposted something from Tantek using Monocle. Reposts arenβt supported in Sweetroll yet, so I deleted that post, but not before looking at the JSON and noticing that my parser didnβt understand the publishing dateβ¦
<span class="dt-published published dt-updated updated">
<time class="value" datetime="05:55-0700">05:55</time> on <time class="value">2015-08-28</time>
</span>
Turns out I missed the whole βDate and time parsingβ section of the value-class-pattern! Fixed.
Testing⦠this should work (Bridgy Publish for posting to Twitter from my website).
Also, Sweetroll now uses canonical microformats2 JSON for storage.
My favorite thing about Haskell: how the type system helps with fundamental changes. Iβve changed the data structure from Maybe
to lists in microformats2-types, and then changing microformats2-parser and sweetroll was a very quick and simple βsee the type error β fix itβ loop.
Webmention endpoint discovery in Haskell. Probably the best function ever written :-)
This is how I search for it in HTML.
listToMaybe $ unsafePerformIO $ runX $ htmlDoc //> hasAttrValue "rel" isWebmentionRel >>> getAttrValue "href"
Why unsafePerformIO
? Because thereβs no reason for HTML parsing to depend on IO, but theyβve implemented parsing strings as parsing files with the string
protocol.
So, notes on my website should be automatically posted on App.net and Twitter. Also, webmentions should be sent & webfinger works.
P.S. OAuth 1.0 is awful.