Last active
December 15, 2015 20:48
-
-
Save corpix/5320966 to your computer and use it in GitHub Desktop.
Revisions
-
corpix revised this gist
May 13, 2015 . 1 changed file with 10 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,11 @@ var isUnix = navigator.appVersion.indexOf('Windows') === -1, return s[0].toUpperCase() + s.substr(1); }; var sideEffect = ''; function log(msg) { sideEffect += msg + '\n'; } function scriptTag(src, callback) { var s = document.createElement('script'); @@ -43,14 +48,10 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function title = area .find('.title_wrap') .text() .replace(/^[^A-Za-zА-Яа-я\d_\(\)-]+$/g, '') .replace(/\s+/g, ' ') .replace(/^\s+/, '') .replace(/\s+$/, '') .toLowerCase(); title = title.split(titleDelim).map(capitalize).join(titleDelim); @@ -68,9 +69,11 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function if(isUnix) wget = "[ ! -f '" + title + "' ] && " + wget; log(wget); }); document.write('<pre>'+sideEffect+'</pre>'); }); })() -
corpix revised this gist
May 13, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var isUnix = navigator.appVersion.indexOf('Windows') === -1, titleDelim = ' – ', repeats = { }, capitalize = function(s) { if(!s) return s; return s[0].toUpperCase() + s.substr(1); }; -
corpix revised this gist
Nov 25, 2013 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -43,10 +43,14 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function .find('.title_wrap') .text() .replace(/^[^A-ZА-Я\d_\(\)-]+$/gi, '') .replace(/\([^\)]+\)/g, '') .replace(/"'/g, '') .replace(/,[^\s]/g, ', ') .replace(/\s{2,}/g, ' ') .replace(/^\s+/, '') .replace(/\s+$/, '') .replace(/`/g, '') .toLowerCase(); title = title.split(titleDelim).map(capitalize).join(titleDelim); -
corpix revised this gist
Sep 19, 2013 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -42,10 +42,11 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function title = area .find('.title_wrap') .text() .replace(/^[^A-ZА-Я\d_\(\)-]+$/gi, '') .replace(/\s{2,}/g, ' ') .replace(/^\s+/, '') .replace(/\s+$/, '') .replace(/`/g, ''); title = title.split(titleDelim).map(capitalize).join(titleDelim); @@ -55,9 +56,12 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function if(repeats[title.toLowerCase()]) return; repeats[title.toLowerCase()] = true; title = title + '.mp3'; wget += "-O '" + title + "' "; wget += val.split(',')[0].split('?')[0]; if(isUnix) wget = "[ ! -f '" + title + "' ] && " + wget; console.log(wget); }); -
corpix revised this gist
Sep 19, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -55,9 +55,9 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function if(repeats[title.toLowerCase()]) return; repeats[title.toLowerCase()] = true; wget += '-O "' + title + '.mp3" '; wget += val.split(',')[0].split('?')[0]; console.log(wget); }); -
corpix revised this gist
May 24, 2013 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ var isUnix = navigator.appVersion.indexOf('Windows') === -1, titleDelim = ' – ', repeats = { }, capitalize = function(s) { return s[0].toUpperCase() + s.substr(1); }; @@ -51,6 +52,10 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function title.length > 150 && (title = title.substr(0, 150) + '... '); if(repeats[title.toLowerCase()]) return; repeats[title.toLowerCase()] = true; wget += '-O "' + title + '.mp3" '; wget += val.split(',')[0]; -
corpix revised this gist
May 24, 2013 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -48,6 +48,9 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function title = title.split(titleDelim).map(capitalize).join(titleDelim); title.length > 150 && (title = title.substr(0, 150) + '... '); wget += '-O "' + title + '.mp3" '; wget += val.split(',')[0]; -
corpix revised this gist
May 24, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function scriptTag(src, callback) { }; scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function(){ var $ = jQuery; $('a') -
corpix revised this gist
May 24, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function scriptTag(src, callback) { if(!callback.done && (!state || /loaded|complete/.test(state))) { callback.done = true; callback(); } }; @@ -28,6 +28,7 @@ function scriptTag(src, callback) { scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js', function(){ var $ = jQuery; $('a') .each(function(i, a){ -
corpix revised this gist
May 24, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js', function .replace(/^\s+/, '') .replace(/\s+$/, ''); title = title.split(titleDelim).map(capitalize).join(titleDelim); wget += '-O "' + title + '.mp3" '; wget += val.split(',')[0]; -
corpix revised this gist
May 24, 2013 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,22 +8,22 @@ var isUnix = navigator.appVersion.indexOf('Windows') === -1, function scriptTag(src, callback) { var s = document.createElement('script'); s.type = 'text/' + (src.type || 'javascript'); s.src = src.src || src; s.async = false; s.onreadystatechange = s.onload = function() { var state = s.readyState; if(!callback.done && (!state || /loaded|complete/.test(state))) { callback.done = true; setTimeout(callback, 500); } }; (document.body || head).appendChild(s); }; -
corpix revised this gist
May 24, 2013 . 1 changed file with 39 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,28 +1,33 @@ (function() { var isUnix = navigator.appVersion.indexOf('Windows') === -1, titleDelim = ' – ', capitalize = function(s) { return s[0].toUpperCase() + s.substr(1); }; function scriptTag(src, callback) { var s = document.createElement('script'); s.type = 'text/' + (src.type || 'javascript'); s.src = src.src || src; s.async = false; s.onreadystatechange = s.onload = function() { var state = s.readyState; if (!callback.done && (!state || /loaded|complete/.test(state))) { callback.done = true; setTimeout(callback, 500); } }; (document.body || head).appendChild(s); }; scriptTag('//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js', function(){ $('a') .each(function(i, a){ @@ -31,14 +36,23 @@ jload.DOMLoaded = function(){ if(!val) return; var wget = 'wget' + (isUnix? '' : '.exe') + ' ', title = area .find('.title_wrap') .text() .replace(/^[^A-ZА-Я\d_\(\)-]+$/i, '') .replace(/\s{2,}/g, ' ') .replace(/^\s+/, '') .replace(/\s+$/, ''); title.split(titleDelim).map(capitalize).join(titleDelim); wget += '-O "' + title + '.mp3" '; wget += val.split(',')[0]; console.log(wget); }); }); })() -
corpix revised this gist
May 24, 2013 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -26,13 +26,15 @@ jload.DOMLoaded = function(){ $('a') .each(function(i, a){ var area = $(a).closest('.area'), val = area.find('input[type=hidden]').val(); if(!val) return; var wget = 'wget' + (unix? '' : '.exe') + ' ', title = area.find('.title_wrap').text().replace(/[^A-Z\d_\(\)-]+/i, ''); wget += '-O "' + title + '.mp3" '; wget += val.split(',')[0]); }); -
corpix revised this gist
May 24, 2013 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ (function() { var unix = navigator.appVersion.indexOf('Windows') === -1; jload = function() { jload.getScript("https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"); }; @@ -21,8 +25,18 @@ jload(); jload.DOMLoaded = function(){ $('a') .each(function(i, a){ var val = $(a).closest('.area').find('input[type=hidden]').val(); if(!val) return; var wget = 'wget' + (unix? '' : '.exe') + ' '; wget += '-O "" '; wget += val.split(',')[0]); }); }; })() -
corpix revised this gist
May 24, 2013 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,24 @@ jload = function() { jload.getScript("https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"); }; // dynamically load any javascript file. jload.getScript = function(filename) { var s = document.createElement('script'); s.setAttribute("type","text/javascript"); s.setAttribute("onreadystatechange", "jload.DOMLoaded()"); s.setAttribute("onload", "jload.DOMLoaded()"); s.setAttribute("src", filename); typeof s != "undefined" && document.getElementsByTagName("head")[0].appendChild(s) }; jload(); jload.DOMLoaded = function(){ $('a') .each(function(i,a){ -
corpix revised this gist
May 24, 2013 . 1 changed file with 9 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,18 @@ load = function() { load.getScript("https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"); }; // dynamically load any javascript file. load.getScript = function(filename) { var s = document.createElement('script'); s.setAttribute("type","text/javascript"); s.setAttribute("onreadystatechange", "DOMLoaded()"); s.setAttribute("onload", "DOMLoaded()"); s.setAttribute("src", filename); typeof s != "undefined" && document.getElementsByTagName("head")[0].appendChild(s) }; -
corpix revised this gist
May 24, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,6 @@ function DOMLoaded(){ $('a') .each(function(i,a){ console.log('wget', $(a).closest('.area').find('input[type=hidden]').val().split(',')[0]); }); }; -
corpix revised this gist
May 24, 2013 . 1 changed file with 26 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,27 @@ load = function() { load.getScript("https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"); }; // dynamically load any javascript file. load.getScript = function(filename) { var s = document.createElement('script'); s.setAttribute("type","text/javascript"); s.setAttribute("onreadystatechange", "DOMLoaded()"); s.setAttribute("onload", "DOMLoaded()"); s.setAttribute("src", filename); typeof s != "undefined" && document.getElementsByTagName("head")[0].appendChild(s) }; load(); function DOMLoaded(){ $('a') .each(function(i,a){ console.log('wget', $(a).closest('.area').find('input[type=hidden]').val().split(',')[0]); }), undefined }; -
corpix revised this gist
May 24, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ if(!window.jQuery||confirm('Overwrite\x20current\x20version?\x20v'+jQuery.fn.jquery))(function(d,s){s=d.createElement('script');s.src='https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js';(d.head||d.documentElement).appendChild(s)})(document); $('a') .each(function(i,a){ console.log('wget', $(a).closest('.area').find('input[type=hidden]').val().split(',')[0]); }), undefined -
corpix revised this gist
May 24, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ $('a') //.filter(function(i,a){ return $(a).text() == 'Have A Cow' }) .each(function(i,a){ console.log('wget', $(a).closest('.area').find('input[type=hidden]').val().split(',')[0]); }), undefined -
corpix revised this gist
Apr 5, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ $('a') .filter(function(i,a){ return $(a).text() == 'Have A Cow' }) .each(function(i,a){ console.log('wget', $(a).closest('.area').find('input[type=hidden]').val().split(',')[0]); }), undefined -
corpix created this gist
Apr 5, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ $('a') .filter(function(i,a){ return $(a).text() == 'Have A Cow' }) .each(function(i,o){ console.log('wget', $(o).closest('.area').find('input[type=hidden]').val().split(',')[0]); }), undefined