X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=ljpost%2Fljpost.php;h=c8690c26e18a1a1bfbdc352d7824e778d31278b2;hb=76797e5ed1c99e2fdae5e094f7e6b8914140cf67;hp=c1b9b9758f58a2b036d239211f65c5eff679e54f;hpb=7097dd6aa735d9b5853f0c5c0c4acee25aaeb7dd;p=friendica-addons.git diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index c1b9b975..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)); @@ -204,6 +206,22 @@ function ljpost_send(&$a,&$b) { day$day hour$hour min$min + usejournal$lj_username + + props + + + + useragent + Friendica + + + taglist + $tags + + + + @@ -214,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; +}