You are on page 1of 7

yuanoook/podcasts_scripts_download.

js ( javascript)

1 var fs = require('fs');
var request = require('request');
2 var cheerio = require('cheerio');
3
4 var combo = '';
5 var res_count = 0;
6 var episode_indexs = [];
7
8 saveCombo.then(() => {
console.log('success');
9 })
10
11 async function saveCombo() {
12 var combo = '';
13 for (let i = 1; i <= 221; i++)
combo += await getContentOfEpisode(i);
14
15
var filename = './pronuncian.com.podcasts.scripts.html';
16 var content =
17 `<!DOCTYPE html>
18 <html lang="en">
19 <head>
<meta charset="UTF-8">
20 <title>pronuncian.com/podcasts/episodeN</title>
21 </head>
22 <body>
23 ${ combo}
24 </body>
</html>
25 `;
26
27 fs.writeFileSync(filename, content);
28 }
29
30 async function getContentOfEpisode(index) {
return Promise((resolve, reject) => {
31 var url = `https://pronuncian.com/podcasts/episode${episode_index}`;
32 console.log(url);
33 request(url, (err, res, body) => {
34 if (isEmptyPage(body)) return resolve('');
35 var content = cheerio.load(body)('.post');
var header = cheerio.html(content.find('header'));
36 var main = `<div class="paragragh">${cheerio.html(content.find('p'))}</div>`;
37 res = `<div class="page">${header}${main}</div>`;
38 resolve(res);
39 })
})
40 }
41
42 function isEmptyPage(content) {
43 return content.indexOf('The page you are looking for has been moved or deleted.') >
44 }
45
46
47
48
49
50
51
52

scripts download

bojan88/Hacking keyboardrace.com ( digital-command-language)

1
2
Deps.autorun(function () {
3 if (!Session.equals("section", "race")) {
4 this._runing = false;
5 return;
6 }
if (this._runing) {
7 return;
8 }
9 this._runing = true;
10 var n = Session.get("race");
11 var length = $('#paragraph > span').length;
$('#paragraph > span').each(function (ind, el) {
12 Meteor.call("incrementRaceProgress", el.innerHTML, n);
13 if (ind === length - 1) {
14 Meteor.call("raceRank");
15 }
});
16 });
17
18

cmarat/get_freebase_labels.sh ( shell)

curl http://commondatastorage.googleapis.com/freebase-public/rdf/freebase-rdf-2014-06-
1 schema#label>"

Download scripts for

alanrenouf/Download PowerActions Shared Scripts.ps1 ( powershell)

