X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=dwpost%2Fdwpost.php;h=2391b5711cdbf41b8dac81f60cf45659514e8027;hb=57441b4def0f4bb42044ea444b6c59bcaa166d61;hp=c7bfd939fe57bbaee44f96c7b7a84da849f09ba3;hpb=0398585d6cb80a455ea79ce9a155e9f8c7895dbd;p=friendica-addons.git diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index c7bfd939..2391b571 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -4,8 +4,9 @@ * Name: Dreamwidth Post Connector * Description: Post to dreamwidth * Version: 1.0 - * Author: Tony Baldwin + * Author: Tony Baldwin * Author: Michael Johnston + * Author: Cat Gray */ function dwpost_install() { @@ -173,6 +174,7 @@ function dwpost_send(&$a,&$b) { $title = $b['title']; $post = bbcode($b['body']); $post = xmlify($post); + $tags = dwpost_get_tags($b['tag']); $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s'); $year = intval(substr($date,0,4)); @@ -200,7 +202,7 @@ function dwpost_send(&$a,&$b) { props useragentFriendica -taglistfriendica +taglist$tags @@ -211,9 +213,15 @@ EOT; logger('dwpost: data: ' . $xml, LOGGER_DATA); if($dw_blog !== 'test') - $x = post_url($dw_blog,$xml); + $x = post_url($dw_blog,$xml,array("Content-Type: text/xml")); logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG); } } +function dwpost_get_tags($post) +{ + preg_match_all("/\]([^\[#]+)\[/",$post,$matches); + $tags = implode(', ',$matches[1]); + return $tags; +}