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 characters
var sys = require('util'), | |
rest = require('restler'); | |
var baseurl = "<<instance URL>>/rest/v10" | |
// get oAuth token | |
var jsonData = {"grant_type":"password","username":"<<username>>","password":"<<password>>","client_id":"sugar"}; | |
rest.postJson(baseurl+'/oauth2/token', jsonData).on('2XX', function(data) { | |
if ( data.error ) { | |
sys.puts("Error: " + data.error_message); |
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 characters
<?php | |
//Use an unlimited amount of memory, we probably shouldn't do this but that is how I roll | |
ini_set('memory_limit', '-1'); | |
//Our program allows us to skip over rows in the data file and only load a sub-set of rows | |
if (count($argv) < 3 || ! is_numeric($argv[1]) || ! is_numeric($argv[2])) { | |
echo "Usage php -f $argv[0] skip max" . PHP_EOL; | |
echo " skip - number of rows to skip when processing" . PHP_EOL; | |
echo " max - number of rows to import when processing" . PHP_EOL; |