?
1
2
3
4 $uri = "https://github.com/alanrenouf/PowerActions/archive/master.zip"
$file = $Env:Temp + "\master.zip"
5 $destination = ($Env:ProgramData + "\VMware\myNGC\Scripts\")
6 If (! (Test-Path $destination)) {
7 Write-Host "Creating new folder"
8 New-Item $destination -type directory | Out-Null
9 }
Write-Host "Downloading to $file"
10
11 # Download the file
12 $WebClient = New-Object -TypeName System.Net.WebClient
13 $WebClient.DownloadFile($uri, $file)
14
15 if (Test-Path $file) {
$Date = Get-Date
16 $BackupFolder = $env:USERPROFILE + "\Documents\" + $Date.month + "-" + $Date.day +
17 "\"
18 Write-Host "Backing up the current Shared Scripts folder to $BackupFolder"
19 MD $BackupFolder | Out-Null
20 Get-ChildItem $destination -Recurse | Copy-Item -Destination $BackupFolder | Out-Nul
Write-Host "Download complete, extracting to $destination"
21 $shell = new-object -com shell.application
22 $zip = $shell.NameSpace($file)
23 $destinationfolder = $shell.NameSpace($destination)
24 $destinationfolder.CopyHere($zip.Items())
If (Test-Path ($destination + "\PowerActions-master\")) {
25
Write-Host "Moving extracted scripts to Shared Scripts at $destination"
26 Get-Item -path ($destination + "\PowerActions-master\*.*") | Move-Item -Destina
27 Write-Host "Restarting PowerActions Service to register new scripts"
28 Restart-Service P2PSSrv
29 Write-Host "Tidying up"
Remove-Item -Path $file -Confirm:$false -Force | Out-Null
30 Remove-Item ($destination + "\PowerActions-master") -Confirm:$false -Recurse -F
31 Write-Host "Please restart any open browsers with access to the web client to
32 } Else {
33 Write-Host "Extract of files failed"
34 }
} Else {
35 Write-Host "Download failed"
36 }
37
38
39

Download PowerActions Shared Scripts

Winiex/build_and_analyze.sh ( shell)

1 #/usr/bin/env bash
2 #Origin http://5by5.tv/buildanalyze/
3 BASEURL=http://d.5by5.net/redirect.mp3/fly.5by5.tv/audio/broadcasts/buildanalyze/
PREFIX=/buildanalyze-
4 MP3=.mp3
5
6 for i in $(seq 1 1 108)
7 do
8 if [ $i -lt 7 ]
then
9 PODCAST=${BASEURL}2010${PREFIX}00${i}${MP3}
10 elif [ $i -lt 10 ]
11 then
12 PODCAST=${BASEURL}2011${PREFIX}00${i}${MP3}
13 elif [ $i -lt 58 ]
then
14 PODCAST=${BASEURL}2011${PREFIX}0${i}${MP3}
15 elif [ $i -lt 100 ]
16 then
17 PODCAST=${BASEURL}2012${PREFIX}0${i}${MP3}
else
18 PODCAST=${BASEURL}2012${PREFIX}${i}${MP3}
19 fi
20
21 axel -n 10 $PODCAST
22 done
23
24
25
26

Some podcast download scripts.

joehand/ metadata-datasets.js ( javascript)

1 var paginationStream = require('pagination-stream')


var JSONStream = require('JSONstream')
2 var ndjson = require('ndjson')
3 var pump = require('pump')
4 var fs = require('fs')
5 var path = require('path')
6
7 // Downloads opendata.arcgis.com/datasets.json
// Metadata is arcgis api?
8
9 var reqHeaders = {"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) Apple
10 Safari/537.36"}
11 var options = {
12 urlFormat: 'http://opendata.arcgis.com/datasets.json?page=%d&per_page=100',
headers: reqHeaders,
13
start: 0,
14 end: 64,
15 retries: 2
16 }
17
18 var ws = fs.createWriteStream(path.join(process.cwd(), 'datasets.json'))
pump(paginationStream(options), JSONStream.parse('data.*'), ndjson.serialize(), ws, f
19 if (err) throw err
20 })
21
22
23

opendata.arcgis metadata & download scripts

amondnet/Linux32.sh ( shell)

1
2 #!/bin/sh
3 ####
4 # Author: ddavison
5 # Description: Download the Linux chromedriver into the current directory
####
6 function downloadchrome {
7 # latest=`curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE`
8 version="2.9"
9 download_location="http://chromedriver.storage.googleapis.com/$version/chromedriver
10 rm /tmp/chromedriver_linux32.zip
wget -P /tmp $download_location
11 unzip /tmp/chromedriver_linux32.zip -d .
12 mv ./chromedriver ./chromedriver.linux
13 chmod u+x ./chromedriver.linux
14 }
downloadchrome
15
16

Chromedriver Download Scripts

Maden-maxi/download_external.php ( php)

1 <?php
2
function download_file( $file_url, $save_to ) {
3 $content = file_get_contents( $file_url );
4 file_put_contents( $save_to, $content );
5 }
6
7 if ( ! wp_next_scheduled( 'download_external_scripts_cron_hook' ) ) {
wp_schedule_event( time(), 'daily', 'download_external_scripts_cron_hook' );
8 }
9 add_action( 'download_external_scripts_cron_hook', 'download_external_scripts_cron_ex
10 function download_external_scripts_cron_exec() {
11 $extranals = array(
'devicepx' => 'https://s0.wp.com/wp-content/js/devicepx-jetpack.js',
12 'googleanalytics-platform-sharethis' => 'https://platform-api.sharethis.com/js
13 'grofiles-cards' => 'https://secure.gravatar.com/js/gprofiles.js'
14 );
15 $local_exterbals = [];
foreach ($extranals as $name => $url) {
16 $local_exterbals = [$key] => pathinfo($url, PATHINFO_BASENAME);
17 }
18 $save_to_path = __DIR__ . '/scripts';
19 if( !is_dir($save_to_path) ) mkdir($save_to_path);
20 foreach ($extranals as $name => $url) {
$filename = pathinfo($url, PATHINFO_BASENAME);
21 download_file( $url, __DIR__ . '/scripts/' . $filename );
22 }
23 }
24
25
26
27
28

Download exteranls scripts

fxposter/hacking-chef.rb ( ruby)

1
@chef.eval_and_check_for_changes do |frame|
2 template "/etc/default/#{service_id}" do
3 source "service.erb"
4 variables :name => service_id, :port => frame.eval{@service.port}
5 mode 0755
end
6 end
7

Hacking Chef

fskreuz/Hacking keyboardrace.com ( digital-command-language)

// Let's cache a few things that are static. Setup times don't matter.
1 var e = $.Event('keydown');
2 e.which = 32;
3 e.keyCode = 32;
4
5 var input = $('#typer-input')[0];
6 var words = $('#paragraph > span').get().map(function(element){
return element.innerHTML;
7 });
8
9 // All the moving parts live here. This we have to keep as fast as possible.
10 Deps.autorun(function() {
var word = words[Session.get("race_progress")];
11 if(!word) return;
12 input.value = word + ' ';
13 TypeChecker.keydown(e);
14 });
15
16
17