Blog Pile

Sprinkle Some Ajax into Feed2JS?

While mulling over how to move Feed2JS to a more stable, friendly, supported home, especially sparked by the comments by David, I am thinking a whole new framework is in order.

Don;t worry, I will leave the legacy… er, curent code as is. My own prime directive is not to break anyone’s previously constructed pasted JavaScript, so no parameters have changed name or purpose since 2004, or whenever it was I rolled this out.

But David’s comments hit home, that having a handful, 10, 20, 50 other sites one could use to generate a feed, were not really “mirrors” as I called them, suggesting if one doesn’t work, the code would tried the next… they are more like dumb clones. I re-called that I had done some test cases, and got working, a time out script, so if a server did not respond (e.g. like when the Maricopa site blinks out) it responds with a JavaScript alert, and an option to abort or keep on trying.

But it would get tricky to send the request to another site in this case, given the logic flow I had set up. But…

This would seem like the perfect time to roll out some AJAX implementation. This might mean that, JS code could seek out the server and parsed RSS content, and display it to a specified part of a page. But let’s say, it got no response… well, perhaps the JS could contain 3 or 5 alternative sites that ti could send the same parameter string to… then it could keep trying. And there should be some way to put a status indicator in the page’s place where the outpit goes.

I’ve only done minimal AJAX but it seems, like the right way to go. Anyone have any thoughts??

The downside is it would take a bit more cutting and pasting, as AJAX calls for a suite of JS code that needs to be in a web page’s content, or linked to a library somewhere. I worry about something that might be more robust functional wise, versus something that might be more challenging to use.

Help?

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

  1. Alan,

    Just had another random thought on this the other day. How about a js include from feed2js.org that had an array of sites, and the feed2js code simply picked one at random. Servers would then sign up, and be added to the array. You could very heavily allow for caching the included array (e.g. once a week), and distribute that file to participating servers. Actually regular pull-downs of that file by participating servers could even maybe be part of the code.

    The net result is that you are simply using a random algorithm to distribute the load over multiple sites rather than any availability detection.

    David

Comments are closed.