Skip to content

Commit

Permalink
Migrate _providers folder to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
LkeMitchll committed Jan 8, 2024
1 parent 5a01009 commit e7102f0
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/_data/bookmarks.js
@@ -1,4 +1,4 @@
import BookmarksAPI from '../_providers/bookmarks.cjs';
import BookmarksAPI from '../_providers/bookmarks.js';

function numberedBookmarks(data) {
data.forEach((entry, i) => {
Expand Down
2 changes: 1 addition & 1 deletion src/_data/feeds.js
@@ -1,4 +1,4 @@
import FeedbinAPI from '../_providers/feedbin.cjs';
import FeedbinAPI from '../_providers/feedbin.js';

async function feeds() {
const api = new FeedbinAPI();
Expand Down
2 changes: 1 addition & 1 deletion src/_data/movies.js
@@ -1,4 +1,4 @@
import LetterboxdAPI from '../_providers/letterboxd.cjs';
import LetterboxdAPI from '../_providers/letterboxd.js';

async function movies() {
const api = new LetterboxdAPI();
Expand Down
2 changes: 1 addition & 1 deletion src/_data/music.js
@@ -1,4 +1,4 @@
import LastFMAPI from '../_providers/lastfm.cjs';
import LastFMAPI from '../_providers/lastfm.js';

function dateToEpochWithOffset(time, offset) {
const date = new Date();
Expand Down
2 changes: 1 addition & 1 deletion src/_data/scrapbook.js
@@ -1,4 +1,4 @@
import SaveeAPI from '../_providers/savee.cjs';
import SaveeAPI from '../_providers/savee.js';

async function scrapbook() {
const response = new SaveeAPI();
Expand Down
2 changes: 1 addition & 1 deletion src/_data/speedlify.js
@@ -1,4 +1,4 @@
import SpeedlifyAPI from '../_providers/speedlify.cjs';
import SpeedlifyAPI from '../_providers/speedlify.js';

function convertToPercentage(float) {
return (float * 100).toFixed(0);
Expand Down
6 changes: 3 additions & 3 deletions src/_providers/bookmarks.cjs → src/_providers/bookmarks.js
@@ -1,6 +1,6 @@
const Fetch = require('@11ty/eleventy-fetch');
import Fetch from '@11ty/eleventy-fetch';

module.exports = class BookmarksAPI {
export default class BookmarksAPI {
constructor() {
this.credentials = Buffer.from(
`${process.env.BOOKMARKS_USER}:${process.env.BOOKMARKS_PASSWORD}`,
Expand All @@ -21,4 +21,4 @@ module.exports = class BookmarksAPI {
},
);
}
};
}
6 changes: 3 additions & 3 deletions src/_providers/feedbin.cjs → src/_providers/feedbin.js
@@ -1,6 +1,6 @@
const Fetch = require('@11ty/eleventy-fetch');
import Fetch from '@11ty/eleventy-fetch';

module.exports = class FeedbinAPI {
export default class FeedbinAPI {
constructor() {
this.apiEndpoint = 'https://api.feedbin.com/v2/';
this.credentials = Buffer.from(
Expand All @@ -20,4 +20,4 @@ module.exports = class FeedbinAPI {
},
});
}
};
}
6 changes: 3 additions & 3 deletions src/_providers/lastfm.cjs → src/_providers/lastfm.js
@@ -1,6 +1,6 @@
const Fetch = require('@11ty/eleventy-fetch');
import Fetch from '@11ty/eleventy-fetch';

module.exports = class LastFMAPI {
export default class LastFMAPI {
constructor() {
this.apiEndpoint = 'http://ws.audioscrobbler.com/2.0/';
this.apiKey = process.env.LASTFM_API_KEY;
Expand Down Expand Up @@ -82,4 +82,4 @@ module.exports = class LastFMAPI {
type: 'json',
});
}
};
}
@@ -1,8 +1,8 @@
/* eslint no-underscore-dangle: 0 */
const Fetch = require('@11ty/eleventy-fetch');
const convert = require('xml-js');
import Fetch from '@11ty/eleventy-fetch';
import convert from 'xml-js';

module.exports = class LetterboxdAPI {
export default class LetterboxdAPI {
constructor() {
this.apiEndpoint = 'https://letterboxd.com/luke_mitchell/rss';
}
Expand Down Expand Up @@ -31,4 +31,4 @@ module.exports = class LetterboxdAPI {

return result;
}
};
}
6 changes: 3 additions & 3 deletions src/_providers/savee.cjs → src/_providers/savee.js
@@ -1,6 +1,6 @@
const Fetch = require('@11ty/eleventy-fetch');
import Fetch from '@11ty/eleventy-fetch';

module.exports = class SaveeAPI {
export default class SaveeAPI {
constructor() {
this.url = 'https://savee.it/api/graphql/';
}
Expand Down Expand Up @@ -39,4 +39,4 @@ module.exports = class SaveeAPI {
},
});
}
};
}
6 changes: 3 additions & 3 deletions src/_providers/speedlify.cjs → src/_providers/speedlify.js
@@ -1,6 +1,6 @@
const Fetch = require('@11ty/eleventy-fetch');
import Fetch from '@11ty/eleventy-fetch';

module.exports = class SpeedlifyAPI {
export default class SpeedlifyAPI {
constructor() {
this.url = 'https://www.11ty.dev/speedlify/api/6798b78.json';
}
Expand All @@ -21,4 +21,4 @@ module.exports = class SpeedlifyAPI {

return request;
}
};
}

0 comments on commit e7102f0

Please sign in to comment.