1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script that posts from txt file

Discussion in 'Cloaking and Content Generators' started by BlakHut, Apr 28, 2010.

  1. BlakHut

    BlakHut Newbie

    Joined:
    Apr 25, 2010
    Messages:
    41
    Likes Received:
    236
    Home Page:
    Is there a script/plug-in that can post automatically from txt files to wordpress?
     
    Last edited: Apr 28, 2010
  2. gogogo

    gogogo Registered Member

    Joined:
    Jun 30, 2008
    Messages:
    67
    Likes Received:
    9
    I am also looking for this if possible. Also, any script that can submit a post to my Wordpress blog even from PHP variables would be nice.

    For example
    I have $title, $content and $tags in variables and I want to submit them as a post as soon as the page is loaded. The thing the OP asks for is very similar to this, the .txt file just needs to be opened and set as variable in PHP.
     
  3. haridada

    haridada Senior Member

    Joined:
    Oct 9, 2008
    Messages:
    996
    Likes Received:
    382
    Location:
    Chennai
    i have a doubt but it might be very noobish. can you convert a txt file into a csv file.

    If we can do it, then there is probable a script called csv2post which can do it.
     
  4. 195471

    195471 Regular Member

    Joined:
    Oct 11, 2008
    Messages:
    417
    Likes Received:
    260
    You could try WPAutoPoster or WPDripper.

    (not aff. URLs)
    Code:
    http://www.wp-autoposter.com/
    http://www.wpdripper.com/
     
  5. gogogo

    gogogo Registered Member

    Joined:
    Jun 30, 2008
    Messages:
    67
    Likes Received:
    9
    I believe this page from the Wordpress documentation will be of great use to the OP (it was for me):
    Code:
    http://codex.wordpress.org/Function_Reference/wp_insert_post
    It explains in detail how you can publish a post on your blog with post title, post content, and all other fields as you like. You just have to set those title, content, etc variables by opening your .txt file(s).
     
  6. haridada

    haridada Senior Member

    Joined:
    Oct 9, 2008
    Messages:
    996
    Likes Received:
    382
    Location:
    Chennai
    And how do you do that? Sorry if that pisses you off. Newb here.
     
  7. gogogo

    gogogo Registered Member

    Joined:
    Jun 30, 2008
    Messages:
    67
    Likes Received:
    9
    Check this PHP function:
    Code:
    http://www.php.net/manual/en/function.file-get-contents.php
    Basically, the .txt file needs to be in the same directory as your wordpress blog and you can read to a string:
    PHP:
    $contents file_get_contents("yourfile.txt");
    Now $string contains the contents of your txt file and you can easily insert that as a post in the blog with the function I gave a few posts back.