]> git.mxchange.org Git - friendica-addons.git/commitdiff
added Cat's tag stuff to ijpost
authorTony Baldwin <tony@baldwinsoftware.com>
Sat, 17 Mar 2012 21:30:21 +0000 (17:30 -0400)
committerTony Baldwin <tony@baldwinsoftware.com>
Sat, 17 Mar 2012 21:30:21 +0000 (17:30 -0400)
dwpost/dwpost.php
ijpost.tar.gz
ijpost/ijpost.php

index 85e808c0d7b6d9f3956f7bedfcb63b37148af709..4e4d45e229d620d7c0017b28a9c8c8e884a3711b 100644 (file)
@@ -150,7 +150,7 @@ function dwpost_send(&$a,&$b) {
     if($b['parent'] != $b['id'])
         return;
 
-       // dreamwidth post in the LJ user's timezone. 
+       // dreamwidth post in the DW user's timezone. 
        // Hopefully the person's Friendica account
        // will be set to the same thing.
 
index c274902c05308c6dd20bfbad08813f95aad69375..58da8759efc0c5d00e77d6f3c448782496256e3f 100644 (file)
Binary files a/ijpost.tar.gz and b/ijpost.tar.gz differ
index 20d4f81d4f8defd70bad0f50e967bd2ac17352cf..4eb1d89000c2246750b8f16156663bd3ed5e8fe8 100644 (file)
@@ -5,6 +5,8 @@
  * Description: Post to insanejournal  
  * Version: 1.0
  * Author: Tony Baldwin <https://free-haven.org/profile/tony>
+ * Author: Michael Johnston
+ * Author: Cat Gray <https://free-haven.org/profile/catness>
  */
 
 function ijpost_install() {
@@ -172,6 +174,7 @@ function ijpost_send(&$a,&$b) {
                $title = $b['title'];
                $post = bbcode($b['body']);
                $post = xmlify($post);
+               $tags = ijpost_get_tags($b['tag']);
 
                $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s');
                $year = intval(substr($date,0,4));
@@ -199,7 +202,7 @@ function ijpost_send(&$a,&$b) {
 <member><name>props</name>
 <value><struct>
 <member><name>useragent</name><value><string>Friendica</string></value></member>
-<member><name>taglist</name><value><string>friendica</string></value></member>
+<member><name>taglist</name><value><string>$tags</string></value></member>
 </struct></value></member>
 </struct></value>
 </param></params>
@@ -216,3 +219,9 @@ EOT;
        }
 }
 
+function ijpost_get_tags($post)
+{
+       preg_match_all("/\]([^\[#]+)\[/",$post,$matches);
+       $tags = implode(', ',$matches[1]);
+       return $tags;
+}