X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=ljpost%2Fljpost.php;h=c8690c26e18a1a1bfbdc352d7824e778d31278b2;hb=299c1ccd25386da83a517463b00e9f5f5f5f3b3c;hp=16863f6757963ddf59b16f4092f51db172e3ac99;hpb=9e05e03a0498dee0d60b441a4f9227722af742bb;p=friendica-addons.git diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 16863f67..c8690c26 100755 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -4,8 +4,9 @@ * Name: LiveJournal Post Connector * Description: Post to LiveJournal * Version: 1.0 - * Author: Tony Baldwin + * Author: Tony Baldwin * Author: Michael Johnston + * Author: Cat Gray */ function ljpost_install() { @@ -89,7 +90,7 @@ function ljpost_settings(&$a,&$s) { /* provide a submit button */ - $s .= '
'; + $s .= '
'; } @@ -179,6 +180,7 @@ function ljpost_send(&$a,&$b) { $title = xmlify($b['title']); $post = bbcode($b['body']); $post = xmlify($post); + $tags = ljpost_get_tags($b['tag']); $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s'); $year = intval(substr($date,0,4)); @@ -213,6 +215,10 @@ function ljpost_send(&$a,&$b) { useragent Friendica + + taglist + $tags + @@ -226,9 +232,15 @@ EOT; logger('ljpost: data: ' . $xml, LOGGER_DATA); if($lj_blog !== 'test') - $x = post_url($lj_blog,$xml); + $x = post_url($lj_blog,$xml,array("Content-Type: text/xml")); logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); } } +function ljpost_get_tags($post) +{ + preg_match_all("/\]([^\[#]+)\[/",$post,$matches); + $tags = implode(', ',$matches[1]); + return $tags; +}