Skip to content

Commit

Permalink
update fission events
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Jun 16, 2024
1 parent 346564a commit 9f6b106
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions os-app/task-d-events/controller-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ZDAEventURLFission', function test_ZDAEventURLFission() {

it('returns string', function () {
deepEqual(mod.ZDAEventURLFission(), mod.ZDAEventURLs().filter(function (e) {
return e.match(/q0wId4DZFlx7LCP/i);
return e.match(/fission/i);
}).shift());
});

Expand Down Expand Up @@ -105,7 +105,7 @@ describe('_DataEventObjects', function test__DataEventObjects() {
ZDAEventStart: new Date(),
}, inputData);

return `<script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps": {"initialData": {"events": [{"name": "${ item.ZDAEventName }","url": "${ item.ZDAEventURL }","start_at": "${ item.ZDAEventStart.toJSON() }","duration_minutes": 90,"visibility": "public","cover_url": "https://cdn.lu.ma/event-covers/se/3ec890e2-f604-4e76-ad7b-69996063b386","event_type": "independent","recurrence_id": null,"api_id": "evt-nHhXeNbXYwW4DW1","session_count_total": null,"session_count_future": null}]}}}}</script>`;
return `<script id="__NEXT_DATA__" type="application/json">{"props":{"initialUserData":null,"randomSeed":0.4125239166066439,"countryCode":"CA","sha":"e43177ff3c9fb5e66e90db9ead58739e9021defe","initialLocale":null,"initialMessages":null,"pageProps":{"initialData":{"data":{"featured_items":[{"event":{"name":"${ item.ZDAEventName }","start_at":"${ item.ZDAEventStart.toJSON() }","url":"${ item.ZDAEventURL }"}}]}},"_sentryTraceData":"f9b43f74bb1c40ea8b672db7adb94cff-814265555acf4eac-0"}},"page":"/[...url]","query":{"url":["fission"]},"buildId":"d1Og0wHWZGo6L1FKcDWEC","isFallback":false,"isExperimentalCompile":false,"gip":true,"appGip":true,"scriptLoader":[]}</script>`;
};

it('parses data', function () {
Expand All @@ -118,7 +118,7 @@ describe('_DataEventObjects', function test__DataEventObjects() {
ZDAEventName,
ZDAEventStart,
})), [{
ZDAEventURL: require('OLSKLink').OLSKLinkRelativeURL(mod.ZDAEventURLFission(), '/' + ZDAEventURL),
ZDAEventURL,
ZDAEventName,
ZDAEventStart,
}]);
Expand Down
10 changes: 5 additions & 5 deletions os-app/task-d-events/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const mod = {

ZDAEventURLFission () {
return mod.ZDAEventURLs().filter(function (e) {
return e.match(/q0wId4DZFlx7LCP/i);
return e.match(/fission/i);
}).shift();
},

Expand Down Expand Up @@ -85,11 +85,11 @@ const mod = {
});
},
[mod.ZDAEventURLFission()]: function () {
return (param2 ? JSON.parse(param2.split('<script id="__NEXT_DATA__" type="application/json">').pop().split('</script>').shift()).props.pageProps.initialData.events : []).map(function (e) {
return (param2 ? JSON.parse(param2.split('<script id="__NEXT_DATA__" type="application/json">').pop().split('</script>').shift()).props.pageProps.initialData.data.featured_items : []).map(function (e) {
return {
ZDAEventURL: require('OLSKLink').OLSKLinkRelativeURL(param1, '/' + e.url),
ZDAEventName: e.name,
ZDAEventStart: new Date(e.start_at),
ZDAEventURL: e.event.url,
ZDAEventName: e.event.name,
ZDAEventStart: new Date(e.event.start_at),
};
});
},
Expand Down

0 comments on commit 9f6b106

Please sign in to comment.