ATOM feed now a plugin

199 views
Skip to first unread message

Jim Lehmer

unread,
Dec 29, 2014, 7:02:14 PM12/29/14
to tiddl...@googlegroups.com
What am I doing on my Christmas break? Well, I've read all the TW dev documentation as well as all of the code in boot.js (plus some of the core code as I was trying to figure various things out). And now I have successfully taken my ATOM feed code and made it into a plugin. I have also "parameterized" more of it, so it is not quite as hardcoded as it was before. You can check it out here: https://github.com/dullroar/TW5-atomfeed. The readme should help explain most of it.

Comments appreciated.

Jeremy, one thing that caused me some headaches are the instructions at http://tiddlywiki.com/dev/index.html#Developing%20plugins%20using%20Node.js%20and%20GitHub. I tried to "namespace" it per the instructions, i.e., plugins/dullroar/atomfeed, but boot.js didn't like that because it is looking for plugin.info in each child directory directly under plugins and doesn't seem to recurse any deeper than that, so it would throw an exception in loadPluginFolder at this line:

var pluginInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "plugin.info","utf8"));

...because it couldn't find plugin.info in plugins/dullroar. So I ended up just moving the atomfeed folder "up one" to plugins/atomfeed. What was I doing wrong?

Jim Lehmer

unread,
Dec 31, 2014, 12:25:08 PM12/31/14
to tiddl...@googlegroups.com
Just posted a small bug fix. I was relying on $:/status/UserName to set ATOM's author element, but that only works when running in the browser/served from node, and not when generating a static site from the command line (which is really the whole point). So for now I am simply using the creator field from the most recently modified "article" tiddler (a tiddler that has been tagged, which is what I want for my use, anyway).

Was wondering if I could have used the SetField command instead to set
$:/status/UserName in the command stream, but didn't want to rely on the end user having to know to do that.

Mat

unread,
Jan 1, 2015, 12:04:29 PM1/1/15
to tiddl...@googlegroups.com
Thanks for sharing Jim! I'm not so versed in these things so I hope it's ok with some basic question:

Is the purpose of this all to get a way to check+collect tiddlers from whole tiddlywikis, set up in (exclusively) node.js and on any public server?

Assuming it is (sounds fantastic!!!) - would this allow for a user to have this feed inside a TW and have updaes on external Tiddlywikis automatically be reflected in the users TW? Are tiddlers actually imported (sounds dangerous) or how are things actually expressed/manifested?

I'm hoping for some method that could be used for what I describe here, i.e for a user to have a tiddler that behaves like a live channel either to a specific other TW and that allows for filtering somewhere along the line so to only get the relevant new information (perhaps tiddlers tagged in a specific way) or, even, that this live channel gathers updates from multiple places but, ideally, presented in a user defined way (maybe wrapped inside some CSS).

Is your ATOM feed something that is relevant for these thoughts?

And would it put demands on the "provider" other than, if I get your right, that he has his TW in node.js form?

Thank you again, Jim!

<:-)

Thank you!

Jim Lehmer

unread,
Jan 1, 2015, 6:10:39 PM1/1/15
to tiddl...@googlegroups.com
Actually, my goals were a lot simpler than that. I am currently using TW as an "editor" for my web site, and then generate a static set of pages from it. Since my site used to host my blog, I was wanting a "feed" that could alert of changes and updates by subscribing to http://dullroar.com/atom.xml for anyone who still uses a feed reader in this day and age (I do, but at age 54 I expect the tech tribe to push me out on the ice floe any day now :). That was my sole use case.

