Skip to content

Commit

Permalink
fix: scraper of unity versions (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
webbertakken authored Dec 12, 2022
1 parent 9f53173 commit 523da4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "echo \"No tests yet, feel free to add\" && exit 0"
},
"engines": {
"node": "10"
"node": "12"
},
"main": "lib/index.js",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions functions/src/logic/ingestUnityVersions/scrapeVersions.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { getDocumentFromUrl } from '../utils/get-document-from-url';
import { EditorVersionInfo } from '../../model/editorVersionInfo';

const UNITY_ARCHIVE_URL = 'https://unity3d.com/get-unity/download/archive';
const UNITY_ARCHIVE_URL = 'https://unity.com/releases/editor/archive';

/**
* Based on https://github.com/BLaZeKiLL/unity-scraper
*/
export const scrapeVersions = async (): Promise<EditorVersionInfo[]> => {
const document = await getDocumentFromUrl(UNITY_ARCHIVE_URL);

const links = Array.from(document.querySelectorAll('a.unityhub[href]'));
const links = Array.from(document.querySelectorAll('.release-links div:first-child a[href]'));
const hrefs = links.map((a) => a.getAttribute('href')) as string[];

const versionInfoList = hrefs.map((href) => {
Expand Down

0 comments on commit 523da4e

Please sign in to comment.