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
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
// Print request headers | |
console.log('Headers:'); | |
console.log(req.headers); | |
// Print request body | |
let body = ''; | |
req.on('data', chunk => { |
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
{"v":1,"data":[{"id":"d1","matchUrl":"https://acme.amperity.com/*","rules":[{"type":"headerRule","match":"https://*","requestRules":"","responseRules":"set Access-Control-Allow-Origin: *;remove Content-Security-Policy;remove X-Content-Security-Policy","on":true}],"on":true}]} |
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
// ==UserScript== | |
// @name Custom Segments Builder for Acme | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://acme.amperity.com/?th=44yHf | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=amperity.com | |
// @grant none | |
// ==/UserScript== |
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
const puppeteer = require('puppeteer'); | |
var isBot = { | |
navigate:{ | |
toHome: async function(page){ | |
await page.goto('https://www.accenturepets.com/'); | |
}, | |
toRandomItem: async function(itemId,page){ | |
await isBot.do.clickThis(page,{ | |
//ele:`#maincontent > div.container.home-product-tiles.homepage > div.hp-product-grid > div > div > div > div:nth-child(${itemId}) > div > div > div.image-container > a > img`, | |
ele:`#maincontent > div.container.home-product-tiles.homepage > section > div > article:nth-child(${itemId}) > a > img`, |
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
<script type="text/javascript" src="//cdn.evgnet.com/beacon/partneraccentureaus/accenturepets/scripts/evergage.min.js"></script> |
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 evgHelpers = { | |
brightLog: function(m, c='#0095da') { | |
console.log(`%cEvergage::-> ${m}`, `color: white;background-color:${c};font-size:10px`) | |
}, | |
getDataLayer: async function() { | |
/* This function waits for the datalayer to become accessible to the browser, then it returns | |
a resolved promise that contains the correct DL object. It tries 10 times then gives up if not found.*/ | |
return await new Promise((resolve, reject) => { | |
let c=0 | |
let int = setInterval(_=>{ |
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
// ==UserScript== | |
// @name Example SS Integration | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Example Server Side Integration in IS | |
// @author Sam Bessey | |
// @match https://ecomm-is.vercel.app/* | |
// @grant GM.xmlHttpRequest | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name User Metrics in EDP | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description See Name | |
// @author Sam Bessey | |
// @match https://cust100357a.cheetahedp.com/console/* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js | |
// @resource CHART_JS_CSS https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.css | |
// @resource CARD_CSS https://sambessey-public.s3.eu-west-2.amazonaws.com/card.css |
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
//Client Side async fetch for an IS Campaign - Demo Example | |
// Sam Bessey (sbessey@salesforce.com) | |
let endpoint = 'https://sbessey1084858.germany-2.evergage.com/sscreceiver?_ak=sbessey1084858&_ds=engage&userId=2a1547b87827e1e8&_anon=false&action=ServerSideReq' | |
async function getISData() { | |
let response = await fetch(endpoint) | |
let data = await response.json() | |
return data | |
} | |
getISData().then(data=>{ |
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 evgHelpers = { | |
cleanString: function(input) { | |
console.log(input,'<INPUT---------------------') | |
console.log(input(),'<---------------------') | |
console.log(input().replace(/[^\x20-\x7E]/g, '')) | |
console.log(input().replace(/[^\x20-\x7E]/g, '').length) | |
return input().replace(/[^\x20-\x7E]/g, '') | |
}, | |
getAuthour: function() { | |
let a = "#globalWrapper > main > div:nth-child(3) > div > article > div.content-groupset.pos-beta > div > div.story-text.has-sidebar > div.story-intro.format-s > div > footer > p:nth-child(1) > span > span:nth-child(1) > a" |
NewerOlder