However, I am willing to consider fleshing it out more. For example, while the plugin works in-browser, the feed it generates presumes a static set of pages and not TW permalinks. That is probably broken and I need to fix it (I have created an issue for that). Also, right now it supports the summary element in ATOM but not the content element (in other words, it doesn't allow a "full feed" with all the tiddler content but simply a set of tiddler titles and links). I have created an issue for that, too.

HansWobbe

unread,
Jan 1, 2015, 6:53:31 PM1/1/15
to tiddl...@googlegroups.com
On Thursday, January 1, 2015 6:10:39 PM UTC-5, Jim Lehmer wrote:
... Since my site used to host my blog, I was wanting a "feed" that could alert of changes and updates by subscribing to http://dullroar.com/atom.xml for anyone who still uses a feed reader in this day and age (I do, but at age 54 I expect the tech tribe to push me out on the ice floe any day now :). ...

Jim:

So what has the "techie crowd" moved on to?  I'd hate to attract their attention accidentally, just by letting someone see that I still rely on feeds. :-)

Regards,
Hans

Jeremy Ruston

unread,
Jan 2, 2015, 5:26:29 AM1/2/15
to TiddlyWiki
Hi Mat

> Is the purpose of this all to get a way to check+collect tiddlers from whole tiddlywikis, set up in (exclusively) node.js and on any public server?

No. An ATOM feed is a way to publish the rendered HTML content of tiddlers such that it can be read by ATOM feedreaders (eg feedly.com).

So it's really a way of bridging out of the world of TW into conventional blogging infrastructure.

> Assuming it is (sounds fantastic!!!) - would this allow for a user to have this feed inside a TW and have updaes on external Tiddlywikis automatically be reflected in the users TW? Are tiddlers actually imported (sounds dangerous) or how are things actually expressed/manifested?

This sounds like the federation ideas we've been discussing in recent hangouts. Doing it  would be effectively making TW be a consumer of ATOM feeds, rather than a publisher, as here. We'd also need to extend/replace the ATOM file format with something that allows raw tiddlers to be published.

Best wishes

Jeremy.



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Jim Lehmer

unread,
Jan 2, 2015, 9:13:19 AM1/2/15
to tiddl...@googlegroups.com
On Thursday, January 1, 2015 5:53:31 PM UTC-6, HansWobbe wrote:
So what has the "techie crowd" moved on to?  I'd hate to attract their attention accidentally, just by letting someone see that I still rely on feeds. :-)

From what I can tell they have moved on to captive apps on their phones that are receiving pushes of pertinent updates. And I use the word "captive" for a reason. :)

Jim Lehmer

unread,
Jan 2, 2015, 10:23:26 AM1/2/15
to tiddl...@googlegroups.com
Just put up another bug fix, for correctly formatting URLs of tiddlers with spaces in their names.

Jim Lehmer

unread,
Jan 2, 2015, 12:18:46 PM1/2/15
to tiddl...@googlegroups.com
I am trying to fix the bugs in the filesystem plugin and am seeing the same behavior I saw while trying to develop my own plugin. Here is how I have set up, per the online TW dev docs:

1. Forked TW5 into my own GitHub repo.
2. Cloned it down to my local machines (same symptoms occur on Windows and Linux boxes, so it is not that).
3. Changed into the TiddlyWiki5 directory and did npm link.
4. Made my changes.
5. Copied a "Basic client-server edition" tiddlywiki.info file into the root of the repo, to wit:
{
    "description": "Basic client-server edition",
    "plugins": [
        "tiddlywiki/tiddlyweb",
        "tiddlywiki/filesystem",
        "tiddlywiki/codemirror",
        "tiddlywiki/highlight"
    ],
    "themes": [
        "tiddlywiki/vanilla",
        "tiddlywiki/snowwhite"
    ]
}
However, when I try to start TW with the following command:
node tiddlywiki --server 8083 $:/core/save/lazy-images text/plain text/html Jim
...I get the following error:

fs.js:439
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\plugins\tiddlywiki\plugin.info'
    at Object.fs.openSync (fs.js:439:18)
    at Object.fs.readFileSync (fs.js:290:15)
    at $tw.loadPluginFolder (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1461:34)
    at $tw.loadWikiTiddlers (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1631:23)
    at $tw.loadTiddlersNode (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1671:27)
    at $tw.boot.startup (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1781:7)
    at C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1950:12
    at $tw.boot.decryptEncryptedTiddlers (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1375:2)
    at $tw.boot.boot (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\boot\boot.js:1948:11)
    at Object.<anonymous> (C:\Users\jimle_000\Dropbox\Sandbox\TiddlyWiki5\tiddlywiki.js:13:10)
I get the same stack trace in Linux.

What am I doing wrong? I am obviously missing something.

Jeremy Ruston

unread,
Jan 2, 2015, 12:20:54 PM1/2/15
to TiddlyWiki
Hi Jim

> Copied a "Basic client-server edition" tiddlywiki.info file into the root of the repo, to wit:

That's the problem: you're trying to re-use the TiddlyWiki repo as a wiki folder. You should either create your wiki folder separately, or put it in the 'editions' folder.

Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Jim Lehmer

unread,
Jan 2, 2015, 12:25:06 PM1/2/15
to tiddl...@googlegroups.com
On 1/2/2015 11:20 AM, Jeremy Ruston wrote:
Hi Jim

> Copied a "Basic client-server edition" tiddlywiki.info file into the root of the repo, to wit:

That's the problem: you're trying to re-use the TiddlyWiki repo as a wiki folder. You should either create your wiki folder separately, or put it in the 'editions' folder.

That did it. I knew I was misunderstanding something. Thanks.

HansWobbe

unread,
Jan 2, 2015, 1:36:15 PM1/2/15
to tiddl...@googlegroups.com

