@@ -24,55 +24,6 @@ var httpServer = "http://127.0.0.1:" + config.port + "/";
2424String . prototype . repeat = function ( count ) {
2525 return new Array ( count + 1 ) . join ( this ) ;
2626}
27- /**
28- * Search Github from the offical website
29- * Useless
30- */
31- var searchGitHub = function searchGitHub ( ) {
32-
33- var originalData = require ( './ux/WebFrontEndStack.json' ) ;
34- var q = async . queue ( function ( object , callback ) {
35-
36- if ( object . noRequest || object . github || ! object . url || / m o z i l l a | w i k i p e d i a / . test ( object . url ) ) {
37- callback ( false ) ;
38- return ;
39- }
40-
41- console . log ( "Running " + object . name ) ;
42- request ( object . url , function ( err , res , body ) {
43- if ( ! err && res . statusCode == 200 ) {
44- var rep = body . match ( / < a .+ ?h r e f = ( " | ' ) ( [ a - z : \/ ] + ?g i t h u b .c o m .+ ?) ( " | ' ) / ) ;
45- if ( rep === null ) {
46- callback ( false ) ;
47- return ;
48- }
49- object . github = rep [ 2 ] ;
50- callback ( true ) ;
51- }
52- } ) ;
53-
54- } , 5 ) ;
55- var addQueue = function addQueue ( object ) {
56- q . push ( object , function ( err ) {
57- if ( err ) console . log ( object . name + " = " + object . github ) ;
58- } ) ;
59- if ( object . children ) {
60- object . children . forEach ( function ( val ) {
61- addQueue ( val ) ;
62- } ) ;
63- }
64- } ;
65-
66- addQueue ( originalData ) ;
67- q . push ( {
68- noRequest : true
69- } , function ( ) {
70- console . log ( originalData ) ;
71- console . log ( JSON . stringify ( originalData ) ) ;
72- fs . writeFileAsync ( "./ux/WebFrontEndStack.json2" , JSON . stringify ( originalData ) , "utf-8" ) ;
73- } ) ;
74-
75- }
7627
7728/**
7829 * Use to build a promise for some fucking async api.
0 commit comments