This file contains 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
[{"messages": | |
{"b61af8a73da92c3fdd0b8fb90866d4cc1140b3cd": | |
{"id":"b61af8a73da92c3fdd0b8fb90866d4cc1140b3cd", | |
"phoneNumber":"+11341343434", | |
"displayNumber":"(734) 123-9456", | |
"startTime":"1314472446198", | |
"displayStartDateTime":"8/27/11 3:14 PM", | |
"displayStartTime":"3:14 PM", | |
"relativeStartTime":"23 minutes ago", | |
"note":"", |
This file contains 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
this.log("Inbox Received"); | |
i = inResponse.indexOf("<json><!")+14; | |
j = inResponse.lastIndexOf("></json>")-1; | |
inboxJSON = JSON.parse(inResponse.substring(i,j)); |
This file contains 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
/* Enyo Platform encapsulation. Include this FIRST in your depends.js. The | |
* first call you make to a function inside it will cause it to perform it's | |
* detection (in the setup function). If you are running in PhoneGap, and your | |
* app depends on accurate results in here, make sure that you are not running | |
* any code that depends on this module until after the "deviceready" PhoneGap | |
* event is fired. | |
* | |
* This prefers direct access to APIs whenever possible - although you CAN run | |
* webOS and WebWorks apps with PhoneGap, I'm trying to avoid going through any | |
* extra layers here. |
This file contains 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 LINE = require('./line.js'); | |
var line = new LINE(); | |
var email = 'your email'; | |
var password = 'your password'; | |
line.login(email, password, function(error, result) { | |
if (error) { | |
return; | |
} |
This file contains 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
/* An incredibly handy function to run several (probably related) Promises simultaneously, | |
* allowing for any given Promise to reject, results will be returned in an object with same key names as the input | |
*/ | |
/* example: | |
* const x = { | |
* api1: () => callApi1(), | |
* api2: () => callApi2(), | |
* api3: () => callApi3(), | |
* }; |
This file contains 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
constants.js: | |
function disallowUndefinedAccess(obj) { | |
const handler = { | |
get(target, property) { | |
if (property in target) { | |
return target[property]; | |
} | |
throw new ReferenceError(`Access unknown ${property.toString()}`); | |
}, |
This file contains 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
javascript:(function() { | |
const getInputElements = () => Array.from(document.getElementsByTagName('input')); | |
const getInfoCompletedElements = () => getInputElements().filter(x => x.type === 'hidden' && x.name.startsWith('infoCompleted')); | |
const getButtonElements = () => Array.from(document.getElementsByClassName('amznBtn')); | |
const getSubmitButtons = () => getButtonElements().filter(x => x.textContent === 'Submit'); | |
getInputElements().forEach(function(x) { if(x.value === 'no') x.click(); }); | |
console.warn('** getInfoCmpletedElements', getInfoCompletedElements()); | |
getInfoCompletedElements().forEach(x => x.value = "1"); |