Skip to content

Commit

Permalink
Merge pull request #32 from ogewan/future
Browse files Browse the repository at this point in the history
Future
  • Loading branch information
ogewan authored May 1, 2018
2 parents 71409bf + f09010d commit 0c193d2
Show file tree
Hide file tree
Showing 65 changed files with 3,970 additions and 2,066 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.old
_site/
.DS_Store
*.jar
*.bat
swatches.html
swatches.html
node_modules/
.vscode/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ![C](https://raw.githubusercontent.com/ogewan/comix-ngn/master/assets/static-c-comixngn.png)omix-ngn
![](https://img.shields.io/github/release/ogewan/comix-ngn.svg) [![JS.ORG](https://img.shields.io/badge/js.org-dns-ffb400.svg?style=flat-square)](http://js.org) [![Join the chat at https://gitter.im/seun40/comic-ng](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ogewan/comix-ngn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Issue Stats](http://www.issuestats.com/github/ogewan/comix-ngn/badge/pr?style=flat)](http://www.issuestats.com/github/ogewan/comix-ngn) [![Issue Stats](http://www.issuestats.com/github/ogewan/comix-ngn/badge/issue?style=flat)](http://www.issuestats.com/github/ogewan/comix-ngn) ![](https://img.shields.io/github/downloads/ogewan/comix-ngn/latest/total.svg)
![](https://img.shields.io/github/release/ogewan/comix-ngn.svg) [![JS.ORG](https://img.shields.io/badge/js.org-dns-ffb400.svg?style=flat-square)](http://js.org) [![Join the chat at https://gitter.im/seun40/comic-ng](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ogewan/comix-ngn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <!--[![Issue Stats](http://www.issuestats.com/github/ogewan/comix-ngn/badge/pr?style=flat)](http://www.issuestats.com/github/ogewan/comix-ngn) [![Issue Stats](http://www.issuestats.com/github/ogewan/comix-ngn/badge/issue?style=flat)](http://www.issuestats.com/github/ogewan/comix-ngn)--> ![](https://img.shields.io/github/downloads/ogewan/comix-ngn/latest/total.svg)

**The Modern Webcomic Engine**
## Usage
Expand Down
1,417 changes: 0 additions & 1,417 deletions comixngn.js

This file was deleted.

8 changes: 4 additions & 4 deletions comixngn.js.map

Large diffs are not rendered by default.

152 changes: 76 additions & 76 deletions comixngn.min.js

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions extension/cngn_node/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* @module cngn_node
* Creates a script for a given webcomic via webcrawling.
*/
var request = require('request'),
url = require('url'),
base = 'https://www.xkcd.com/',
linkdct = {
[base]: true
},
queue = [base],
active,
imgdct = {},
getback = function() {
if (queue.length) {
active = queue.pop();
request(active, function(err, response, body) {
if (err) throw err;
var resultlist = parseHTML(body);
return getback();
});
}
return imgdct;
},
parseHTML = function(str) {
var result, arr = str.split(/<|>/g);
result = arr.filter(function(ele) {
var nde = ele.split(" ")[0];
return nde == "a" || nde == "img";
});
result = result.map(function(ele) {
var nde = ele.split(" "),
obj = {},
tmp;
for (var i = 0; i < nde.length; i++) {
if (!i) {
obj.type = nde[0];
} else {
tmp = nde[i].split("=");
if (tmp[0] == "href") {
tmp[1] = tmp[1].replace(/"/g, "");
if (tmp[1].indexOf(base) + 1 || 1) {
if (!linkdct[tmp[1]]) {
linkdct[tmp[1]] = true;
queue.push(tmp[1]);
}
}
} else if (tmp[0] == "src") {
tmp[1] = tmp[1].replace('"', "");
imgdct[tmp[1]] = imgdct[tmp[1]] + 1 || 1;
}
}
}
return obj;
});
return result;
};

//get('https://www.xkcd.com/').asString(function(err, data) {
getback();
13 changes: 13 additions & 0 deletions extension/cngn_node/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "cngn_node",
"version": "1.0.0",
"description": "",
"main": "main.js",
"author": "ogewan",
"license": "ISC",
"dependencies": {
"get": "^1.4.0",
"install": "^0.10.4",
"jsdom": "^11.6.2"
}
}
Binary file added factory/compiler.jar
Binary file not shown.
33 changes: 33 additions & 0 deletions factory/def_libs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0c193d2

Please sign in to comment.