WordPress.org

Ready to get started?Download WordPress

Forums

AutoUpdate LiveJournal Hack (52 posts)

  1. Laughinglizard
    Member
    Posted 10 years ago #

    This script allows every post that you publish on your WordPress blog to also be reflected (or added) to your LiveJournal blog automatically. This script only emulates publishing to your LJ blog, you cannot edit LiveJournal entries once they are published (through the WP admin page). If there is enough interest, I could come up with edit functionality as well as others such as moods and music. Here is a link to the hack instructions.
    The items sent to LiveJournal are your post title, your post content and the date and time of your post. Enjoy.
    Please post bugs to http://dinki.mine.nu/word/

  2. Laughinglizard
    Member
    Posted 10 years ago #

    There is a little bugfix for this hack. The hack tutorial has been updated.

  3. carthik
    Member
    Posted 10 years ago #

    Thanks LL for the great script. I an sure this feature will come in handy to those on Lj who want a blog AND their LJ friends....

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    there's somethings i noticed :) overall it the hack works, which is great. But as in wp how there is the option for the 'time difference' the current time is sent to lj wrong... meaning how i write a post @ 11ish my time, and the time differences on wp shows my actual time, yet in lj, it shows that the time is 8ish... my 3hr time difference does not reflect in lj.
    And evertime i post, though it goes through, i get this error when it goes back to post.php
    Warning: Cannot modify header information - headers already sent by (output started at /home/artistia/public_html/ecila/log/my-hacks.php:5) in /home/artistia/public_html/ecila/log/wp-admin/post.php on line 159
    but after a refresh it's gone... but appears everytime i make a new post.
    You can see the effects here
    http://ecila.artistia.net
    &
    http://livejournal.com/~b0owahaha

  5. Laughinglizard
    Member
    Posted 10 years ago #

    I am not sure where the first error comes from. It could be related to you having an extra space or a newline somewhere in your my-hacks.php or in your post.php.
    The current time is sent as the time of your server. This should and can be fixed. As a matter of fact, while I was writing this, I found a quick answer. Look for the fix in the same hack tutorial (just copy the function again)
    Glad you like the hack.
    Peace

  6. wujimon
    Member
    Posted 10 years ago #

    First off, GREAT PLUGIN!. The plugin works great and I did modify it a bit to not crosspost private entries, however I'm having some difficulties when I try to post with a client such as wbloggar. Any suggestions on that? I'll try to look into myself to see if I can come up with anything. GREAT WORK! :)

  7. Laughinglizard
    Member
    Posted 10 years ago #

    Thanks for the positive feedback! In order for the plugin to work through wbloggar (or any other external posting client which uses XMLRPC) follow the tutorial as indicated, but add the following line to xmlrpc.php (found in the root of your blog):
    if ($content) ljautoupdate($content, $post_title);
    Ideally, there are a bunch of places this should be placed, but since it sounds like you are php-aware, put it within the functions that are being used by your bloggar to post to your blog (should be either through the metaWeblog API, the b2 API or the blogger API). That should fix it. If you hace any difficulty, let me know.
    Peace

  8. wujimon
    Member
    Posted 10 years ago #

    I'm not really that "php-aware", but thanks for the strong encouragement. I'm still having difficulty editing the correct parts of the xmlrpc.php file. I've tried adding the code snippet to basically all "new posts" methods in the various APIs but it still does not work. Perhaps I'm doing things wrong. I basically add it after the "$result" line code snippet in the methods. Any help on this would be much appreciated.
    Thanks again.
    w.

  9. Laughinglizard
    Member
    Posted 10 years ago #

    You have the technique just right. However, I believe that w.bloggar uses the b2 API to post. In that case, you would need to add this line after the $result in the "wp_insert_post" function found all the way at the top of xmlrpc.php:
    if ($post_content) ljautoupdate($post_content, $post_title);
    Please let me know if it works.
    Peace

  10. wujimon
    Member
    Posted 10 years ago #

    Hi LL.
    Thanks for all of your help, but I guess it just wasn't meant to be with wbloggar. I tried your suggestion above and it still didn't work. I even tried to include the my-hacks.php file in the beginning of the page code and that didn't work either. I verified that I have enabled hacks and it works when I post using the web interface so that's good. Am I missing something? Have you tried this and gotten it to work? Thanks again.
    w.

  11. Laughinglizard
    Member
    Posted 10 years ago #

    I could try to recreate the hack on my site and send you the files. But that will take a while. Keep checking back! :)

  12. Anonymous
    Unregistered
    Posted 10 years ago #

    this hack works great, except it seems everything that gets posted to livejournal has extra line breaks in it.
    http://zenandjuice.com/word/ is my wordpress version.
    http://www.livejournal.com/users/zenandjuice/ is my lj.
    Any ideas?

  13. OperaManiac
    Member
    Posted 10 years ago #

    it seems LJ is applying it's own auto breaks in addition to WP's auto breaks.

  14. Laughinglizard
    Member
    Posted 10 years ago #

    @zenandjuice: are you using a mac or a linux box when you post your entries? You could try the following and see if it helps:
    Find this inside the ljautoupdate function:
    $lineendings = "pc";
    And you could try the other variations in place of "pc" , namely:
    "unix"
    "mac"

  15. Amy
    Member
    Posted 10 years ago #

    I tried this hack and it works great so far. I'm wondering if it's any way possible to adjust the hack to make each post I make automatically friends only post rather than public one? I find this hack easier to use than when I was on b2. Thanks.

  16. OperaManiac
    Member
    Posted 10 years ago #

    ah, so u converted! :)
    cool...

  17. cra
    Member
    Posted 10 years ago #

    I haven't looked at the code for the hack yet but from LJ: http://www.livejournal.com/manage/emailpost.bml?mode=help
    ----
    Journal entry security
    Security options are set via the lj-header "lj-security". If the security type specified is unknown, the journal entry defaults to private. If no security is specified, the entry is posted according to your default journal security.
    lj-security: public
    lj-security: private
    lj-security: friends
    lj-security: friendgroup
    ----
    As for formatting, I found this url: http://www.livejournal.com/community/lj_userdoc/337025.html and it suggests to use <lj-raw>your post here</lj-raw>

  18. Amy
    Member
    Posted 10 years ago #

    Let you know that the Friends only AutoUpdate LJ script works, LL! I tested and everything is good. Thanks so much for the hack. I'm really enjoying WP so far. Sushubh, yup, I converted and took me a while to figure it out (upgrading). Now ev'thing's running. Great stuff! I'm using 1.01 for now and look forward to next update.

  19. Laughinglizard
    Member
    Posted 10 years ago #

    :-) I am glad! Welcome to the WordPress community!
    Peace

  20. Laughinglizard
    Member
    Posted 10 years ago #

    It is really not very insecure to have the username and password in that file. It is as secure as having a wp-config.php with your database and password in it. Just dont send that file to someone without changing the info first.
    As for the request, I am in the middle of a thesis and extremely busy. However, I am willing to get it done when I have some free time. Could you do me a favor and send me an email reminding me of this and I will try to work that in for you.
    Peace

  21. Kathie
    Member
    Posted 10 years ago #

    I was wondering what to do when I dont want my smilies to show up in the lj entry because of the high bandwidth. I deleted the convert to smilies part. Was that right?

  22. Laughinglizard
    Member
    Posted 10 years ago #

    yep :)

  23. Laughinglizard
    Member
    Posted 10 years ago #

    There is an update to this script. Same download location as above, but features listed here:
    http://wordpress.org/support/10/3475

  24. Anonymous
    Unregistered
    Posted 9 years ago #

    The ability to edit would be awesome
    abstrakONE

  25. Laughinglizard
    Member
    Posted 9 years ago #

    Despite my previous post, at this time there are no plans to make an edit feature for liveJournal blogs.
    :-)

  26. Lilandra
    Member
    Posted 9 years ago #

    i didn't get it to work :-(

  27. savetheclocktower
    Member
    Posted 9 years ago #

    Go to http://www.tdsexperience.com/files/lj-autoupdate.txt for a slightly-modified version of this script. It fixes two issues:

    • The slashes in the subject field weren't being escaped.
    • LJ added extra line breaks, doubling the space between paragraphs.

    If you're using a customized version of this function (like for friends-only posting), then simply make the following changes:
    Find the line
    $subject = $post_title;
    and replace it with:
    $subject = stripslashes(stripslashes($post_title));
    Then find
    $content = convert_chars($content, 'html');
    and add after it:
    $content = wpautop($content);
    $content = "<lj-raw>".$content."</lj-raw>";

    That'll fix the aforementioned problems.

  28. carthik
    Member
    Posted 9 years ago #

    >>LJ added extra line breaks, doubling the space between paragraphs.
    I was getting bugged by this too. If you could mail Mark (LaughingLizard), he would be glad to know the changes made.

  29. Lilandra
    Member
    Posted 9 years ago #

    is this a fix so that you have to have LL's version installed first?

  30. savetheclocktower
    Member
    Posted 9 years ago #

    Yes. Follow his instructions, then make the changes I indicated.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.