Frederick888 / Bitcasa Export Tool

// ==UserScript==
// @name				Bitcasa Export Tool
// @namespace           http://onee3.org/
// @version             0.2
// @description         Mainly for self-use. Make it easier to download from Bitcasa.
// @include				*://my.bitcasa.com/send/*
// @copyright			2014+, Frederick888
// @require				https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==

$text = '';
$regexp = /JSON\.parse\('(.+)'\);/;
$regexp.test($(document).text());
$data = RegExp.$1;
$data = $data.replace(/\\\'/g,'\'');
$json = JSON.parse($data)['items'];

for(var i = 0; i < Object.keys($json).length; i++) {
	$text += 'https://my.bitcasa.com/send/file/download' + encodeURI($json[i]['path']) + '?size=' + $json[i]['size'] + '&mime=' + encodeURIComponent($json[i]['mime']);
	$text += "\n";
}

$toAdd = '<div id="downloadLinksContainer"><textarea id="downloadLinks" style="width:100%;height:300px;font-size:16px;">' + $text + '</textarea></div>';
$('.subHeader').append($toAdd);