scripting / blue.feedland

A place to discuss and develop an app that connects social media apps via feeds.
MIT License
5 stars 0 forks source link

Intro & how to move feeds from many formats to one JSON-based format #1

Open scripting opened 1 year ago

scripting commented 1 year ago

@johnspurlock -- i started this repo to continue the discussion we started over on the rss repo.

https://github.com/scripting/rss/issues/2

scripting commented 1 year ago

first, one thought about moving to JSON for popularity's sake (which is valid).

in the blueskyreader prototype, i got the feed by calling an intermediary app, feeder.scripting.com, which returns a JSON object.

An example, feeder's version of my Scripting News feed.

this is the output of the reallysimple project I did last year, to come up with a way of flattening out the diffs between all the feed formats and jsonifying it.

i always use reallysimple and feeder for feed reading, if you do it too, we can fix each others bugs and benefit from putting all that history behind us. that's why i put the effort into doing this well.

built on @danmactough's feedparser project. #grateful

The code that reads a feed from a browser app

function readFeed (feedUrl, callback) {
    var url = "http://feeder.scripting.com/returnjson?url=" + feedUrl;
    httpRequest (url, undefined, undefined, function (err, jsontext) {
        if (err) {
            callback (err);
            }
        else {
            try {
                var jstruct = JSON.parse (jsontext);
                callback (undefined, jstruct); 
                }
            catch (err) {
                callback (err);
                }
            }
        });
    }