aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-31 18:35:35 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-31 18:35:35 -0700
commit5cc5e0fafdbc1795781b52124a63695ce3e2d49f (patch)
treedad73f6e6603863f1371d75671a60f75325fbd4e /include/items.php
parent0df0fb4b4660b1811c22a7acba35bd62e07747ea (diff)
downloadvolse-hubzilla-5cc5e0fafdbc1795781b52124a63695ce3e2d49f.tar.gz
volse-hubzilla-5cc5e0fafdbc1795781b52124a63695ce3e2d49f.tar.bz2
volse-hubzilla-5cc5e0fafdbc1795781b52124a63695ce3e2d49f.zip
some basic background work for activitystreams-json-ld-2.0 conversions
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index aa052b307..a04cd1c76 100755
--- a/include/items.php
+++ b/include/items.php
@@ -553,6 +553,7 @@ function get_feed_for($channel, $observer_hash, $params) {
'order' => 'post',
'top' => $params['top']
), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module);
+
$feed_template = get_markup_template('atom_feed.tpl');
@@ -4881,3 +4882,39 @@ function comment_local_origin($item) {
return false;
}
+
+
+function i2asld($i) {
+
+ if(! $i)
+ return array();
+
+ $ret = array();
+
+ if($i['verb']) {
+ $ret['@context'] = dirname($i['verb']);
+ $ret['@type'] = ucfirst(basename($i['verb']));
+ }
+ $ret['@id'] = $i['plink'];
+ $ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME);
+ if($i['title'])
+ $ret['title'] = $i['title'];
+ $ret['content'] = bbcode($i['body']);
+
+ $ret['actor'] = asencode_person($i['author']);
+ $ret['owner'] = asencode_person($i['owner']);
+
+
+ return $ret;
+
+}
+
+
+function asencode_person($p) {
+ $ret = array();
+ $ret['@type'] = 'Person';
+ $ret['@id'] = 'acct:' . $p['xchan_addr'];
+ $ret['displayName'] = $p['xchan_name'];
+
+ return $ret;
+} \ No newline at end of file