Script that posts from txt file

BlakHut

Newbie
Joined
Apr 25, 2010
Messages
41
Reaction score
237
Is there a script/plug-in that can post automatically from txt files to wordpress?
 
Last edited:
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.
 
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.
 
You could try WPAutoPoster or WPDripper.

(not aff. URLs)
Code:
http://www.wp-autoposter.com/
http://www.wpdripper.com/
 
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).
 
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).

And how do you do that? Sorry if that pisses you off. Newb here.
 
And how do you do that? Sorry if that pisses you off. Newb here.

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.
 
Back
Top