Skip to content

Commit

Permalink
purge 0data events
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Jun 16, 2024
1 parent 0fbd6d3 commit 346564a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 63 deletions.
2 changes: 1 addition & 1 deletion .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ZDA_VITRINE_FLOWS_TRADITIONAL_URL=https://static.rosano.ca/0data/flowtraditional.svg
ZDA_VITRINE_FLOWS_MODERN_URL=https://static.rosano.ca/0data/flowmodern.svg
ZDA_TASK_BANKS_URLS="https://remotestorage.io/apps,https://github.com/0dataapp/unofficial-fission-apps-list,https://github.com/0dataapp/awesome-0data/raw/master/README.md,https://unhosted.org/apps,https://solidproject.org/apps"
ZDA_TASK_EVENTS_URLS="https://community.remotestorage.io/c/events/12.rss,https://lu.ma/embed-events/usr-q0wId4DZFlx7LCP,https://www.eventbrite.co.uk/o/solid-project-30026804546,https://chat.0data.app/c/events/5.rss"
ZDA_TASK_EVENTS_URLS="https://community.remotestorage.io/c/events/12.rss,https://lu.ma/embed-events/usr-q0wId4DZFlx7LCP,https://www.eventbrite.co.uk/o/solid-project-30026804546"
ZDA_VITRINE_GROUP_DISCUSSION_VIDEO_URL="https://www.youtube-nocookie.com/embed/UNKgD8OzjCk"
ZDA_VITRINE_IDENTITY_URL=https://static.rosano.ca/0data/identity.svg
ZDA_VITRINE_EASY_INDIE_URL=https://easyIndie.app
Expand Down
45 changes: 0 additions & 45 deletions os-app/task-d-events/controller-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ describe('ZDAEventURLSolidProject', function test_ZDAEventURLSolidProject() {

});

describe('ZDAEventURLZeroData', function test_ZDAEventURLZeroData() {

it('returns string', function () {
deepEqual(mod.ZDAEventURLZeroData(), mod.ZDAEventURLs().filter(function (e) {
return e.match(/0data/i);
}).shift());
});

});

describe('_DataEventObjects', function test__DataEventObjects() {

it('throws if param1 not in ZDAEventURLs', function () {
Expand Down Expand Up @@ -167,41 +157,6 @@ describe('_DataEventObjects', function test__DataEventObjects() {

});

context('ZeroData', function test_ZeroData () {

const uEvent = function (inputData = {}) {
const item = Object.assign({
ZDAEventURL: Math.random().toString(),
ZDAEventName: Math.random().toString(),
ZDAEventStart: new Date(),
}, inputData);

return `<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:discourse="http://www.discourse.org/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><atom:link href="https://chat.0data.app/c/events/5.rss" rel="self" type="application/rss+xml" /><item><title>${ item.ZDAEventName }</title><description><![CDATA[
<div class="discourse-post-event" data-start="${ item.ZDAEventStart.toJSON() }" data-status="public" data-end="2021-08-03 14:00" data-allowed-groups="trust_level_0"></div>
]]></description><link>https://chat.0data.app/t/zero-data-swap-2-files-portability-september-29-2021/37</link><source url="${ item.ZDAEventURL }.rss">Zero Data Swap #2: Files / Portability — September 29, 2021</source></item></channel></rss>`;
};

it('parses data', function () {
const ZDAEventURL = Math.random().toString();
const ZDAEventName = Math.random().toString();
const ZDAEventStart = new Date();

deepEqual(mod._DataEventObjects(mod.ZDAEventURLZeroData(), uEvent({
ZDAEventURL,
ZDAEventName,
ZDAEventStart,
})), [{
ZDAEventURL,
ZDAEventName,
ZDAEventStart,
}]);
});

});



});

describe('DataEvents', function test_DataEvents() {
Expand Down
17 changes: 0 additions & 17 deletions os-app/task-d-events/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ const mod = {
}).shift();
},

ZDAEventURLZeroData () {
return mod.ZDAEventURLs().filter(function (e) {
return e.match(/0data/i);
}).shift();
},

async _DataContentString (inputData) {
return (await require('node-fetch')(inputData)).text();
},
Expand Down Expand Up @@ -122,17 +116,6 @@ const mod = {
};
});
},
[mod.ZDAEventURLZeroData()]: function () {
return cheerio('channel', param2).first().find('item').filter(function () {
return cheerio('description', this).html().match('discourse-post-event');
}).map(function () {
return {
ZDAEventURL: cheerio('source', this).attr('url').split('.rss').shift(),
ZDAEventName: cheerio('title', this).text(),
ZDAEventStart: new Date(cheerio('description', this).html().match(/data-start="(.*)/)[0].split('"')[1]),
};
});
},
}[item],
});
}, {})[param1]()).map(function (e) {
Expand Down

0 comments on commit 346564a

Please sign in to comment.