Plugin idea: text file import

Creating and modifying plugins.
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Plugin idea: text file import

Post by yellowled »

So this might be another one of those ideas which not too many users might actually need or want. It might as well be already possible without me being aware of it. If so, don't hesitate to laugh at me. :wink:

I love Markdown. I'm not even sure whether I actually love Markdown or just iA Writer, but either way, they're a comfortable combo to write blog articles with. There are other markup languages like Textile or BBCode as well as tons of other popular editors and writing apps.

Also, to my knowledge there still is no comfortable blog editor for use with s9y available on most platforms. There probably never will be a specific “offline” editor for s9y anyway, so we might as well think about other options to “emulate” something like that.

So what I have in mind is a plugin which would check a dedicated directory in the s9y installation (i.e. templates_c/entries/ or something) for new text files periodically (Do we need cron for that? cron might not be available for most shared hosting users). If it finds new text files, it puts the contents of said files in new entries and publishes them. These files could contain any compatible markup – HTML, Markdown, Textile, BBCode, even plain text. They would probably need to have some kind of header to contain meta data like entry title, author, date, tags etc.

Users could write these text-based entries offline in their favourite text editor and upload them using their preferred or available method (ftp or ssh). Maybe (but this is a bit optimistic, I guess) the plugin could also be able to pull files from a Dropbox?

Is this feasible? Anyone up for it?

YL
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Plugin idea: text file import

Post by onli »

Hi YL
I like the Dropbox-idea. They just extended their api in that direction. One should probably use dropbox more anyway, for example for the media library.

Apart from that, two remarks:
1. for reliably periodical checking we need cron. I simulated cron based on pageloads for the trackback-plugin, but that is not reliable (for not-high-traffic blogs), but if someone is willing to work on this, that could be of some help.
2. I was under the impression that Grischa put quite some work in the xmlrpc-plugin, so the premise that there is no comfortable blog-editor could be wrong. Though I don't know a specific one which is good and should work.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Plugin idea: text file import

Post by yellowled »

onli wrote:I was under the impression that Grischa put quite some work in the xmlrpc-plugin, so the premise that there is no comfortable blog-editor could be wrong. Though I don't know a specific one which is good and should work.
I remember testing a GTK-based on Linux a looong time ago, but that's about it. I always thought the xmlrpc-based solutions were not ideal because they were always supposed to be used with Moveable Type(?) and didn't support some s9y-specific features like tags at all. (I might be wrong here.)

Also, the flat file idea might not be ideal for blog with (a lot of) images. Or it would need some way to collect images from the dedicated folder as well and put them in the media db, but that might get very complicated in terms of adapting the path to said images …

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Plugin idea: text file import

Post by garvinhicking »

Hi!

Actually, this is more like a simpler version of serendipity_event_popfetcher; instead of parsing an email, it could parse a textfile.

I think the plugin would not even need to parse markup, because it would leave that to the markup plugins by s9y (so that entries can be edited with specific markup after that, and not in HTML mode).

We could easily add a hook to the popfetcher plugin that would remove the dependency on a cronjob, and instead make it execute like delayed_trackbacks or tweetback checks every once in a while on the user side...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Plugin idea: text file import

Post by yellowled »

garvinhicking wrote:I think the plugin would not even need to parse markup, because it would leave that to the markup plugins by s9y (so that entries can be edited with specific markup after that, and not in HTML mode).
Yup. It would also be more flexible since it could import Markdown as well as Textile etc. I only mentioned Markdown because it's everywhere these days. :wink:

YL
robert
Regular
Posts: 1062
Joined: Mon May 09, 2005 9:17 pm
Location: Vienna, Austria
Contact:

Re: Plugin idea: text file import

Post by robert »

I would appreciate this sort of plugin :)

Sorry about to hear that Textile is not the winner of it all :( BTW: Chance to change a blog with hundreds of Textile "markuped" articles to markdown?
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Plugin idea: text file import

Post by yellowled »

robert wrote:Sorry about to hear that Textile is not the winner of it all :(
You are misunderstanding me. The plugin is supposed to be able to import any kind of text file and leave the markup conversion to our markup plugins. That means it will work just as well with Markdown as with Textile, even plain ASCII text or HTML (if the text files only contain the HTML needed for the entry).

YL
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Plugin idea: text file import

Post by mattsches »

robert wrote:BTW: Chance to change a blog with hundreds of Textile "markuped" articles to markdown?
Well, there is Pandoc, which is an universal markup converter. I've never used it so far, but if it lives up to its promise it might be the way to go. Of course, you would need a little script to batch convert your entries ...
robert
Regular
Posts: 1062
Joined: Mon May 09, 2005 9:17 pm
Location: Vienna, Austria
Contact:

Re: Plugin idea: text file import

Post by robert »

@yellowled

Oh, no. I´ve understood it well :)

I was sorry, that Textile is not so supported by many software products like blogging clients...
Macy
Posts: 1
Joined: Thu Jan 02, 2014 4:08 pm

Re: Plugin idea: text file import

Post by Macy »

yellowled wrote:So this might be another one of those ideas which not too many users might actually need or want. It might as well be already possible without me being aware of it. If so, don't hesitate to laugh at me. :wink:

I love Markdown. I'm not even sure whether I actually love Markdown or just iA Writer, but either way, they're a comfortable combo to write blog articles with. There are other markup languages like Textile or BBCode as well as tons of other popular editors and writing apps.

Also, to my knowledge there still is no comfortable blog editor for use with s9y available on most platforms. There probably never will be a specific “offline” editor for s9y anyway, so we might as well think about other options to “emulate” something like that.

So what I have in mind is a plugin which would check a dedicated directory in the s9y installation (i.e. templates_c/entries/ or something) for new text files periodically (Do we need cron for that? cron might not be available for most shared hosting users). If it finds new text files, it puts the contents of said files in new entries and publishes them. These files could contain any compatible markup – HTML, Markdown, Textile, BBCode, even plain text. They would probably need to have some kind of header to contain meta data like entry title, author, date, tags etc.

Users could write these text-based entries offline in their favourite text editor and upload them using their preferred or available method (ftp or ssh). Maybe (but this is a bit optimistic, I guess) the plugin could also be able to pull files from a Dropbox?

Is this feasible? Anyone up for it?

YL
If you have any problem with the cron job settings, you may try http://www.easycron.com
Post Reply