Plugin idea: text file import

Creating and modifying plugins.
Post Reply
User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Plugin idea: text file import

Post by yellowled » Sat Nov 17, 2012 2:38 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2254
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Plugin idea: text file import

Post by onli » Sat Nov 17, 2012 5:19 pm

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.

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Plugin idea: text file import

Post by yellowled » Sat Nov 17, 2012 10:48 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Plugin idea: text file import

Post by garvinhicking » Mon Nov 19, 2012 10:04 am

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/

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Plugin idea: text file import

Post by yellowled » Mon Nov 19, 2012 12:35 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
robert
Regular
Posts: 1042
Joined: Mon May 09, 2005 9:17 pm
Location: Vienna, Austria
Contact:

Re: Plugin idea: text file import

Post by robert » Mon Nov 19, 2012 10:52 pm

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?
Nur ein Blog ...auf robertlender.info - natürlich mit S9y betrieben

S9y InfoCamp - der (inoffizielle) S9y-Podcast

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Plugin idea: text file import

Post by yellowled » Tue Nov 20, 2012 6:57 am

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

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

Re: Plugin idea: text file import

Post by mattsches » Tue Nov 20, 2012 11:14 am

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

User avatar
robert
Regular
Posts: 1042
Joined: Mon May 09, 2005 9:17 pm
Location: Vienna, Austria
Contact:

Re: Plugin idea: text file import

Post by robert » Tue Nov 20, 2012 8:39 pm

@yellowled

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

I was sorry, that Textile is not so supported by many software products like blogging clients...
Nur ein Blog ...auf robertlender.info - natürlich mit S9y betrieben

S9y InfoCamp - der (inoffizielle) S9y-Podcast

Macy
Posts: 1
Joined: Thu Jan 02, 2014 5:08 pm

Re: Plugin idea: text file import

Post by Macy » Thu Jan 02, 2014 5:13 pm

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