-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added crawler, feed support, filter and sorting
- Loading branch information
Showing
19 changed files
with
1,153 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NODE_ENV=dev |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,107 @@ | ||
{ | ||
"name": "sc2-campaign-manager", | ||
"version": "0.5.3-alpha", | ||
"description": "A Campaign Manager for StarCraft II. ", | ||
"main": "main.js", | ||
"build": { | ||
"appId": "com.sc2mapster.campaignmanager", | ||
"mac": { | ||
"category": "demo.app" | ||
}, | ||
"win": { | ||
"target": "nsis" | ||
} | ||
}, | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=dev webpack --watch", | ||
"start": "nf start", | ||
"webpack": "webpack", | ||
"electron": "cross-env NODE_ENV=dev electron .", | ||
"build": "cross-env NODE_ENV=prod electron-builder" | ||
}, | ||
"repository": "https://github.com/abrahamYG/sc2-campaign-manager", | ||
"keywords": [ | ||
"Starcraft", | ||
"demo" | ||
], | ||
"author": "abrahamYG", | ||
"license": "CC0-1.0", | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.4.3", | ||
"@babel/plugin-proposal-class-properties": "^7.4.0", | ||
"@babel/preset-env": "^7.3.1", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/register": "^7.4.0", | ||
"@fortawesome/fontawesome-free": "^5.8.1", | ||
"awesome-typescript-loader": "^5.2.1", | ||
"babel": "^6.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-loader": "^8.0.5", | ||
"babel-preset-flow": "^6.23.0", | ||
"cross-env": "^5.2.0", | ||
"css-loader": "^2.1.0", | ||
"electron": "^4.0.4", | ||
"electron-builder": "^20.41.0", | ||
"electron-devtools-installer": "^2.2.4", | ||
"font-awesome-loader": "^1.0.2", | ||
"foreman": "^3.0.1", | ||
"react-hot-loader": "^4.7.0", | ||
"sass-loader": "^7.1.0", | ||
"source-map-loader": "^0.2.4", | ||
"style-loader": "^0.23.1", | ||
"typescript": "^3.4.2", | ||
"webpack": "^4.29.5", | ||
"webpack-cli": "^3.2.3", | ||
"webpack-dev-server": "^3.1.14" | ||
}, | ||
"dependencies": { | ||
"@types/debug": "^4.1.3", | ||
"@types/download": "^6.2.4", | ||
"@types/electron": "^1.6.10", | ||
"@types/fs-extra": "^7.0.0", | ||
"@types/lodash": "^4.14.130", | ||
"@types/react": "^16.8.13", | ||
"@types/react-dom": "^16.8.3", | ||
"@types/react-images": "^0.5.1", | ||
"@types/react-jsonschema-form": "^1.3.2", | ||
"@types/react-redux": "^7.0.9", | ||
"@types/react-router-dom": "^4.3.1", | ||
"@types/yauzl": "^2.9.1", | ||
"babel-core": "^6.26.3", | ||
"bootstrap": "^4.3.1", | ||
"concurrently": "^4.1.0", | ||
"download": "^7.1.0", | ||
"electron-dl": "^1.13.0", | ||
"electron-reload": "^1.4.0", | ||
"fs-extra": "^7.0.1", | ||
"immutability-helper": "^3.0.0", | ||
"jquery": "^3.4.0", | ||
"lodash": "^4.17.11", | ||
"node-sass": "^4.11.0", | ||
"open-iconic": "^1.1.1", | ||
"popper.js": "^1.15.0", | ||
"rage-edit": "^1.2.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.2", | ||
"react-images": "^0.5.19", | ||
"react-jsonschema-form": "^1.3.0", | ||
"react-jsonschema-form-bs4": "^1.5.1", | ||
"react-lightbox-component": "^1.2.1", | ||
"react-markdown": "^4.0.6", | ||
"react-redux": "^7.0.3", | ||
"react-router-dom": "^4.3.1", | ||
"redux": "^4.0.1", | ||
"yarn": "^1.13.0", | ||
"yauzl": "^2.10.0" | ||
} | ||
"name": "sc2-campaign-manager", | ||
"version": "0.5.4-alpha", | ||
"description": "A Campaign Manager for StarCraft II. ", | ||
"main": "main.js", | ||
"build": { | ||
"appId": "com.sc2mapster.campaignmanager", | ||
"mac": { | ||
"category": "demo.app" | ||
}, | ||
"win": { | ||
"icon": "build/s2icon.png", | ||
"target": "nsis" | ||
}, | ||
"nsis": { | ||
"oneClick":false, | ||
"perMachine":false, | ||
"allowToChangeInstallationDirectory":true | ||
|
||
} | ||
}, | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=dev webpack --watch", | ||
"start": "nf start", | ||
"webpack": "webpack", | ||
"electron": "cross-env NODE_ENV=dev electron .", | ||
"build": "cross-env NODE_ENV=prod electron-builder" | ||
}, | ||
"repository": "https://github.com/abrahamYG/sc2-campaign-manager", | ||
"keywords": [ | ||
"Starcraft", | ||
"demo" | ||
], | ||
"author": "abrahamYG", | ||
"license": "CC0-1.0", | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.4.3", | ||
"@babel/plugin-proposal-class-properties": "^7.4.0", | ||
"@babel/preset-env": "^7.3.1", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/register": "^7.4.0", | ||
"@fortawesome/fontawesome-free": "^5.8.1", | ||
"awesome-typescript-loader": "^5.2.1", | ||
"babel": "^6.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-loader": "^8.0.5", | ||
"babel-preset-flow": "^6.23.0", | ||
"cross-env": "^5.2.0", | ||
"css-loader": "^2.1.0", | ||
"electron": "^4.0.4", | ||
"electron-builder": "^20.41.0", | ||
"electron-devtools-installer": "^2.2.4", | ||
"font-awesome-loader": "^1.0.2", | ||
"foreman": "^3.0.1", | ||
"react-hot-loader": "^4.7.0", | ||
"sass-loader": "^7.1.0", | ||
"source-map-loader": "^0.2.4", | ||
"style-loader": "^0.23.1", | ||
"typescript": "^3.4.2", | ||
"webpack": "^4.29.5", | ||
"webpack-cli": "^3.2.3", | ||
"webpack-dev-server": "^3.1.14" | ||
}, | ||
"dependencies": { | ||
"@types/debug": "^4.1.3", | ||
"@types/download": "^6.2.4", | ||
"@types/electron": "^1.6.10", | ||
"@types/fs-extra": "^7.0.0", | ||
"@types/lodash": "^4.14.130", | ||
"@types/react": "^16.8.13", | ||
"@types/react-dom": "^16.8.3", | ||
"@types/react-images": "^0.5.1", | ||
"@types/react-jsonschema-form": "^1.3.2", | ||
"@types/react-redux": "^7.0.9", | ||
"@types/react-router-dom": "^4.3.1", | ||
"@types/yauzl": "^2.9.1", | ||
"babel-core": "^6.26.3", | ||
"bootstrap": "^4.3.1", | ||
"concurrently": "^4.1.0", | ||
"download": "^7.1.0", | ||
"electron-dl": "^1.13.0", | ||
"electron-reload": "^1.4.0", | ||
"fs-extra": "^7.0.1", | ||
"h2m": "^0.7.0", | ||
"immutability-helper": "^3.0.0", | ||
"jquery": "^3.4.0", | ||
"lodash": "^4.17.11", | ||
"node-sass": "^4.11.0", | ||
"open-iconic": "^1.1.1", | ||
"popper.js": "^1.15.0", | ||
"rage-edit": "^1.2.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.2", | ||
"react-images": "^0.5.19", | ||
"react-jsonschema-form": "^1.3.0", | ||
"react-jsonschema-form-bs4": "^1.5.1", | ||
"react-lightbox-component": "^1.2.1", | ||
"react-markdown": "^4.0.6", | ||
"react-redux": "^7.0.3", | ||
"react-router-dom": "^4.3.1", | ||
"redux": "^4.0.1", | ||
"sc2mapster-crawler": "git+https://github.com/SC2Mapster/sc2mapster-crawler.git", | ||
"yarn": "^1.13.0", | ||
"yauzl": "^2.10.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {scrapper as mscrap} from "sc2mapster-crawler"; | ||
import Campaign, { ICampaign, IScreenshot, ISC2Component, ISC2Map } from "./Campaign"; | ||
import path from 'path' | ||
import h2m from 'h2m' | ||
const conn = new mscrap.MapsterConnection(); | ||
|
||
export const getCampaignFromMapster = async (projectId:string):Promise<ICampaign> => { | ||
const project = await conn.getProjectOverview(projectId); | ||
const screenshots:IScreenshot[] = (await conn.getProjectImages(projectId)).images.map(img =>({ | ||
src:img.imageUrl, | ||
description:h2m(img.caption) | ||
})); | ||
let maps:ISC2Component[] = [] | ||
|
||
for await(const f of await conn.getProjectFilesList(projectId)){ | ||
const fileData = await conn.getProjectFile(projectId,f.id); | ||
const map:ISC2Component = { | ||
name:fileData.title, | ||
description:h2m(fileData.description.html), | ||
destination:`maps/${fileData.filename}`, | ||
source:`https://www.sc2mapster.com/projects/${projectId}/files/${fileData.id}/download`, | ||
sourceFormat:path.extname(fileData.filename), | ||
fileEntry:"" | ||
} | ||
maps.push(map); | ||
} | ||
return { | ||
...Campaign.emptyCampaign(), | ||
id: projectId, | ||
name:project.base.name, | ||
description: h2m(project.description.html), | ||
author:project.owner.name, | ||
thumbnail:project.base.thumbnail, | ||
lastUpdated:project.updatedAt.toISOString(), | ||
patchNotes:[], | ||
videos:[], | ||
screenshots, | ||
maps, | ||
mods:[] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.