Thanks for the insight about the phone apps versus feeds.  As I "mature" ( i.e. run out of time ) I'm finding myself less inclined to use GUIs and more inclined to set up BATch jobs.  Ideally, I'd like my computer to work all night and then wake me with a softly spoken message telling me how much I need to spend today, in order to avoid my successors getting into inheritance fights.  Maybe I should schedule an Antarctic cruse and save folks the trouble of pushing me out on the ice floe.

Mat

unread,
Jan 2, 2015, 7:29:01 PM1/2/15
to tiddl...@googlegroups.com
Your application is in deed also interesing! Thanks for describing it.


>for anyone who still uses a feed reader in this day and age (I do, but at age 54 I expect the tech tribe to
>push me out on the ice floe any day now :).

I get at least half of my news via the Feedly reader (and I'm but a young lad at 41). I just subscribed to your channel and, by the way, and I agree it "should probably support content elements for a "full feed" experience" ;-)
And I "+1" that other point about permalinks too.

Here's a nice read on RSS vs Twitter. I don't know if it is Don Quijote fighting new tech but the article is only a year old and statements like the following do make me buy:

In essence, Twitter is a constantly updated round table discussion — nobody ever discusses their opinion in-depth but adds their two cents here and there. A consequence of that discussion is the inevitable drowning out of some unique, knowledgeable and smart voices. Some of the best arguments are caught in the mix.

RSS, in contrast, reminds me of a scientific debate that takes place between science journal publications. Each writer is allowed to venture deeper into their argument and a retort or response is dealt with some lag time in between.


<:-)

Jim Lehmer

unread,
Jan 2, 2015, 8:00:45 PM1/2/15
to tiddl...@googlegroups.com
On 1/2/2015 6:29 PM, Mat wrote:
I get at least half of my news via the Feedly reader (and I'm but a young lad at 41). I just subscribed to your channel and, by the way, and I agree it "should probably support content elements for a "full feed" experience" ;-)
And I "+1" that other point about permalinks too.

I was a grandfather at 41. :)

I have those two issues logged in the project on GitHub and plan on implementing them, although frankly getting the content element right for all types of tiddlers (images, Markdown, etc.) fills me with fear, which is one of the reasons I've delayed it. :)

Right now I am struggling with another issue with the plugin (trying to move it to my a "dullroar" namespace per the docs), and finding that I am still not quite "there" yet on understanding how it all ties together. Sigh. Two steps forward, 1.9999 steps back.


Here's a nice read on RSS vs Twitter. I don't know if it is Don Quijote fighting new tech but the article is only a year old and statements like the following do make me buy:

I don't disagree. I love RSS/ATOM. It is open (+1), it alerts me of updates in things I care about (+1), it has lots of clients available thanks to Furrygoat's law (+1), and it allows me to pay attention to it only when I want to (+1). And like the author of that article, I too, unsubscribed to most things years ago, and only subscribe to sites/authors who I either know personally or are very carefully curated not to waste my time (it was part of a bigger move on my part to reach "inbox zero," which I've been at for about four years now).

Mat

unread,
Jan 3, 2015, 12:32:45 PM1/3/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Jeremy wrote:

[...] would this allow for a user to have this feed inside a TW and have updaes on external Tiddlywikis automatically be reflected in the users TW?

This sounds like the federation ideas we've been discussing in recent hangouts.

I hadn't thought of this in the federation context and, come to think of it, I'm not really sure of your federated vision (but would love to hear it!). Are you saying RSS would be a good infrastructure for your vision? Anyway, my questions here are more generally trying to figure out if / how much Jims tool would enable TW to behave like a RSS reader (whatever that means. Didn't get that far.)



Doing it  would be effectively making TW be a consumer of ATOM feeds, rather than a publisher, as here.

Assuming "it" refers to the federation ideas, why would it be limited to a consumer of feeds and not also a publisher?
Do you think ATOM feeds + publishing in TW is the best, or at least a very good, technology for your federation ideas? I'm about to post a separate issue on some ideas I have, and maybe this discussion woudl be more appropirate there. It will illustrate the idea on how I hope a TW could display tiddlers remotely located but contrary to common iframes it would allow for some way to include the tiddler into the curren TW. (Actually - I already found a way for this! From within the iframe you can use the normal export tiddler command and simply export that tiddler into your local node.js folder! At least I think this works.) Anyway, it is not necessarily about RSS feeding so will start separate thread over the next few days.



We'd also need to extend/replace the ATOM file format with something that allows raw tiddlers to be published.

Please elaborate a bit. What actually do you mean with "publish" here? Are we talking both some special TW feeder and TW reader? If we could have tiddlers produced in ATOM file format then we could have common RSS readers read them (very desirable). This wikipedia article indicates ATOMs  are in xml form which I understand is generally popular, so hopefully "extend/replace the ATOM file format" would not break this.

Thank you!
Reply all
Reply to author
Forward
0 new messages