#social 2018-05-16

2018-05-16 UTC
Guest84, cskau, xmpp-social, tantek, vasilakisfil, dlongley and cwebber2 joined the channel
#
cwebber2
https://medium.com/assembly-four/my-six-week-rollercoaster-ride-172eb58ba80e is a heck of a read (CW: about switter, a mastodon instance run for and by sex workers in the wake of FOSTA/SESTA... nothing sexually explicit in the article though)
cwebber2 joined the channel
#
xmpp-social
[Takyoji] Sooo, I've been kicking around a project for a very long time in my free time, and think it might be finally some very faint semblance of being considered 'useful'.
#
Loqi
[TechSanity] ActPubParser: PHP library which decodes any ActivityPub object and provides a simple, objected-oriented interface.
#
xmpp-social
[Takyoji] Just tried making a simple library that builds atop the library 'digitalbazaar/php-json-ld', which expands any ActivityPub JSON-LD object into the expanded form, and lightly validates and extracts the properties into an object.
#
xmpp-social
[Takyoji] And makes AP a little more friendly to use. You can/could step through an object, into it's nested objects, and even extend with a lazyloader for any @id references.
#
xmpp-social
[Takyoji] e.g. you could step through a parsed Create activity as, $activity->object->published, and have a PHP DateTime object of when it was published. Or step through $activity->object->inReplyTo, and see if activity it's referencing even exists, or whatever.
#
xmpp-social
[Takyoji] Or extend the objects with logic for storing into a database, whatever. Generally just syntactic sugar, training wheels perhaps. Nonetheless, just looking for feedback of whether or not I'm doing it horribly, horribly wrong (such as, using a JSON-LD parser for the expanded form, and so on)
#
xmpp-social
[Takyoji] or if there's anything wrong (e.g. documentation, software architecture, etc), given this is my first committed project that has ever seen the light of day (after a decade of probably +30 other projects that got torched)
#
up201705417
dansup: we might use this ActPubParser in the GS ActPub plugin, what do you think?
#
xmpp-social
[Takyoji] If it works well for the use-case. :P
#
xmpp-social
[Takyoji] If there's any repository for said plugin project, I'd be curious
#
xmpp-social
[Takyoji] as I was thinking of taking a stab at that before. My other ideas were to write a WordPress plugin that exposes content/commenting through ActivityPub, or just a simple standalone project
#
xmpp-social
[Takyoji] Yea, it might be of some help then. Perhaps I'd just need to add a little helper function for the serializing back to JSON-LD yet
#
xmpp-social
[Takyoji] if you download the dependencies via Composer, and plop the directory on a webserver, you can load the tests/inspector.php file, and dump any ActivityPub object in the textarea, hit submit, and see a print_r of how it's decoded and casted to individual PHP objects