Chytame chyby, pouzivame http.
This commit is contained in:
		
							parent
							
								
									bd224a3b9e
								
							
						
					
					
						commit
						4b6ecc708a
					
				@ -6,7 +6,13 @@ const mustache = require("mustache");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
console.log('downloading tilde.town homepage...');
 | 
					console.log('downloading tilde.town homepage...');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
axios.get('https://tilde.town/').then(function (response) {
 | 
					axios.get('http://tilde.town/').then(function (response) {
 | 
				
			||||||
 | 
					    if (response.status != 200) {
 | 
				
			||||||
 | 
					        console.log('Chyba!');
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let userRegex = /<a href="\/~(\w+)">[\w]+<\/a>/g;
 | 
					    let userRegex = /<a href="\/~(\w+)">[\w]+<\/a>/g;
 | 
				
			||||||
    var users = Array.from(response.data.matchAll(userRegex), function (result) {
 | 
					    var users = Array.from(response.data.matchAll(userRegex), function (result) {
 | 
				
			||||||
        return result[1];
 | 
					        return result[1];
 | 
				
			||||||
@ -32,7 +38,7 @@ axios.get('https://tilde.town/').then(function (response) {
 | 
				
			|||||||
        setTimeout(() => {
 | 
					        setTimeout(() => {
 | 
				
			||||||
            (async () => {
 | 
					            (async () => {
 | 
				
			||||||
                console.log('downloading ' + user + '...');
 | 
					                console.log('downloading ' + user + '...');
 | 
				
			||||||
                await captureWebsite.file('https://tilde.town/~'+user+'/', user+'.png', {
 | 
					                await captureWebsite.file('http://tilde.town/~'+user+'/', user+'.png', {
 | 
				
			||||||
                    scaleFactor: 0.5,
 | 
					                    scaleFactor: 0.5,
 | 
				
			||||||
                    overwrite: true,
 | 
					                    overwrite: true,
 | 
				
			||||||
                    timeout: 5
 | 
					                    timeout: 5
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user