Skip to content

Instantly share code, notes, and snippets.

View cbaron's full-sized avatar
😶‍🌫️

Christopher W Baron cbaron

😶‍🌫️
View GitHub Profile
var modulePath = "../node_modules/",
Postgres = function() {
this.connectionString = "#########################"
return this
}
Object.assign( Postgres.prototype, {
_copyTo: require(modulePath+'pg-copy-streams').to,
require('request')(
require('util').format( 'http://www.claritin.com/webservice/allergyforecast.php?zip=%s', postalCode ),
( err, response, body ) => {
if( err ) throw new Error( err )
body = body.replace(/\\/g, "")
try { body = JSON.parse( body.substr( 2, body.length - 3 ) )[0] } catch(e) { return reject(e) }
if( ! body ) throw new Error( "Invalid Zip Code" )
$('<td class="source">').text(row.source)
$('<td class="source">').append(
$('<a>').attr('href', row.source ).text('Whatever I want to say') )
var selector = 'input.marketing';
var iframeDocument = $('iframe.survey').get(0).contentWindow.document;
var url = document.URL;
$( selector, iframeDocument ).val(url);